A multi-agent system adds a layer of model-directed delegation on top of everything in lesson 2.3, and Anthropic's own numbers show it is expensive. The architect's job is therefore sequenced: first decide whether multi-agent is justified, then choose a topology, then design the context that crosses each boundary and the way failures travel back. Most exam scenarios in this area are solved by tracing a symptom (missing coverage, unsourced claims, a silently absent section, a runaway bill) to the boundary where the design broke.
Is multi-agent justified?
Anthropic's guidance names three situations where separate agents consistently help. Context protection: a subagent works in its own context window, and only its final message returns to the parent, so bulky intermediate material (dozens of files read, large lookups) never accumulates in the main conversation. Parallelization: independent subtasks finish in the time of the slowest rather than the sum. Specialization: separate agents with focused tools and prompts, warranted when a single agent has a large tool set, gets confused across unrelated domains, or degrades on old tasks when new tools are added.
The cost side is large. Anthropic's research-system write-up reports that agents typically use about 4× the tokens of chat interactions and multi-agent systems about 15×; a separate Anthropic post on when to use multi-agent systems cites 3 to 10× versus a single agent. The figures depend on workload and measurement, so treat them as an order of magnitude and measure your own. The research write-up says multi-agent systems fit valuable tasks with heavy parallelization, information beyond a single context window and many complex tools, and are a poor fit for most coding tasks and for work where all agents need the same context or have many dependencies. Anthropic's cost guidance adds that an orchestrator only pays off when there is bulk to hand off; for one dependent chain, or work that fits in a single context, it pays for a plan, a handoff and a merge that a single model gets for free. Teams have also found that better prompting of one agent matched an elaborate multi-agent build.
Common exam distractor
"Split it into specialist agents for modularity" and "add more agents to fix a quality problem" are the recurring wrong answers. Modularity is not one of the justifications, and more agents multiply cost and handoff loss. The defensible answer states which of context protection, parallelization or specialization applies, shows evidence from an eval, and accounts for the token multiple. If none applies, keep the single agent.
Choosing a topology
| Topology | Control | Use when | Watch for |
|---|---|---|---|
| Orchestrator-workers (hub-and-spoke) | A lead decomposes at runtime, delegates, synthesises | Subtasks cannot be predicted in advance: research, multi-file changes | The lead's decomposition is a single point of failure; a synchronous lead blocks on its slowest worker |
| Parallel fan-out | Your code launches N independent workers (sectioning or voting) | Subtasks are known and independent, or you want diverse attempts | Aggregation logic; cost scales with N |
| Sequential handoff | One agent finishes and passes the work on (triage to specialist) | Distinct stages need different tools or prompts | Each handoff degrades fidelity, so pass structured state |
| Generator and verifier | A separate agent checks the first agent's work | You need an independent check without full implementation context | Verifiers can pass outputs without thorough testing; give explicit criteria |
| Nested delegation | Subagents spawn subagents | Very wide fan-out | Cap depth, concurrency and spend |
"Handoff" is common industry vocabulary rather than a pattern name from the Anthropic documents reviewed for this lesson, so reason from its mechanics: each transfer loses context. Hub-and-spoke routing all communication through the coordinator gives observability, uniform error handling and controlled information flow. In current Agent SDK versions a subagent can itself spawn subagents, so strict hub-and-spoke is a design choice you make for those three properties, not a product limit; the SDK provides a nesting-depth limit (default 3 layers below the main agent), a concurrency limit (default 20 subagents at once) and a query-level spend cap to bound the tree. These limits are documented for recent SDK releases (TypeScript v0.3.219 and Python v0.2.127 or later), so check your version before relying on them.
Context passing across the boundary
A subagent's context starts fresh (a fork, which inherits the parent conversation, is the documented exception). In the Agent SDK the only channel from parent to subagent is the prompt string of the Agent tool call (the tool appears as Agent in current versions and Task in older ones, so match both when detecting invocations); the subagent also gets its own system prompt, project instructions and tool definitions, but not the parent's conversation history, tool results or system prompt. Only the subagent's final message comes back, and the parent may summarise it. From this follow the design rules:
- Write a complete delegation brief. Anthropic found vague delegation caused subagents to misinterpret the task or repeat the same searches. Include the objective, the output format, guidance on tools and sources, and clear task boundaries.
- Return content plus metadata. Ask workers for structured findings (claim, source, confidence). A synthesis agent cannot cite what it never received, so unsourced claims usually trace to the coordinator stripping metadata.
- Pass references for large artifacts. Anthropic describes workers storing output externally and returning lightweight references, which avoids copying large outputs through the coordinator.
- Scale effort explicitly. Encode rules such as how many workers and tool calls a simple lookup deserves versus a comparison, otherwise simple queries get over-invested.
- Launch independent work together. Anthropic reports that parallel subagents plus parallel tool calls cut research time by up to 90% for complex queries.
Error propagation
Failures inside a worker must reach the coordinator in a form it can act on. A workable contract carries four things: the failure type (transient, validation, business rule, permission), what was attempted (query, parameters, target), partial results gathered before the failure, and alternatives the worker can suggest. Two anti-patterns break systems: silent suppression, returning an empty result marked as success, so the coordinator never retries and the report silently omits an area; and workflow termination, killing the whole run because one worker timed out and discarding the work of the others. Keep two situations apart. An access failure (timeout, connection error, denied permission) means the query did not run and may deserve a retry. A valid empty result means the query ran and found nothing, which is the answer and needs no retry.
Let workers recover transient problems locally (retry, fallback source) and escalate only what they cannot fix, always with attempted action and partial results. In the final output, add coverage annotations that say which areas are well supported and which are limited and why. Anthropic's experience is that telling an agent when a tool is failing and letting it adapt works well, combined with retries and checkpoints so a long run resumes rather than restarts. Note also that in the Agent SDK an API error that ends a subagent early, such as a rate limit, is not delivered as its result, so the coordinator needs a rule for a worker that never reports.
Key concept: shared nothing except the brief and the reply
Subagents share nothing with the coordinator or with each other except the prompt the coordinator writes and the message they return. Every multi-agent failure can be located at one of those two channels or at the decomposition: missing scope points to the coordinator's decomposition, missing citations or context to the brief or the structured reply, invisible gaps to error propagation, and surprise cost to unbounded fan-out.