Skip to content

Multi-agent systems: when to split agents and what it costs

Multi-agent systems run one task across several LLM agents, each with its own context. When to split an agent, which patterns fit, and what a split costs.

Published
Reading time
14 min read

In short

  • A multi-agent system runs one task across several LLM agents, each with its own context window. Split a single agent only for a reason you can name: context it cannot hold, work that runs in parallel, or steps that need different tools, permissions, or models.
  • Splitting costs tokens. Anthropic reports that its multi-agent systems use about 15 times the tokens of a chat, against about 4 times for one agent, and 3 to 10 times the tokens of a single agent on equivalent tasks.
  • Task shape decides the outcome. In a study of 260 configurations, multi-agent coordination changed results by anything from +80.8% on decomposable financial reasoning to -70.0% on sequential planning.
  • The designs that hold up keep every write in one agent and use the others to search, read, and review. Each subagent needs a brief with an objective, an output format, tool guidance, and boundaries, and the whole tree needs one trace.

A multi-agent system runs one task across several LLM agents, each with its own context window, coordinated by code or by a lead agent. Split a single agent only for a reason you can name: one context window cannot hold the work, parts of it can run in parallel, or some steps need different tools, permissions, or models. Every split multiplies tokens, adds a boundary where information gets lost, and turns one trace into a tree.

The agent loop article covers one agent. This one covers when to split, how each multi-agent pattern fails, and the engineering that makes a split hold up in production.

What a multi-agent system is

A multi-agent system is a set of agents working on one task, where each agent is a model calling tools in a loop and each keeps its own conversation history. Anthropic defines it as multiple LLM instances with separate conversation contexts, coordinated through code. The separate context is the defining property. One agent with forty tools is still a single agent.

The roles have several names. An orchestrator, lead agent, or supervisor plans the work and delegates parts of it. A subagent or worker takes one part, works in its own context window, and returns a result. A handoff passes control of the conversation from one agent to another.

The benefit and the cost both come from the boundary between context windows. A subagent can read fifty files without any of them entering the lead agent's history. It also starts without that history, so it knows only what the lead agent wrote down for it.

What splitting an agent costs

Splitting an agent costs tokens first. Anthropic reports that its agents use about 4 times the tokens of a chat interaction and its multi-agent systems about 15 times. In its later testing, multi-agent implementations used 3 to 10 times the tokens of a single agent on equivalent tasks, because each agent needs its own copy of the context, agents exchange coordination messages, and results are summarized at every handoff.

Latency does not reliably improve. Parallel subagents cut Anthropic's research time by up to 90% on complex queries, yet its later guide says multi-agent systems often take longer overall than a single agent, because total computation rises. Parallel agents buy coverage more than speed. Each agent is also another prompt to maintain, another place a run can fail, and another span to trace.

Why multi-agent LLM systems fail

Many multi-agent failures come from system design and coordination, which a stronger model alone does not fix. That is the argument of Why Do Multi-Agent LLM Systems Fail?, a paper by Cemri and colleagues that annotated 1,642 execution traces from seven multi-agent frameworks. Its taxonomy, MAST (Multi-Agent System Failure Taxonomy), has 14 failure modes in three categories.

MAST categoryShare of labeled failuresMost common modesWhat prevents it
System design issuesAbout 44%Repeated steps (15.7%), not recognizing the task is complete (12.4%), not following the task requirements (11.8%)Specific briefs, stop conditions, step budgets
Inter-agent misalignmentAbout 32%Reasoning that does not match the action taken (13.2%), task derailment (7.4%), acting on a wrong assumption instead of asking (6.8%)Structured results, shared artifacts, fewer handoffs
Task verificationAbout 24%Incorrect verification (9.1%), missing or incomplete verification (8.2%), premature termination (6.2%)A verifier with explicit criteria and real checks

The shares are sums of the per-mode figures in the paper's third version, from October 2025. With the model held constant, better agent role specifications raised one framework's task success by 9.4%, and a verification step for the high-level objective raised it by 15.6%. Many of the verifiers studied ran only superficial checks, such as whether the code compiled.

Anthropic and Cognition disagree, and both are right

Anthropic and Cognition published opposite advice one day apart in June 2025, and the disagreement resolves once you separate agents that read from agents that write.

Anthropic described the multi-agent system behind its Research feature: a lead agent plans, spawns subagents that search in parallel, and merges what they return. On its internal research evaluation, a Claude Opus 4 lead with Claude Sonnet 4 subagents outperformed a single Claude Opus 4 agent by 90.2%. The post attributes the gain to tokens. Token usage alone explained 80% of the performance variance on the BrowseComp evaluation, and separate context windows let a system spend more tokens than one window holds.

