CCAR-F Agentic Architecture & Orchestration EASY
PRODUCTION SCENARIO
A billing reconciliation agent on Claude Sonnet 5 runs unattended: it inspects customer records, posts ledger adjustments, then writes a summary. How many adjustments a customer needs varies from none to a few dozen, and some turns end with a plain text summary and no further tool call. The loop the team wrote today either recurses without end or exits before the summary is written.

Which control flow governs the loop?

Answering here is anonymous. Nothing is saved unless you sign in.

Show answer and explanation

Answer: Loop while stop_reason is tool_use, returning a tool_result for each, and exit on end_turn

The API already tells the orchestrator what to do next: tool_use means run the requested tools and append tool_result blocks, and end_turn means Claude is finished, which is a signal that holds however many adjustments a customer turns out to need. Forcing a tool call and treating a reporting tool as terminal is the right design when every run must end with a schema-shaped artifact, and it cannot read a turn that closes in plain text, which this agent does. Three orchestrated calls are right when the steps and their count are fixed in advance. A pass ceiling is a safety net worth keeping, and as the termination condition it truncates the customers who need more work.
Free

Keep practicing CCAR-F

59 original CCAR-F practice questions, each with an explanation and a source link. No account needed.

Start free practice set → Timed, explained, free