Task Statement 1.3·Domain 1 — 27% of exam
Subagent Invocation and Context Passing
Configure subagent invocation, context passing, and spawning
Official Exam Guide Objectives
The objectives below are quoted from Anthropic's Claude Certified Architect – Foundations exam guide, v1.1. Read the exam guide summary for the full blueprint.
Task 1.3: Configure subagent invocation, context passing, and spawning.
Knowledge of
- The Task tool as the mechanism for spawning subagents, and the requirement that allowedTools must include "Task" for a coordinator to invoke subagents
- That subagent context must be explicitly provided in the prompt—subagents do not automatically inherit parent context or share memory between invocations
- The AgentDefinition configuration including descriptions, system prompts, and tool restrictions for each subagent type
- Fork-based session management for exploring divergent approaches from a shared analysis baseline
Skills in
- Including complete findings from prior agents directly in the subagent's prompt (e.g., passing web search results and document analysis outputs to the synthesis subagent)
- Using structured data formats to separate content from metadata (source URLs, document names, page numbers) when passing context between agents to preserve attribution
- Spawning parallel subagents by emitting multiple Task tool calls in a single coordinator response rather than across separate turns
- Designing coordinator prompts that specify research goals and quality criteria rather than step-by-step procedural instructions, to enable subagent adaptability
What You Need to Know
Task Statement 1.3 covers the mechanics under 1.2's architecture: how a coordinator actually spawns a subagent, and what has to travel alongside the request for the result to be worth anything. 1.2 gave you the shape; this is the wiring, and wiring is where most multi-agent systems come apart.
The Task Tool
The Task tool is how a coordinator spawns subagents (the exam guide, v1.1, uses this name). It names a concrete API mechanism in the Claude Agent SDK rather than delegation in the abstract, which is why the exact term matters. Claude Code renamed the tool Agent in v2.1.63: existing Task(...) references still work as aliases, and the Agent SDK now writes Agent into its tool-use blocks. Give "Task tool" as the exam answer and expect Agent in anything written since the rename.
One setting gates the whole pattern on the exam: the coordinator's allowedTools must include "Task" (or "Agent", its current name in Claude Code). The guide states this as a requirement, so read it as binary: where the entry is missing, the coordinator is taken to have no route to its subagents — the definitions can be flawless and every one of them is unreachable, and no prompt compensates for an absent capability. Today's product is more lenient than the guide (the Deep Dive's Current state notes say how), but the guide's rule is the answer to give.
Each subagent is defined by an AgentDefinition. The guide names three parts, and each one fails in its own way:
| Part | What it controls | Get it wrong and… |
|---|---|---|
| Description | Whether the subagent is picked: the summary the coordinator reads when working out whether this is the subagent the current task calls for | The coordinator never delegates, or delegates to the wrong specialist |
| System prompt | How it behaves once picked: the standing instructions the subagent runs under | It behaves like a generic agent |
| Tool restrictions | What it can do: the tools it is permitted, narrowed to its role rather than inherited wholesale from the coordinator | It misuses tools outside its specialisation (Task 2.3) |
A description routes better when it states the boundary as well as the role, for example "Analyses documents supplied by the coordinator. Does not search the web."
On the exam, the allowedTools gate is binary, not gradual, step 1: Coordinator and research-agent both exist, fully defined
When the coordinator does the work itself
The symptom of a missing gate is quiet. Nothing errors: the definitions load, the coordinator answers, and it simply does the research or the support work itself. The failure presents as a quality or latency problem rather than a configuration one. When a stem says the coordinator "answers directly" or "never delegates", check in this order:
- The spawning tool is missing from
allowedTools. This is the guide's requirement and the first answer on the exam, above all when the stem shows you theallowedToolslist. - The subagent's description is too vague for Claude to match the task to it.
- The prompt does not name the subagent when one specific subagent is required.
The scale of the failure separates the first cause from the second. A missing spawning tool means no delegation at all; a weak description means patchy delegation, or delegation to the wrong specialist.
Context Passing: The Make-or-Break Detail
Context passing is where most multi-agent systems fall over, for the reason 1.2 established: the only thing a coordinator hands a subagent is its prompt. The prompt string is the entire handoff. If the subagent needs a file path, an error message, a prior finding, a source URL or a decision, it has to be written into that string. There is no ambient inheritance and no shared memory between invocations. (A subagent does start with its own system prompt, its tool definitions and the project's CLAUDE.md; the Deep Dive lists exactly what arrives.) Three rules follow.
Rule 1: Include complete findings from prior agents. Where synthesis depends on both the search results and the document analysis, both go into its prompt in full. Condensing them first to economise on tokens throws away exactly the detail synthesis was going to build on, and the agent has no way to recover it, because nothing retained the original.
The difference shows in the prompt the coordinator writes for synthesis:
Weak Synthesise the findings into a report.
Strong Produce a cited synthesis of the findings below.
QUALITY CRITERIA
- Every claim carries its source id.
- Where two sources disagree, present both values with attribution; do not pick one.
- Note the collection date for every statistic.
FINDINGS (JSON)
[ the complete structured findings from search and document analysis ]The weak version hands over an instruction and no findings. Synthesis either returns an empty or invented report, or tries to redo the research with tools it may not have.
Rule 2: Use structured data formats that separate content from metadata. A finding is a claim together with its provenance — source URL, document name, page number. Forward the claim alone and the claim arrives intact while the ability to attribute it does not.
The failure this rule prevents: a synthesis agent emits a report full of unsourced claims while search and document analysis are both behaving correctly. The cause sits in the handoff — content travelled, provenance did not — and the synthesis agent had nothing citable to work from, so no instruction to cite could have rescued it.
Rule 3: Design coordinator prompts that specify goals, not procedures. State the objective and what a good result looks like rather than the steps for producing one. A goal leaves room to adapt when the situation differs from the one you pictured; a procedure followed faithfully into an unanticipated case yields a confidently wrong result, because nothing licensed the subagent to depart from it.
| Procedural brief (brittle) | Goal and quality criteria (adaptable) | |
|---|---|---|
| What the coordinator writes | "Search the web for the topic. Open the first five results. Extract the abstract of each. Return the abstracts." | "Find the strongest available evidence on this subtopic. Prefer primary sources and peer-reviewed work over secondary coverage. Return at least five findings, each with claim, excerpt, source URL and publication date. If fewer than five credible sources exist, say so rather than padding." |
| When a source does not fit the script | Breaks: a paywalled page or a different kind of source has no step | Adapts: the subagent can use a different corpus and still meet the criteria |
| When a step is pointless for this source | Cannot tell, so performs it anyway | Can skip it |
One exception is worth knowing. Where the order of steps is itself the requirement (verify identity before a refund), order does matter — but a prompt is still the wrong instrument for it. Order that must hold is enforced programmatically, with a prerequisite gate (Task 1.4).
Structured Metadata Format
Content and provenance need to stay bound together as the finding moves between agents. A workable shape:
{
"findings": [
{
"claim": "Grid-scale battery storage costs fell 40% between 2020 and 2025",
"evidence_excerpt": "average installed cost fell by roughly 40% over the five years to 2025",
"source_id": "S1",
"source_url": "https://example.com/storage-costs",
"document_name": "Global Energy Storage Outlook 2025",
"page_number": 22,
"published": "2025-09-18",
"collected": "2026-02-03",
"confidence": "high",
"retrieved_by": "web_search_agent"
}
]
}Attribution rides along with each claim, so the synthesis agent can cite without being separately briefed on where anything originated. retrieved_by earns its place too: when a claim turns out to be wrong, it identifies which subagent produced it. The excerpt and the publication date follow the exam guide's own preparation exercise, which asks that each finding "include a claim, evidence excerpt, source URL/document name, and publication date". A short, stable source_id gives synthesis something compact to cite. Where a field does not apply (a web page has no page number), send null rather than dropping the key.
Why records rather than a paragraph of prose:
| Prose handoff | Structured handoff |
|---|---|
| "The Outlook report said storage costs fell 40% (September)" | The record above |
| Attribution sits inside a sentence and is lost the moment anything summarises it | Attribution survives every later transformation because it is a separate field |
| Dates are ambiguous: published, collected or surveyed? | published and collected are distinct fields, so two figures from different years are not misread as a contradiction (Task 5.6) |
| A conflict between sources has to be settled in the prose | Two records can coexist with different values and different sources |
The same structure is the mechanical basis of provenance in Task 5.6, and it is what Task 5.1 asks for in its skill "Modifying upstream agents to return structured data (key facts, citations, relevance scores) instead of verbose content and reasoning chains".
A cheap check closes the loop: every claim in the synthesis report should carry a source id that exists in the findings you passed. If one does not, inspect the handoff before you touch the synthesis prompt.
Parallel Spawning
When a coordinator needs to invoke multiple subagents for independent tasks, it should emit multiple Task tool calls in a single response rather than invoking them one at a time across separate turns.
One subagent per coordinator turn gains nothing when the tasks have no dependency on each other. Where search and document analysis are independent, making the second wait on the first simply adds the first one's latency to the total — and the penalty grows with every subagent added to the chain.
Sequential (wrong when the tasks are independent)
turn 1: [Task(search)] wait for the result
turn 2: [Task(documents)] wait for the result
total ≈ t1 + t2
Parallel
turn 1: [Task(search), Task(documents)] both run at once
total ≈ max(t1, t2)Latency is what this skill is about, and the guide's own wording is the tell: the parallel pattern is "multiple Task tool calls in a single coordinator response rather than across separate turns". Options that say "in a single response", or that have subagents running "simultaneously", are describing it.
You do not launch subagents concurrently from your own code. There is nothing there to await, because the coordinator issues each spawn as a tool call. The lever is the coordinator's prompt, which should say that the subtasks are independent:
When subtasks are independent, dispatch them in a single response: one Task call per
subtask, all in that same response. Do not wait for one subagent's result before
dispatching an independent one. Run steps in sequence only when a later subtask needs
an earlier subtask's output (synthesis needs the findings).Independent subagents should be dispatched together, step 1: Two independent subagents — web-search takes 6s, doc-analysis takes 4s
fork_session
fork_session creates independent branches from a shared analysis baseline. Once the coordinator has done the costly groundwork — read the codebase, established what the problem actually is — a fork explores a different direction from that point without paying for the groundwork again.
Take a coordinator that has finished reading a project and wants to weigh two testing strategies against each other. From the branch point each side proceeds alone: neither observes what the other found, and nothing said or analysed in one enters the other's history. (That independence covers the conversation only. Files a branch edits on disk are real edits, visible to both.)
fork_session is not the same as --resume. Resume picks up a specific named session and carries the same line of work forward. Fork opens a new independent branch. Both are in the exam guide (Task 1.7 covers them in full), and intent is the reliable way to keep them apart: fork to compare alternatives from a common origin, resume to continue a single line of investigation.
fork_session branches; resume continues one line, step 1: A coordinator finishes reading a codebase — Session S1
Two more things a session fork is not. It is not parallel spawning: parallel Task calls start subagents with fresh contexts on independent subtasks, whereas a fork copies an existing history so that the alternatives start from the same baseline. And it is not the only thing called a fork: current tooling uses the word for a forked session, a forked subagent, and a skill option, which behave differently. The Deep Dive separates the three.
Practical Example: Attribution Failure
A multi-agent research system has three agents: web search, document analysis, and synthesis. Search hands back well-sourced results carrying URLs and titles. Document analysis hands back detailed findings carrying page references. Neither is misbehaving.
The coordinator forwards the substance of both to synthesis and drops everything else — claims and analysis text arrive, source URLs, document names and page numbers do not. Synthesis returns a clear, well-organised summary that cites nothing at all.
Rewriting the synthesis prompt cannot repair this, and the point is worth being firm about: no amount of insistence produces source information that was never delivered. Granting it tool access is no better, since that has it re-run retrieval the other two agents already completed. The repair belongs at the coordinator, which has to forward structured findings with source URL, document name and page number intact.
Same finding, only the handoff changes, step 1: One finding — a claim, plus everything that sources it
Deep Dive
Current state: "Task" is the exam answer, "Agent" is what current tooling emits
Sourcescode.claude.com › subagentscode.claude.com › sub-agentsfetched 2026-11-19
Current state: allowedTools pre-approves a tool, it does not switch it on
Listing the spawning tool is still the documented practice: every coordinator example in the SDK's subagents guide carries Agent in allowedTools, and the first labels the list "Auto-approve these tools". For the symptom "Claude completes tasks directly instead of delegating to your subagent", the same guide's troubleshooting offers two fixes, which are causes 2 and 3 in the order given earlier: "Use explicit prompting: mention the subagent by name in your prompt" and "Write a clear description: explain exactly when to use the subagent so Claude can match tasks appropriately".
Sourcescode.claude.com › permissionscode.claude.com › subagentsfetched 2026-11-19
AgentDefinition — the four fields that matter most
Beyond the three fields already covered (description, system prompt, tool restrictions), the SDK's AgentDefinition has a precise required/optional split. (The published table carries further optional fields — disallowedTools, skills, memory, mcpServers, initialPrompt, maxTurns, background, effort, permissionMode, and the TypeScript-only autoCompactWindow and omitClaudeMd — but the four below are the ones the exam objectives touch.) description and prompt are required; tools and model are optional: "description | string | Yes | Natural language description of when to use this agent ... prompt | string | Yes | The agent's system prompt defining its role and behavior ... tools | string[] | No | Array of allowed tool names ... model | string | No | Model override for this agent." Note the field is named prompt, not systemPrompt.
Omitting tools is a meaningful default, not an error: "Omit tools: the subagent gets every tool available to subagents. List tools: the subagent gets only those." A subagent with no tools field is not restricted — it is maximally permissive within what subagents can access. Restriction by tools is real removal, not a prompt: "A tool you leave out isn't in the subagent's session at all: Claude works without it, with no permission prompt or error."
model accepts aliases: "an alias such as 'fable', 'opus', 'sonnet', 'haiku', 'inherit', or a full model ID" — so a cheaper or faster model can be assigned per-subagent role without hardcoding a model ID. When model is omitted, the subagent model order decides; with nothing else configured, "a subagent you define runs on the same model as the conversation that starts it."
Two of the further fields are worth recognising. disallowedTools is an "Array of tool names to remove from the agent's tool set", and accepts MCP patterns ("mcp__* removes every MCP tool from any server"). skills is a "List of skill names to preload into the agent's context at startup"; skill content preloaded in the parent is not passed to a subagent unless it is listed there.
Python keeps camelCase here. "In the Python SDK, multi-word field names such as disallowedTools and mcpServers keep their camelCase spelling to match the wire format rather than following Python's snake_case convention." ClaudeAgentOptions does use snake case (allowed_tools, disallowed_tools), so the two styles sit side by side, and the Python reference warns that on AgentDefinition "passing a snake_case keyword raises a TypeError at construction time."
A coordinator is not a class you instantiate. It is a query() call whose options carry the spawning tool and the definitions, and a subagent's name is its key in agents, not a field:
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions, AgentDefinition
async def main():
async for message in query(
prompt="Research grid-scale storage costs and produce a cited report.",
options=ClaudeAgentOptions(
# "Task" in the exam guide; "Agent" in current releases
allowed_tools=["Read", "Grep", "Glob", "Agent"],
agents={
"web-search": AgentDefinition(
description="Searches the public web for current information. Does not analyse local documents.",
prompt="Find the strongest available evidence. Return findings as structured records with their sources.",
tools=["WebSearch", "WebFetch"],
),
"doc-analysis": AgentDefinition(
description="Analyses documents supplied by the coordinator. Does not search the web.",
prompt="Extract claims with excerpts, page references and dates.",
tools=["Read", "Grep", "Glob"],
),
},
),
):
if hasattr(message, "result"):
print(message.result)
asyncio.run(main())Sourcescode.claude.com › subagentscode.claude.com › sub-agentscode.claude.com › pythonfetched 2026-11-19
Three ways to define a subagent, and which wins on a name clash
The SDK supports three creation paths: "Programmatically: use the agents parameter in your query() options ... Filesystem-based: define agents as markdown files in .claude/agents/ directories ... Built-in general-purpose: Claude can invoke the built-in general-purpose subagent at any time via the Agent tool without you defining anything". If a programmatic definition and a filesystem definition share a name, the programmatic one wins: "Programmatically defined agents take precedence over filesystem-based agents with the same name."
Sourcecode.claude.com › subagentsfetched 2026-11-19
How Claude picks which subagent to invoke
Subagent selection is not purely explicit routing by the coordinator's code — Claude itself decides based on the definition: "Claude automatically decides when to invoke subagents based on the task and each subagent's description." A well-written description therefore functions like a tool description: the primary signal for automatic delegation. The docs' advice is correspondingly plain: "Write clear, specific descriptions so Claude can match tasks to the right subagent." The coordinator (or user) can also override this and name a subagent directly: "To ask for a specific subagent, mention it by name in your prompt".
Sourcecode.claude.com › subagentsfetched 2026-11-19
Context isolation, precisely
"Unless the subagent is a fork, its context window starts fresh, with no parent conversation, but isn't empty. The only content you pass from parent to subagent is the Agent tool's prompt string, so include any file paths, error messages, or decisions the subagent needs directly in that prompt." The docs list both sides of the boundary for a non-fork subagent:
| A non-fork subagent receives | It does not receive |
|---|---|
Its own system prompt (AgentDefinition.prompt) and the Agent tool's prompt | The parent's conversation history or tool results |
Project CLAUDE.md, loaded via settingSources (setting_sources in Python) | The parent's system prompt |
Tool definitions: inherited from the parent, or the subset in tools | Preloaded skill content, unless listed in AgentDefinition.skills |
| The main conversation's auto memory |
So besides its own system prompt, what reliably reaches a subagent is the spawn prompt and its tool definitions, plus project CLAUDE.md where settings sources load it. Everything the coordinator learned during the run has to be written into that one prompt string.
The boundary holds in the other direction too: "each subagent runs in its own conversation, which starts fresh unless the subagent is a fork. Either way, intermediate tool calls and results stay inside the subagent; only its final message returns to the parent" — so a subagent's exploratory tool calls (dozens of file reads, search queries) never bloat the coordinator's context; only the distilled final message does.
Sourcescode.claude.com › subagentscode.claude.com › sub-agentsfetched 2026-11-19
Parallel subagents: isolation is what makes the speed-up safe
"multiple subagents can run concurrently, so independent subtasks finish in the time of the slowest one rather than the sum of all of them" — the latency benefit behind "emit multiple Task tool calls in a single response." This is only safe because subagents have separate context windows in the first place: each one "runs in its own conversation", so two subagents working the same corpus cannot corrupt each other's state or each other's context budget. The docs' own illustration is the high-volume, low-signal read: "A research-assistant subagent can explore dozens of files without any of that content accumulating in the main conversation" — exactly the web-search-plus-document-analysis shape this lesson keeps returning to.
Sourcecode.claude.com › subagentsfetched 2026-11-19
Parallel results go back in one message
This goes a step beyond the guide's bullets, and it applies when you write the tool loop yourself against the Messages API. Parallel calls stay parallel only if their results are returned together. The docs' troubleshooting for missing parallelism names the cause: "The most common issue is formatting tool results incorrectly in the conversation history. This “teaches” Claude to avoid parallel calls." The wrong shape is "a separate user message for each tool result"; the correct one is "all tool results together in a single user message".
[
{"role": "assistant", "content": ["tool_use_1", "tool_use_2"]},
{"role": "user", "content": ["tool_result_1", "tool_result_2"]}
]The strings stand in for the content blocks. One assistant turn carries both calls, and one user message carries both results.
Sourceplatform.claude.com › parallel-tool-usefetched 2026-11-19
Caps on nesting depth, concurrency and spend
These limits are beyond the guide's bullets, but they bound any fan-out. "Claude decides on its own when to spawn a subagent and how many to spawn", and a subagent can spawn its own, so one prompt can grow into a tree of agents.
| Limit | Set it with | Default | What happens at the limit |
|---|---|---|---|
| Depth | CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH | 3 layers of subagents below the main agent; 1 stops subagents spawning their own | A subagent at the bottom layer cannot spawn, so it does its delegated work itself |
| Concurrency | CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS | 20 subagents running at once | The spawn is refused with Concurrent subagent limit reached until the running count drops. It arrives as the Agent tool's result, not as an exception |
| Spend | max_budget_usd (Python), maxBudgetUsd (TypeScript) | No limit | Further spawns are refused with Budget limit reached, and the query ends with the error_max_budget_usd result subtype |
The two environment variables are passed through the SDK's env option; the spend cap is a query option.
Sourcescode.claude.com › subagentscode.claude.com › env-varsfetched 2026-11-19
fork_session — exact mechanics
fork_session (TypeScript: forkSession) is a boolean option used alongside resume — the sessions guide shows it as fork_session=True / forkSession: true, and the SDK reference documents it as "When resuming with resume, fork to a new session ID instead of continuing the original session". What forking actually does: "creates a new session that starts with a copy of the original's history but diverges from that point. The fork gets its own session ID; the original's ID and history stay unchanged. You end up with two independent sessions you can resume separately." That is the mechanism behind "comparing two testing strategies or refactoring approaches from a shared codebase analysis" — the shared baseline is the copied history at the fork point, and each branch is independently resumable afterward.
What is branched is the conversation, not the working tree: "Forking branches the conversation history, not the filesystem. If a forked agent edits files, those changes are real and visible to any session working in the same directory."
Both SDKs also export a standalone function of the same name (fork_session() in Python, forkSession() in TypeScript) that copies a saved session's transcript into a new session and returns the new ID, which you then pass as resume.
Sourcescode.claude.com › sessionscode.claude.com › pythoncode.claude.com › typescriptfetched 2026-11-19
Three mechanisms called "fork"
The word names three different things in current tooling. What separates them is what the new context starts with.
| Mechanism | What the new context starts with |
|---|---|
Forked session: fork_session (SDK), --fork-session (CLI, with --resume or --continue), /branch (interactive) | A copy of a saved session's history under a new session ID. This is the fork the exam guide means in 1.3 and 1.7 |
Forked subagent: /subtask, or the Agent tool called with subagent_type: "fork" | Everything: "a fork sees the same system prompt, tools, model, and message history as its parent conversation". Only its final result comes back to the parent |
Skill with context: fork (Task 3.2) | Only the skill's content, handed to a new subagent as its prompt, with no conversation history: "Despite the name, a skill with context: fork doesn't run in a fork of the current conversation" |
Sourcescode.claude.com › sub-agentscode.claude.com › skillscode.claude.com › cli-referencecode.claude.com › sessionsfetched 2026-11-19
Quick Reference
| Fact | Value |
|---|---|
| Exam-guide tool name | Task (put "Task" in allowedTools) |
| Current Claude Code tool name (v2.1.63+) | Agent — emitted in tool_use blocks; Task still appears in the system:init tools list and still works as an alias |
allowedTools and spawning, exam answer | Must include "Task" or the coordinator cannot invoke subagents |
allowedTools and spawning, current docs | Pre-approval only: Agent runs "whether or not you list" it; disallowedTools is what removes a tool |
| Coordinator does the work itself: check order | Spawning tool in allowedTools, then the subagent's description, then whether the prompt names the subagent |
| AgentDefinition required fields | description, prompt |
| AgentDefinition optional fields | tools (string[]) and model, among others such as disallowedTools, skills, maxTurns |
| What each part controls | description: whether it is picked. prompt: how it behaves. tools: what it can do |
Omitting tools | Subagent gets every tool available to subagents (not restricted) |
Listing tools | Subagent gets only those tools |
model accepted values | 'fable', 'opus', 'sonnet', 'haiku', 'inherit', or a full model ID; if omitted, by default the model of the conversation that starts it |
| Python spelling | AgentDefinition fields stay camelCase (disallowedTools, maxTurns); ClaudeAgentOptions uses snake case (allowed_tools) |
| Three ways to define a subagent | Programmatic (agents option), filesystem (.claude/agents/), built-in general-purpose |
| Name clash resolution | Programmatic definition wins over filesystem definition |
| How Claude selects a subagent | Automatically, based on the subagent's description; or explicitly named in the prompt |
| What crosses the parent→subagent boundary | Only the Agent tool's prompt string — no conversation history, no system prompt, no other subagent's output unless explicitly included |
| What a non-fork subagent starts with | Its own system prompt, the spawn prompt, tool definitions, project CLAUDE.md |
| What stays inside the subagent | Intermediate tool calls and results — only the final message returns to the parent |
| Finding record fields | Claim, evidence excerpt, source URL or document name, page number, publication date, kept as separate fields |
| Parallel subagent speed-up | Independent subtasks finish in the time of the slowest one, not the sum |
| Why parallel subagents are safe | Each has its own isolated context window |
| Parallel tool results in a hand-written loop | All in a single user message |
| Default limits | Depth 3 layers, 20 concurrent subagents, no spend cap unless max_budget_usd is set |
fork_session / forkSession | Boolean, default false; forks to a new session ID on resume instead of continuing the original |
| What forking preserves | A copy of history up to the fork point; original session's ID and history stay unchanged |
| Result of forking | Two independently resumable sessions |
| Three things called fork | Forked session (copies saved history), forked subagent (inherits the whole parent conversation), skill context: fork (skill content only) |
Exam Traps
More wrong answers, and why each fails
| The tempting answer | Why it fails | What to choose instead |
|---|---|---|
| Trim findings to claim text and re-attach the sources after synthesis | Once synthesis has reworded the claims, the claim-to-source mapping is gone | Pass the complete findings with no field dropped |
| Keep the source details in a side table the coordinator holds | The table stays in the coordinator's context and never reaches the subagent | Bind the metadata to each claim in the payload |
| Start two fresh sessions to compare two approaches | Each one repeats the baseline analysis, and the two need not start from the same understanding | Fork from the shared baseline |
| Blame the handoff when every subagent succeeded but whole topic areas are missing | Nothing was dropped in transit; the coordinator never assigned those areas. That is decomposition (Task 1.2) | Check the subtasks the coordinator created |
How This Is Tested
Each row is a stem you can recognise, the answer it is asking for, and the wrong answer that sits beside it.
| Stem signal | Answer | The wrong answer beside it |
|---|---|---|
| "The coordinator answers directly instead of using the code-reviewer subagent"; no delegation at all | Task (or Agent) is missing from the coordinator's allowedTools. If the list is shown to include it, a vague description | Rewriting the coordinator's prompt; adding a model field to the definitions |
| "The synthesis report has no citations, although the search agent collected URLs" | The coordinator passed findings as prose, or stripped the metadata. Pass structured claim-and-source records | Tightening the synthesis prompt; giving synthesis its own search tools |
| "How should the coordinator give the analysis agent the search results?" | In the Task prompt, complete and structured | "The subagent will inherit them"; "write them to a shared store the subagent reads" |
| "Three independent literature reviews take three times as long as one" | Emit all three Task tool calls in a single coordinator response | A faster model; reordering the calls; one call per turn |
| A numbered procedure, and subagents that return nothing when a source does not fit it | Replace the procedure with the research goal and quality criteria | Adding fallback steps; cutting the brief down to the topic alone |
| "Compare two refactoring strategies from the same codebase analysis" | Fork the session (fork_session; Task 1.7) | Two fresh sessions; resuming one session and trying both approaches in it |
Practice Scenario
Your escalate_to_human subagent is meant to decide whether a case needs a human, but its decisions are inconsistent — it sometimes escalates verified, low-risk requests and sometimes resolves ones that should have gone to a human. The coordinator's prompt to it is just the customer's latest message, forwarded as-is. What's the most effective first step?
Practice Questions
Exam simulator
Question 1 of 13
Scenario · Customer Support Resolution Agent
A customer asks to return one order and dispute a charge on another. Traces show your coordinator calling the Task tool for the returns specialist, waiting for its result, then calling it for the billing specialist in the next turn. The two investigations are independent, and replies to multi-concern requests now take twice as long. What change would most effectively address this?
Sources
- Agent SDK overview — Anthropic
- MCP Specification — Anthropic / MCP
- Building with Claude API (Skilljar) — Anthropic
- Subagents in the SDK — Anthropic
- Work with sessions — Anthropic
- Configure permissions — Anthropic
- Agent SDK reference - Python — Anthropic
- Agent SDK reference - TypeScript — Anthropic
- Create custom subagents — Anthropic
- Extend Claude with skills — Anthropic
- Environment variables — Anthropic
- CLI reference — Anthropic
- Manage sessions — Anthropic
- Parallel tool use — Anthropic