Cognition's Walden Yan argued in Don't Build Multi-Agents that the same architecture is fragile, because each subagent sees a fraction of the context and still has to make choices. The essay's second principle: "Actions carry implicit decisions, and conflicting decisions carry bad results." Its example is two subagents that build halves of a game in clashing styles. The essay recommends one agent with a continuous context.

The tasks explain the gap. Research is read-only, so subagents gather facts that only have to agree in a report. Coding is mostly writes, and every write embeds choices about style, interfaces, and edge cases that parallel agents cannot see. Anthropic's post concedes that most coding tasks have fewer parallelizable parts than research. Later evidence points the same way:

  • Cognition's April 2026 follow-up, Multi-Agents: What's Actually Working, reports multi-agent systems in production there in a narrower form. Writes stay in a single thread, and the other agents search, review, and advise.
  • Towards a Science of Scaling Agent Systems tested 260 configurations. Against a single agent, results ranged from +80.8% on decomposable financial reasoning to -70.0% on sequential planning. Independent agents amplified errors 17.2 times, against 4.4 times under a central orchestrator.

Start with one agent, add read-only subagents when context or parallelism demands it, and keep every write in one agent until you have evidence that the pieces are independent.

When splitting an agent helps

Splitting helps in three situations, which Anthropic's guide names as context protection, parallelization, and specialization. Outside them, it says, coordination costs usually exceed the benefits.

  • A subtask produces more than about 1,000 tokens that the main task never needs again.
  • The task breaks into pieces that do not depend on each other, such as research across separate sources.
  • A step needs its own tools, permissions, system prompt, or model.

Divide the work by context, not by job title. In an Anthropic experiment with agents split by software role (planner, implementer, tester, reviewer), the subagents spent more tokens on coordination than on the work. The agent that writes a feature should also write its tests.

Symptom in a single agentDoes a split helpCheaper fix to try first
The window fills with search results the agent reads onceYes: a read-only subagent returns a summaryTrim tool results and compact history (context engineering)
The agent picks the wrong tool from 20 or moreSometimes: specialists with small tool setsLoad tools on demand, or call tools from code
The task is slow and its parts are independentYes: parallel subagentsParallel tool calls in one agent
One step needs permissions the rest should not holdYes: a separate agent with its own tool listAn approval gate on that tool
The agent accepts its own flawed outputYes: a verifier with a clean contextTests and schema checks in the loop
Quality drops late in a long sequential taskNo: sequential work gets worse when splitCompaction and a notes file (context rot)
The steps are the same on every runNoA fixed workflow in code

Multi-agent patterns and how each one fails

Five patterns cover most multi-agent architectures. Four are workflows in Anthropic's Building effective agents, and handoffs come from the agent SDKs.

PatternHow it worksFits whenHow it fails
Orchestrator and workersA lead agent picks subtasks at run time, delegates them, and merges the resultsSubtasks cannot be predicted and do not depend on each otherVague briefs duplicate or drop work, and the lead summarizes details away
Sequential pipelineEach agent's output is the next agent's inputThe task decomposes into fixed stagesContext is lost at every stage, and early mistakes flow downstream
Handoff between peersOne agent transfers the conversation to another, which takes overRequests fall into distinct categories, as in support triageMisrouting, and agents that pass a task back and forth
Evaluator and optimizerOne agent produces, and a second checks against criteria until it passesCriteria are explicit, and a wrong output costs more than another roundVague criteria approve everything, and loops never converge
Parallel voting or debateSeveral agents attempt the same task, and a vote or discussion picks the answerA judgment needs higher confidence, such as flagging vulnerable codeCost multiplies with agent count, and debate does not reliably beat simpler ensembling

Framework names for these, as of November 2026:

FrameworkName for delegationWhat the receiving agent sees by default
Claude Agent SDKSubagents, defined with AgentDefinition and invoked through the Agent toolNo parent history: its own system prompt plus the prompt its parent wrote
OpenAI Agents SDKHandoffs, exposed as a transfer_to_<agent_name> tool, and agents as tools through Agent.as_tool()After a handoff, the whole conversation, unless an input_filter changes it
LangChain and LangGraphThe subagents pattern: a main agent, often called a supervisor, calls subagents as toolsA clean context window on each invocation

In the OpenAI SDK, a manager that calls Agent.as_tool() keeps control of the conversation, while a handoff makes the specialist the active agent for the rest of the turn. Guardrails do not follow a handoff. Input guardrails run only for the first agent in a chain, and output guardrails only for the agent that produces the final output. LangChain's docs say the older langgraph-supervisor package is no longer actively maintained.

