Roughly 16 of your 60 questions live here. The domain covers the agentic loop, when to split work across subagents, how coordinators and subagents share state, and how tasks get decomposed without falling apart.
1.1
The agentic loop and stop_reason mechanics
Every agent — whether you hand-roll it on the Messages API or use the Agent SDK — runs the same cycle: gather context → take action → verify the result → repeat. In API terms, one iteration looks like this:
send request
+ tools→
check
stop_reason→
execute the
requested tool→
return tool_result
(same tool_use_id)→
repeat until
end_turn
The loop the exam expects you to know cold: request → stop_reason → execute → result → repeat.
stop_reason is the loop's steering wheel. The values you must be able to route on:
| stop_reason | Meaning | Your code should… |
tool_use | Claude paused to call one or more tools | Execute each tool, append a user message containing a tool_result block per call (matching each tool_use_id), send the conversation back |
end_turn | Claude finished its answer | Exit the loop; the task's model-side work is done |
max_tokens | Response was cut off at the token limit | Treat as incomplete — retry with a higher max_tokens or continue; never parse a truncated answer as final |
stop_sequence | A custom stop string you configured was hit | Handle per your protocol |
Two details that show up as distractors: Claude can emit several tool_use blocks in one response (parallel tool calls) — you must return all the matching tool_result blocks in a single following user message. And a failed tool execution is still returned as a tool_result, just with "is_error": true — you don't abort the conversation, you let the model see the failure and adapt.
The third loop step — verify — is the one weak agents skip. Verification means a programmatic check: run the tests, validate the JSON against the schema, re-query the record you just wrote. An agent that "checks its own work" by asking the model whether it did a good job is not verifying anything.
Exam lensGiven a transcript snippet ending in stop_reason: "tool_use", the correct next step is always: execute the tool, send back a tool_result with the matching tool_use_id, and continue the loop. Answers that "start a new conversation," "retry the request," or "return the partial text to the user" are the planted distractors.
1.2
Single agent vs multi-agent — and why hub-and-spoke wins
The exam's favorite architectural decision: when do you add subagents? The honest default is a single agent — simpler, cheaper, no coordination overhead. Subagents earn their cost in three situations:
- Context isolation. A subtask would flood the main context with material the parent doesn't need afterwards (a 50-file search, a long document read). The subagent burns its own context and returns only a distilled result.
- Parallelism. Independent workstreams — research four vendors, review five services — can run concurrently.
- Specialization. A focused system prompt and a narrow toolset make a subagent measurably better at one job (a reviewer with read-only tools, a test-runner with Bash only).
When you do go multi-agent, topology is the question that matters. The pattern Anthropic teaches — and the exam rewards — is hub-and-spoke (coordinator–subagent):
coordinator
owns plan + state
search subagent
analysis subagent
synthesis subagent
Spokes never talk to each other. Results flow back through the hub, which reconciles and decides what happens next.
The coordinator decomposes the task, spawns subagents with self-contained instructions, merges their results, and owns every routing decision. A flat topology — peer agents messaging each other directly — is anti-pattern #7: no single place holds the full picture, errors vanish between peers, conversations diverge, and debugging becomes archaeology.
Corollary the exam loves: because a subagent starts with a fresh, empty context, its prompt must carry everything it needs — the goal, the constraints, the format of the answer it should return. "The subagent will see the conversation" is never true.
Exam lensScenario: a research system's subagents "coordinate among themselves" or "share a group chat." Whatever the other options say, the fix is a coordinator that delegates and synthesizes — hub-and-spoke. Also watch for the reverse trap: adding subagents to a small sequential task, where the correct answer is "keep it a single agent."
1.3
Task decomposition and session state
Decompose along independence lines. Good split: "audit these 8 services for the deprecated API" → 8 parallel subagents, one per service, results merged by the coordinator. Bad split: slicing one tightly-coupled refactor into steps that each depend on the previous agent's in-context knowledge — every handoff loses information. If step B needs most of what step A learned, they belong in one agent.
State lives in three places, and the exam tests whether you know which:
| Layer | What it holds | Lifetime |
| Conversation context | Working memory: recent messages, tool results | One session; finite and consumable |
| Session persistence | Resumable transcripts — --continue / --resume in Claude Code, session ids in the Agent SDK | Across process restarts, same machine |
| External state | Durable facts: order status, checkpoints, artifacts, progress logs — in a DB, file, or ticket system | Survives everything; shared across agents |
The architectural rule: anything that must survive the conversation cannot live only in the conversation. A long-running migration agent should write a checkpoint after each batch (e.g. progress.json, a DB row) so a crash means resuming from batch 47, not starting over. Multi-session workflows (support tickets, week-long projects) key durable state by user or ticket id, and each session loads it as context at start.
Idempotency rides along: if a step can be retried after a crash, executing it twice must be safe — "check then write" beats "append blindly."
Exam lens"The agent lost track of the migration after a restart" → the answer involving external checkpoints beats anything involving "a larger context window" or "better prompting." Durability is an architecture property, not a prompt property.
1.4
Failure handling and verification in agent systems
Distributed-systems rules apply, with one twist: the consumer of your error messages is a model, and models can only act on what they can read. Hence anti-pattern #5: a subagent that fails must never return an empty result. It returns a structured error the coordinator can reason about:
{
"status": "failed",
"category": "rate_limit", // vs "auth", "not_found", "invalid_input"…
"retryable": true,
"attempted": "queried vendor API for Q3 invoices",
"context": "429 after 3 attempts with backoff; endpoint healthy per status page"
}
With that, the coordinator can choose: retry with backoff (transient), reroute to another approach (terminal), continue with partial results and say so, or escalate. With an empty result it can only guess — and a guess propagated through a synthesis step becomes a confident wrong answer.
Partial failure policy belongs in the design. If 3 of 4 research subagents succeed, does the report ship with a stated gap, or block? Either can be right; deciding at 2 a.m. in production is wrong. The exam expects you to name the policy explicitly.
Verification is programmatic. The reliable pattern for "did the agent's code change work" is: run the test suite. For "is the extraction right": validate against the schema, spot-check against source. Retries are bounded (2–3 with backoff), and what you retry is the operation, not the same failing prompt verbatim — feed the error back so the next attempt differs.
Exam lensAny option where a failing subagent "returns an empty list so the pipeline continues smoothly" is the planted anti-pattern. So is "the coordinator asks the model whether the results look right" as the sole verification step — the exam wants tests, schema validation, or an independent check.
Module quiz — D1
24 questions
Scenario-style, one best answer. After each pick you get the full reasoning — including why each wrong option fails. Every answer is saved (and syncs across browsers): leave anytime and you'll resume where you stopped, and the dots above the card let you revisit any answered question.