Skip to content
CCAR-F Prep

Domain 1 · 27% of exam

Agentic Architecture & Orchestration flashcards

114 cards distilled from the seven task statements in this domain, one question per fact the exam can actually ask for. Anything you mark “Again” comes back at the end of the round, and again tomorrow — a card you keep getting right moves up a box and goes quiet for longer each time, up to a fortnight.

Use these once you have read the lessons — they test recall, not understanding. For the reasoning behind any answer, the domain curriculum explains it, and the cheat sheet condenses it.

Loading your deck…

Every card in this deck

The whole deck as a list, for scanning or printing.

What are the two stop_reason values the exam keys the agentic loop on?
tool_use (continue the loop) and end_turn (terminate the loop).
List the full stop_reason enum documented in the Messages API.
end_turn, max_tokens, stop_sequence, tool_use, pause_turn, refusal, model_context_window_exceeded.
How should a loop handle pause_turn?
Append the assistant's response to messages unchanged and send the request again with the same tools and no new user message — do not treat it as finished. It means a server-tool loop hit its iteration limit (default 10 per request).
What are the three fields on a tool_use content block?
id, name, input.
Which role carries a tool_result block?
user — there is no separate "tool" or "function" role in the Messages API.
What are the two placement rules for tool_result messages?
1) tool_result must immediately follow the tool_use message (no messages in between). 2) All tool_result blocks must come before any text in that message.
Where does disable_parallel_tool_use live in the request?
Inside the tool_choice object, not as a top-level parameter.
What role should an iteration cap play in an agentic loop?
A safety bound (e.g. SDK's max_turns), never the primary stopping mechanism — that's always stop_reason.
Why is checking response.content[0].type == "text" wrong for detecting loop completion?
Claude can return text alongside tool_use blocks in the same response; text presence doesn't indicate the agent is finished.
Claude's tool call is missing a required parameter. What does your loop send back?
A tool_result with is_error: true naming the problem. Claude can then call the tool again with the missing information filled in; limit how many retries the loop allows. strict: true on the tool definition removes invalid calls.
What is Anthropic's formal name for the hub-and-spoke coordinator-subagent pattern?
Orchestrator-workers.
What is the defining trait that separates orchestrator-workers from the parallelization pattern?
In orchestrator-workers, subtasks are NOT pre-defined — they're determined dynamically by the orchestrator. In parallelization, subtasks are fixed in advance.
Roughly how many more tokens do agents use versus a chat interaction? Multi-agent systems?
Agents: ~4x. Multi-agent systems: ~15x.
What was the measured performance uplift of an Opus 4 lead + Sonnet 4 subagents system over single-agent Opus 4?
90.2%.
Anthropic's research prompts scale agent count to query complexity. What are the three documented tiers?
Simple fact-finding: 1 agent, 3-10 tool calls. Direct comparison: 2-4 subagents, 10-15 calls each. Complex research: 10+ subagents.
Why shouldn't a coordinator route every query through its full subagent pipeline?
Dynamic subagent selection is a coordinator responsibility — a simple factual question may need only the search subagent. Routing everything through the whole chain pays the ~15x multi-agent token premium for no accuracy gain.
What are the two levels of parallelization in a multi-agent research system?
Lead agent spins up 3-5 subagents in parallel; each subagent uses 3+ tools in parallel.
A report on 'renewable energy' only covers solar and wind despite all subagents working correctly. What's the root cause?
The coordinator's task decomposition was too narrow — it never assigned geothermal, tidal, biomass, or fusion to any subagent.
What causes the 'duplicated work' delegation failure mode (distinct from narrow decomposition)?
Vague per-subagent task descriptions — e.g. one subagent covers the 2021 chip crisis while two others both research 2025 supply chains, with nothing dividing the work.
Name two domains where multi-agent orchestration is documented as a poor fit.
Domains requiring shared context or many dependencies across agents, and most coding tasks (fewer parallelizable subtasks than research).
What is the exam-guide name for the subagent-spawning tool, and what is its current Claude Code name?
Exam guide: "Task". Current Claude Code (v2.1.63+): "Agent" in tool_use blocks — Task still appears in the system:init tools list and still works as an alias, so match both names when detecting a spawn.
Which two AgentDefinition fields are required? Which two are optional?
Required: description, prompt. Optional: tools (string[]) and model, among others (disallowedTools, skills, maxTurns…).
What happens if you omit the tools field in an AgentDefinition?
The subagent gets every tool available to subagents (not restricted) — omitting is permissive, not restrictive.
What model alias values does AgentDefinition.model accept?
'fable', 'opus', 'sonnet', 'haiku', 'inherit', or a full model ID; if omitted, the subagent model order applies, which by default means the model of the conversation that starts it.
What are the three ways to create a subagent?
Programmatically (agents option in query()), filesystem-based (.claude/agents/ markdown files), and the built-in general-purpose subagent.
If a programmatic and a filesystem subagent share a name, which wins?
The programmatic definition takes precedence.
How does Claude decide whether to invoke a given subagent automatically?
Based on that subagent's description field — a subagent can also be explicitly requested by name in the prompt.
What is the ONLY content that crosses from a parent to a subagent?
The Agent tool's prompt string — no conversation history, system prompt, or other subagent's output unless explicitly included in that prompt. (A non-fork subagent also has its own system prompt, tool definitions and project CLAUDE.md.)
What happens to a subagent's intermediate tool calls and results?
They stay inside the subagent — only its final message returns to the parent.
Why do parallel subagents finish faster than sequential ones?
Independent subtasks finish in the time of the slowest one rather than the sum of all of them — safe because each subagent has its own isolated context window.
What does fork_session / forkSession do, and what's its default?
When resuming, forks to a NEW session ID instead of continuing the original session. Boolean, default false.
What exactly does a session fork preserve, and what happens to the original?
A copy of history up to the fork point; the original's ID and history stay completely unchanged — two independently resumable sessions result.
What is the SDK's documented permission evaluation order (all six steps)?
Hooks → deny rules → ask rules → permission mode → allow rules → canUseTool callback.
Does a matching deny rule block a tool even in bypassPermissions mode?
Yes — deny rules block the tool even in bypassPermissions mode.
Does a hook returning 'allow' skip the deny and ask rules?
No — a hook allow does not skip deny/ask rules; those are still evaluated regardless of the hook result.
When is canUseTool actually invoked?
Only when no earlier step resolves the call — it's skipped for calls auto-approved by allowedTools, allow rules, acceptEdits, or bypassPermissions.
What's the correct mechanism for a check that must run on EVERY tool call, regardless of permission mode?
A PreToolUse hook — hooks run before every other step, and a hook deny applies even in bypassPermissions mode.
What's the difference between disallowedTools: ["Bash"] and disallowedTools: ["Bash(rm *)"]?
Bare "Bash" removes the tool definition entirely (Claude can't see or attempt it). Scoped "Bash(rm *)" keeps Bash visible; only matching calls are denied, in every mode.
What is the exam's decision rule for choosing programmatic enforcement over prompt guidance?
If a single failure would cause financial loss, security breach, or compliance violation, use programmatic enforcement (hooks/gates); prompt guidance is fine for low-stakes preferences.
Which four fields does the exam guide name for a structured handoff summary?
Customer ID, root cause, refund amount, recommended action. (A short issue summary and the actions already taken are useful additions.)
Why must a handoff summary be self-contained?
The human agent does NOT have access to the conversation transcript — the summary is the only information they receive.
How should multi-concern customer requests be handled?
Decompose into distinct items, investigate each in parallel using shared context, then synthesise a single unified resolution — not sequentially or by addressing only the first item.
Which hook events are available in BOTH the Python and TypeScript Agent SDKs?
PreToolUse, PostToolUse, PostToolUseFailure, UserPromptSubmit, Stop, SubagentStart, SubagentStop, PreCompact, PermissionRequest, Notification.
Are SessionStart and SessionEnd available as Python SDK callback hooks?
No. They are among 23 TypeScript-only events; in Python they exist only as shell command hooks in a settings file.
What does a HookMatcher's matcher field do?
Tests a pattern (e.g. "Write|Edit", or a regex like ^mcp__) against the event's target, usually the tool name. No matcher = the hook runs for every event of that type.
What are the four values a PreToolUse hook's permissionDecision can take?
allow, deny, ask, defer.
What does updatedInput do when paired with permissionDecision: 'allow'?
It rewrites the tool's input and auto-approves the modified call, without prompting the user.
What happens if updatedInput is returned with no permissionDecision set?
The modified input still applies, but it flows through the normal permission evaluation instead of being auto-approved.
What's the difference between PostToolUse's additionalContext and updatedToolOutput?
additionalContext appends info alongside the original result. updatedToolOutput replaces the tool's output before Claude sees it (built-in and MCP tools, both SDKs).
For normalising heterogeneous tool output so the model never sees the raw format, which PostToolUse field is correct?
updatedToolOutput — it replaces the result rather than appending alongside the raw data.
What is the decision priority when multiple PreToolUse hooks return different decisions?
deny > defer > ask > allow. One hook's deny blocks the tool call.
What does returning {} from a hook mean?
Allow the operation without changes.
What two top-level fields apply to every hook output regardless of event type?
systemMessage (message shown to the user) and continue/continue_ (whether the agent keeps running after this hook) — accepted on every event, though some events discard them.
Why is a PostToolUse hook the wrong choice for blocking a policy-violating action like an over-threshold refund?
PostToolUse fires AFTER the tool has already executed — the non-compliant action has already happened by the time the hook runs.
What is Anthropic's formal name for 'fixed sequential pipelines'?
Prompt chaining.
What is the main goal of prompt chaining?
Trade latency for higher accuracy by making each LLM call an easier task.
What is a 'gate' in a prompt chain?
A programmatic check on an intermediate step's output before the chain proceeds.
Which named Anthropic workflow is closest to the exam guide's 'dynamic adaptive decomposition'?
Orchestrator-workers: subtasks are determined by the orchestrator, not pre-defined. The guide's phrase itself is not Anthropic's.
Name the three other named workflow patterns besides prompt chaining and orchestrator-workers.
Routing, parallelization (sectioning and voting), and evaluator-optimizer.
What's the difference between parallelization's sectioning and voting sub-patterns?
Sectioning: independent subtasks run in parallel. Voting: the SAME task run multiple times for diverse outputs (e.g. multiple vulnerability-review passes).
When does evaluator-optimizer work best?
When there are clear evaluation criteria and iterative refinement provides measurable value (e.g. literary translation with a critic LLM).
What does dynamic decomposition need at each step to adapt correctly?
"Ground truth" from the environment — real tool results, test runs, actual file contents — not just prior assumptions.
What is attention dilution, and what are its telltale symptoms?
Inconsistent analysis depth from processing too many items in one pass — detailed feedback for some items and superficial for others, obvious misses, and the same pattern flagged in one item but approved in another.
What is the structural fix for attention dilution?
Multi-pass architecture: per-item local analysis passes (each gets full attention budget) plus a separate cross-item integration pass for cross-cutting concerns.
Does a bigger model or larger context window fix attention dilution?
No — it's an architectural/attention-allocation problem, not a model capability problem.
Where are Claude Code sessions stored on disk?
~/.claude/projects/<encoded-cwd>/*.jsonl, where encoded-cwd replaces every non-alphanumeric character with a dash.
Where does claude --resume <session-id> look for the session?
The current project directory and its git worktrees, then every other project on the machine (v2.1.223+). --continue only looks in the current directory.
What does a resumed session restore?
Full conversation history (tool calls + results), model, agent, permission mode (with conditions), goals, and unexpired scheduled tasks.
A session ended in bypassPermissions and you resume it from the terminal. Which mode does it start in?
The mode a new session would start in — bypass must be enabled again at launch. A session that ended in plan does come back in plan mode.
What's the difference between --continue and --resume?
--continue finds the most recent session in the current directory with no ID tracking (run interactively, it skips claude -p and Agent SDK sessions). --resume takes a specific session ID or name that you must track.
You fork a session to try a second approach. What do you now see in the session picker, and can you get back to the first?
Two independent rows — the fork and the original. The original's ID and history are untouched, so both remain separately resumable.
Do sessions persist file changes made by the agent?
No — sessions persist the conversation only, not the filesystem. File snapshots/reverts are a separate mechanism: checkpointing.
What is checkpointing's blind spot?
A file that only Bash commands changed is not tracked; Bash changes to a file Claude already edited are undone. Most subagent edits are not tracked either.
Why is re-reading changed files not enough on its own in a resumed session?
The old tool results stay in history beside the new read. Telling the agent which files changed marks the old reads as stale; if the staleness is widespread, start fresh with a summary.
What is the correct fix for the stale context problem after file modifications?
A few named files in a mostly valid session: resume and tell the agent which files changed (targeted re-analysis). Tool results stale as a body: fresh session with an injected structured summary and the list of changed files.
Why is fork_session the wrong tool for fixing stale context?
A fork branches from the existing session, which still contains the same stale tool results — the fork inherits the contamination rather than clearing it.
In headless/CI scripting, how do you capture a session ID to resume later?
claude -p "..." --output-format json | jq -r '.session_id' — then pass that ID to --resume.
What can a SubagentStart hook do, and what can't it?
It observes: it receives the subagent's type and id, and can log the spawn or inject context into the run. It cannot block or modify the invocation — to gate spawning itself, put a PreToolUse hook on the Agent tool.
How does a SubagentStop hook gate a subagent's completion?
By returning decision: "block" with a reason, which sends the subagent back to keep working instead of letting it finish. It cannot rewrite the returned output — that's a PostToolUse updatedToolOutput on the Agent tool call.
Should a coordinator's subagent prompts specify goals or step-by-step procedures?
Goals and quality criteria. Procedural instructions constrain the subagent and stop it adapting when it hits a situation the coordinator never anticipated.
The model calls escalate_to_human. Does the loop exit?
No. stop_reason is still tool_use: return the tool_result and let the model write its closing message and reach end_turn.
Your loop's iteration cap fires. What does it return?
A failure (raise, alert, or an explicit incomplete status), never the last response as though it were the answer.
Which message must be appended before the tool results?
The assistant response, unchanged — it holds the tool_use ids the results cite.
In the Agent SDK, what tells you why the loop ended?
The result message's subtype: success, or error_max_turns, error_max_budget_usd, error_during_execution, error_max_structured_output_retries.
When streaming, where does stop_reason arrive?
It is null in message_start and is set in the message_delta event.
One step of a model-driven loop must be guaranteed. Replace the loop with a decision tree?
No. Keep the loop model-driven and put a programmatic gate on the step that must not vary.
What are the two axes for partitioning research scope between subagents?
By subtopic, or by source type — with the boundaries stated in each subagent's brief.
The refinement loop runs out of rounds with gaps still open. What does the coordinator do?
Annotate the remaining gaps in the output rather than presenting the report as complete.
Coordinator round trips add latency and most are simple lookups. What fix does the exam accept?
A scoped cross-role tool for the frequent simple case (e.g. verify_fact); complex cases still go through the coordinator. Never direct subagent-to-subagent calls.
A report is missing whole topic areas. What do you check first?
The coordinator's logged subtasks — a narrow decomposition shows up there directly.
A coordinator answers everything itself instead of delegating. What do you check, in order?
The spawning tool in allowedTools, then the subagent's description, then whether the prompt names the subagent.
Which AgentDefinition part decides whether a subagent is picked, how it behaves, and what it can do?
description: whether it is picked. prompt: how it behaves. tools: what it can do.
Name the three things called 'fork' and what each starts with.
Forked session (fork_session): a copy of saved history. Forked subagent (subagent_type: "fork"): the whole parent conversation. Skill with context: fork: the skill content only, no history.
Why pass findings to synthesis as records rather than prose?
Claim, evidence, source and date stay bound as separate fields, so the claim can still be attributed after it is reworded.
allowedTools and the spawning tool: exam answer vs current docs?
Exam: allowedTools must include "Task" or the coordinator cannot spawn. Current docs: allowedTools only pre-approves; Agent runs whether or not it is listed, and disallowedTools is what removes a tool.
What are the default subagent limits on nesting depth and concurrency?
Depth 3 layers below the main agent, 20 concurrent subagents; no spend cap unless max_budget_usd is set.
Why is forced tool_choice not a prerequisite gate?
It makes one response start with that tool call. It does not stop a gated tool being called on a later turn or check that the lookup came back verified — a gate enforces the order for the whole session.
What must a prerequisite gate's refusal contain?
The missing prerequisite and the way out (e.g. call get_customer, or ask for another identifier), returned to the agent as a tool result — not a bare "denied".
In sample Q1 (get_customer skipped in 12% of cases), why is the routing classifier wrong?
It addresses tool availability rather than tool ordering; a refund legitimately needs all three tools, so the agent can still skip the first.
One of three customer concerns is stuck. What do you escalate?
Only that one, with a structured handoff. Resolve the other two and tell the customer which is which.
A PreToolUse guard callback crashes. What happens to the tool call by default?
It goes ahead (fails open) unless the matcher sets on_failure="block" (onFailure: "block" in TypeScript).
How do you match an MCP tool called process_refund in a hook matcher?
By its full name, mcp__<server>__process_refund (a whole server is mcp__<server>__.*). A bare process_refund matches nothing, and matchers see names only, not arguments.
Who reads permissionDecisionReason for each decision?
deny: the model. ask: the user. allow and defer: the debug log only.
Several PreToolUse hooks match one call. Can one rely on another having run first?
No. Matching hooks run in parallel and finish in no fixed order; make each hook stand alone.
systemMessage or additionalContext: which one reaches the model?
additionalContext. systemMessage is shown to the user, not the model.
Why is capping a $900 refund to $500 with updatedInput wrong?
It issues a refund nobody approved for an amount nobody requested, skips the required escalation and hides the change. Deny the call and redirect to escalation.
Why is can_use_tool not a compliance gate?
It is the last permission step and is skipped for calls approved by an allow rule, acceptEdits or bypassPermissions. Use a PreToolUse hook.
What single property makes a plan adaptive?
The feedback edge: discoveries change the remaining plan. Planned once and executed as written is a fixed pipeline.
Why is 2-of-3 consensus over full-PR review runs wrong for an uneven review?
It suppresses real bugs that are caught only intermittently, and every run is still the crowded single pass, so dilution stays.
Attention dilution or context degradation: which gets /compact?
Context degradation (too many tokens accumulated). Attention dilution (too many targets in one pass) gets split passes.
What is the classifying question between prompt chaining and dynamic decomposition?
Can the subtasks be listed before the work starts? Yes: prompt chaining. No: dynamic decomposition.
Compare two refactoring approaches from one analysis: two fresh sessions, one session, or fork?
Fork once per approach: the baseline is paid for once, stays unchanged, and the branches cannot see each other.
What four parts go into the summary injected into a fresh session?
Established findings, files changed since, open questions, next step — conclusions, not raw tool output.
Does forking a session give the fork its own copy of the files?
No. A fork branches the conversation, not the working tree; its file edits are real and visible to every session in the directory.