What crosses the boundary between agents

In the orchestrator and worker pattern, two messages cross each boundary: a brief going down and a condensed result coming back. Anthropic's context engineering guide gives the scale. A subagent may use tens of thousands of tokens exploring and return a summary of often 1,000 to 2,000 tokens.

ORCHESTRATORWORKERSBRIEF: GOAL · FORMAT · TOOLS · LIMITSBRIEFBRIEFRESULT: SUMMARY OR FILE REFERENCERESULTRESULTLead agentPLANS AND MERGESKeeps the planWrites each briefReads the resultsOwns the answerHISTORY STAYS HERESubagent 1OWN CONTEXT WINDOWTOOL CALLS STAY INSIDESubagent 2OWN CONTEXT WINDOWTOOL CALLS STAY INSIDESubagent 3OWN CONTEXT WINDOWTOOL CALLS STAY INSIDEParent history does not go down. Tool calls and raw results do not come up.
The orchestrator and worker pattern. The lead agent sends each subagent a brief and gets back a short result. The parent's history does not go down, and the subagents' tool calls do not come up.

That compression is the purpose of the pattern and also its risk. Whatever a subagent learned and left out of its result is gone, and whatever the lead agent knew and left out of the brief never arrived. The engineering work is in those two messages.

Write the brief a subagent receives

A brief needs four things, in Anthropic's list: an objective, an output format, guidance on the tools and sources to use, and clear task boundaries. Its lead agent started out sending one-line instructions, and subagents misread them or duplicated each other's searches.

In the Claude Agent SDK, the only content passed from parent to subagent is the prompt string of the Agent tool call, so every file path, error message, and decision the subagent needs has to be in it. An illustrative brief:

subagent-brief.txt
Objective: Find how the billing service retries failed card charges.
Why: The lead agent is comparing retry behavior across three services
  to choose one shared policy. Decided so far: retries must be
  idempotent, and the total wait must stay under 30 seconds.
Scope: services/billing only. Do not read other services. Do not edit files.
Tools: Grep and Read. Start from the charge client, not the tests.
Budget: 15 tool calls. If the answer is not found by then, say so.
Return: Under 300 words. The retry count, the backoff schedule, and
  whether the call is idempotent, each with a file path and line number.
  List anything that could not be determined.

Tell the orchestrator how much effort a task deserves, too. Anthropic embedded scaling rules in its lead agent's prompt after early versions spawned 50 subagents for simple queries: 1 agent with 3 to 10 tool calls for simple fact-finding, 2 to 4 subagents with 10 to 15 calls each for direct comparisons, and more than 10 subagents for complex research.

Decide what context to pass and what to withhold

Pass the decisions that constrain the work, and withhold the transcript that led to them. A Claude Agent SDK subagent starts fresh unless it is a fork, which copies the conversation so far. An OpenAI Agents SDK handoff forwards the whole history unless an input_filter such as handoff_filters.remove_all_tools strips part of it.

What the receiving agent does decides which way to lean:

  • An agent that continues the work needs the decisions already made, or the full history. When Cognition had one model consult a stronger one, its working solution was to fork the full context instead of selecting a subset.
  • An agent that checks the work needs the artifact and the criteria. Cognition's review loop worked best when the reviewer shared no context with the coding agent, and it reports an average of 2 bugs caught per pull request, about 58% of them severe.

Withholding is also a security control. OpenAI's docs warn that forwarded history is not redacted, so the receiving agent and its model provider see all of it. A subagent that reads web pages can be steered by them, so give it read-only tools and treat its result as untrusted input (prompt injection).

Condense results and share artifacts instead of chat

Specify the result in the brief, because the lead agent sees only the subagent's final message. LangChain's docs name the common failure, in which a subagent does the tool calls and the reasoning, then leaves the findings out of its last message. Ask for a fixed shape, such as findings, evidence with paths or URLs, and open questions.

Large outputs should not travel through the conversation at all. Anthropic's research team recommends that subagents write code, reports, and data to an external store and return a lightweight reference, which avoids a game of telephone through the coordinator. A shared plan file does the same for decisions, and Cognition advises keeping every agent on the same plan and task list.

Set a budget for each agent

Give each agent its own step cap, and give the tree caps on depth, concurrency, and total spend. A subagent can spawn subagents of its own, so one prompt can grow into a tree. As of November 2026, the Claude Agent SDK defaults to 3 layers of subagents below the main agent, 20 subagents running at once, and no spend limit unless you set one.

capped_subagents.py
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions, AgentDefinition, ResultMessage
 
