CertSafari
    Anthropic Claude Certified Architect – Foundations (CCAR-F)· Lessons

    Domain 3 · Lesson 17/30

    Iterating on Test Failures: Batch or Sequence Your Fixes

    Apply iterative refinement techniques for progressive improvement

    8 min read
    3.33% of exam
    4 sources
    Published 4 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Give Claude the actual failure output instead of a description of the symptom
    • Decide whether several issues belong in one detailed message or in separate turns
    • Redirect or roll back a wrong iteration with Esc and /rewind

    1.Give Claude the failure itself

    Once Claude has produced something and your checks have run, the next prompt should give Claude the evidence, not your summary of it. The Claude Code best-practices page shows the difference with before/after pairs. In each case the improved prompt contains the real signal and a definition of done:

    Vague versus evidence-carrying iteration prompts (Claude Code best practices)
    BeforeAfter
    the build is failingthe build fails with this error: [paste error]. fix it and verify the build succeeds. address the root cause, don't suppress the error
    fix the login bugusers report that login fails after session timeout. check the auth flow in src/auth/, especially token refresh. write a failing test that reproduces the issue, then fix it
    add tests for foo.pywrite a test for foo.py covering the edge case where the user is logged out. avoid mocks.

    There are two reasons. A pasted error or failing assertion is specific in a way a paraphrase isn't, so Claude can go after the root cause and not just the symptom you described. And asking Claude to verify ("fix it and verify the build succeeds") closes the loop in the same turn. The page puts it this way: "ask Claude to run the check and iterate in the same message." You can also pipe output in directly, for example cat error.log | claude, so nothing is lost in copying.

    Checkpoint 1 of 5· Check yourself

    After Claude's first implementation, two tests fail. Which follow-up prompt fits the documented guidance best?

    Sources1

    2.One detailed message, or one issue at a time?

    When several things are wrong, should you report them all at once or one by one? The exam's rule is: put interacting issues in one detailed message, and handle independent issues sequentially. The sources don't use the words "interacting" and "independent", but they support both halves of the rule.

    Interacting issues. Anthropic's iterate-and-fix cookbook deliberately includes a failure that is "downstream of the other two." It is there to teach the agent "not to over-fix." If Claude saw that failure alone, the obvious move would be to patch the wrong function. It can only find the shared cause if it sees all the related failures together. So when fixes depend on each other, write one detailed message with all the issues, how they relate, and the order that matters. The platform guidance recommends numbered lists or bullet points "when the order or completeness of steps matters."

    Independent issues. Take a currency-formatting bug in the summary totals and a missing file extension in an export filename. They don't share a cause, and fixing one won't affect the other. Here the advice to split work applies: "Break into multiple prompts (chaining). Each prompt should do one thing well." Anthropic's prompt-engineering guide also notes that a focused task "consistently produces higher quality results than trying to accomplish multiple objectives in a single prompt." Fix one, confirm it passes, then move on to the next. Each turn stays narrow and easy to check.

    Choosing how to present multiple issues
    SituationHow to present itWhy
    Failures share a cause or one is downstream of anotherOne detailed message with every issue and how they relateClaude can fix the root cause once instead of over-fixing symptoms
    Fixes must happen in a particular orderOne message, steps as a numbered listOrder and completeness are explicit
    Failures are in unrelated parts of the codeSeparate prompts, one issue eachEach prompt should do one thing well

    Checkpoint 2 of 5· Check yourself

    A schema change broke a serializer, and the serializer bug in turn causes two API tests to fail. How should you report these to Claude?

    Checkpoint 3 of 5· Exam question

    While reviewing a diff from Claude Code that adds a background job scheduler, an architect notices two problems: the retry backoff logic uses the same shared timer instance that the job-locking logic also relies on to prevent double execution, so changing one affects the other; and separately, a log message uses the wrong log level and needs a one-word fix. How should the architect sequence feedback on these two problems?

    Checkpoint 4 of 5· Exam question

    A team lead wants Claude Code to implement a CSV-to-JSON conversion utility whose column-to-field mapping rules are difficult to describe precisely in words, since the exact handling of empty cells, quoted commas, and duplicate headers matters. Which approach best sets up an effective iterative refinement loop before implementation begins?

    Sources234

    3.Redirecting or rolling back an iteration

    Some iterations go wrong partway through. Claude Code gives you three ways to recover without starting over. Pressing Esc stops Claude mid-action; the context is kept, so you can redirect it with better examples or the failure output. Pressing Esc twice or running **/rewind opens the rewind menu, where you can restore an earlier conversation and code state. Telling Claude "Undo that" has it revert its own changes. If you are moving to an unrelated task, /clear** resets the context, because long sessions full of irrelevant context can reduce performance.

    These tools serve the same goal as the previous sections: catch a wrong direction early, then give Claude a clearer specification or more precise evidence. As the prompt-engineering guide says, "The first prompt rarely works perfectly. Test and refine."

    Checkpoint 5 of 5· Match them up

    Match each control to what it does during iteration

    Tap a term, then the definition that fits it.

    Sources14

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Every failing test needs its own direct fix, so each failure should go to Claude separately.Why is that wrong?

      Some failures are downstream of others. Seeing them together lets Claude fix the shared cause; fixing each symptom directly is over-fixing.

      Covered in One detailed message, or one issue at a time?

    2. 2.Putting every outstanding issue into one big message is always the most efficient approach.Why is that wrong?

      Issues in unrelated code don't benefit from being together. Splitting them into focused prompts that each do one thing tends to give better results.

      Covered in One detailed message, or one issue at a time?

    3. 3.Summarising a failure in your own words ("the build is failing") gives Claude enough to iterate.Why is that wrong?

      The documented improvement is to paste the actual error, ask for a root-cause fix, and have Claude verify the result.

      Covered in Give Claude the failure itself

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “In one prompt: ask Claude to run the check and iterate in the same message, as in the table above.”
      ↩︎ Give Claude the failure itself
      “fix it and verify the build succeeds. address the root cause”
      ↩︎ Give Claude the failure itself
      “Esc: stop Claude mid-action with the Esc key. Context is preserved, so you can redirect.”
      ↩︎ Redirecting or rolling back an iteration
      “fix it and verify the build succeeds. address the root cause”
      ↩︎ Exam trap 3
    2. 2.
      “Provide instructions as sequential steps using numbered lists or bullet points when the order or completeness of steps matters.”
      ↩︎ One detailed message, or one issue at a time?
    3. 3.
      “One of the failures (test_mean) is downstream of the other two, which quietly teaches the agent not to over-fix”
      ↩︎ One detailed message, or one issue at a time?
      “once those are fixed test_mean starts passing on its own without any direct edit to mean()”
      ↩︎ Exam trap 1
      “once those are fixed test_mean starts passing on its own without any direct edit to mean()”
      ↩︎ Prediction
    4. 4.
      “A focused task with clear boundaries consistently produces higher quality results than trying to accomplish multiple objectives in a single prompt.”
      ↩︎ One detailed message, or one issue at a time?
      “The first prompt rarely works perfectly. Test and refine.”
      ↩︎ Redirecting or rolling back an iteration
      “Break into multiple prompts (chaining). Each prompt should do one thing well.”
      ↩︎ Exam trap 2

    Spotted a mistake, or was something unclear? Tell us.