Last reviewed
Correct answer: A. The failures feed the next step, so it revises and runs the suite again
Explanation
The principle — a check that can fail is what turns an attempt into a result. Without one, the only thing deciding the work is finished is the agent itself.
Why the key is correct — the loop's third phase is verification, and its output is not a verdict but an input. Anthropic states that each tool use gives Claude new information that informs the next step, and describes the cycle as gather context, take action, verify results, and repeat until done. A failing test is therefore the loop working as designed: it reads the failure, revises, and runs the suite again. This is also why giving Claude something it can check against changes the quality of what comes back — it turns a plausible edit into one that has been tested.
Why the others are wrong — treating a red test as a terminating failure removes the point of running it. Waiting for your ruling on each result describes a stop-and-ask model rather than an agentic one, though you can interrupt whenever you choose. And finishing because the planned edits are complete confuses the plan with the goal.
Remember this — the loop ends when the check passes, not when the edit is written.
Sources — Anthropic's How Claude Code works and the Claude Code glossary.
Sources
“Each tool use gives Claude new information that informs the next step.”
“The cycle Claude works through for every task: gather context, take action, verify results, and repeat until done.”
Practise 10 questions on this topic
Take Claude Code Basics — Timed Test 2 (10 questions) — scored instantly, explanation for every question, no login.