options = ClaudeAgentOptions(
    allowed_tools=["Read", "Grep", "Glob", "Agent"],
    agents={
        "code-searcher": AgentDefinition(
            description="Read-only code search. Use for one question about one service.",
            prompt="Answer the question from the code. Return file paths and line "
                   "numbers for every claim, in under 300 words.",
            tools=["Read", "Grep", "Glob"],  # no Edit, Write, or Bash
            model="haiku",                   # a cheaper model for search
            maxTurns=15,                     # step cap for this subagent
        ),
    },
    env={
        "CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH": "1",  # subagents cannot spawn their own
        "CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS": "5",
    },
    max_budget_usd=5.0,  # counts subagent requests too
)
 
async def main():
    try:
        async for message in query(
            prompt="Compare how our three payment services retry failed charges.",
            options=options,
        ):
            if isinstance(message, ResultMessage):
                print(f"{message.subtype}: ${message.total_cost_usd}")
    except Exception as error:
        # query() raises after it yields an error result such as error_max_budget_usd.
        print(f"Run ended with an error: {error}")
 
asyncio.run(main())

A subagent that reaches maxTurns returns its output marked as partial, and a query that reaches the spend cap ends with the error_max_budget_usd result subtype. Loops between agents need a cap too. Give an evaluator and optimizer pair a maximum number of rounds and a fallback.

Trace and evaluate a run that spans agents

Record one trace per task, with each agent as a nested span. OpenTelemetry's GenAI conventions, still in development, name the span invoke_agent. The OpenAI Agents SDK wraps each agent run and each handoff in a span by default, and the Claude Agent SDK tags every message from inside a subagent with parent_tool_use_id.

On each agent's span, record its tokens, its tool calls, the brief it received, and the result it returned. Those fields show which agent spent the tokens, whether two agents ran the same search, and whether a fact lost at a handoff was ever in the subagent's window. AI agent observability covers the span names.

Evaluate the outcome first. Anthropic started with about 20 queries from real usage, graded by one LLM judge call per output, and for agents that change state it judges the end state instead of the path. Then check the two messages: whether each brief contained what its subagent needed, and whether the final answer kept what the subagents found. Label failed traces with the MAST modes. AI agent evaluation covers the method.

Agents in other systems and companies

Agents that belong to another team or company talk over a protocol instead of a function call, because their prompts, tools, and memory are not yours to see. A2A (Agent2Agent), an open protocol hosted by the Linux Foundation, standardizes that exchange, as MCP does for tools. The A2A protocol article covers it. A remote agent still needs a complete brief, and its reply is still a result to verify.

Frequently asked questions

What is a multi-agent system?

A multi-agent system is an architecture in which several LLM agents work on one task, each with its own context window, tools, and instructions. A lead agent or application code coordinates them. It differs from a single agent with many tools because the agents do not share one conversation history.

When should you use multiple agents instead of one?

Use multiple agents when one agent's context fills with material it does not need to keep, when parts of the task can run in parallel, or when steps need different tools, permissions, or models. Start with one agent and measure it first.

What is the orchestrator-worker pattern?

In the orchestrator-worker pattern, a lead agent breaks a task into subtasks at run time, sends each to a worker agent with its own context window, and merges the results. It fits tasks whose subtasks cannot be predicted in advance and do not depend on each other.

What is the difference between a subagent and a handoff?

A subagent does a bounded task and returns a result to the agent that called it, which keeps control of the conversation. A handoff transfers the conversation to another agent, which then answers the user directly. An OpenAI Agents SDK handoff passes the whole history by default, while a Claude Agent SDK subagent starts with only the prompt its parent wrote.

Why do multi-agent systems fail?

The MAST study of 1,642 traces from seven frameworks found 14 failure modes in three groups: system design issues, misalignment between agents, and weak verification. The most common were repeated steps, reasoning that did not match the action taken, and not recognizing that the task was finished.

Sources

  1. 01How we built our multi-agent research systemAnthropic Engineering
  2. 02Building multi-agent systems: When and how to use themClaude blog
  3. 03Building effective agentsAnthropic Engineering
  4. 04Don't Build Multi-AgentsCognition
  5. 05Multi-Agents: What's Actually WorkingCognition
  6. 06Why Do Multi-Agent LLM Systems Fail?arXiv:2503.13657
  7. 07Towards a Science of Scaling Agent SystemsarXiv:2512.08296
  8. 08Subagents in the SDKClaude Agent SDK docs
  9. 09HandoffsOpenAI Agents SDK docs
  10. 10Agent orchestrationOpenAI Agents SDK docs
  11. 11SubagentsLangChain docs
  12. 12Effective context engineering for AI agentsAnthropic Engineering