Multi-agent systems and subagents, explained simply
A multi-agent system splits one big job across several AI agents. Usually a lead agent (the orchestrator) plans the work, sends pieces to helper agents (subagents or workers), each with its own fresh context, and combines what they return. It helps most when the pieces can run in parallel, like broad research, and it hurts when the pieces depend on each other, because it costs many more tokens and the agents can miss each other’s decisions.
- 1
What is a multi-agent system?
In the last lessons, an AI agent was one model using tools in a loop until a task is done. A multi-agent system uses several of these agents on one task. Each agent has its own instructions, its own tools and its own context window (the text it can keep in view).
A subagent is a helper that a main agent starts for one piece of work. In Claude Code’s docs, a subagent "does that work in its own context and returns only the summary". That is the core trick: the messy middle (fifty search results, a thousand lines of code) stays inside the helper, and the main agent gets a short, clean answer.
Key ideaSubagents are mostly about context: each one gets a fresh, focused workspace and hands back a summary.
- 2
How does the orchestrator–worker pattern work?
The most common shape is orchestrator–worker. Anthropic’s "Building effective agents" (December 2024) describes it as a central model that breaks a task into subtasks, delegates them to worker models and combines the results. The difference from simple parallel calls is that the orchestrator decides the subtasks on the fly, based on the question.
Think of a newspaper editor. The editor reads the brief, sends three reporters to cover different angles at the same time, then edits their notes into one story. The reporters never see each other’s notes. Only the editor sees everything.
- Your question
- Lead agent makes a plan
- Subagents work in parallel
- Each returns a short summary
- Lead combines and checks
- Final answer
- 3
What did Anthropic learn building its multi-agent research system?
In June 2025, Anthropic’s engineers described how Claude’s Research feature works. A lead agent plans the research and starts subagents that search in parallel. A separate citation agent then matches each claim in the report to its source.
On Anthropic’s internal research eval, a Claude Opus 4 lead with Claude Sonnet 4 subagents scored 90.2% higher than a single Claude Opus 4 agent. The biggest wins were broad questions, such as finding the board members of every IT company in the S&P 500. Running 3–5 subagents at once, each calling tools in parallel, cut research time by up to 90% on complex questions.
- Teach the lead how to delegate: each subagent needs a clear goal, an output format, which tools to use and where its task ends.
- Scale effort to the question: early versions started 50 subagents for simple queries. Simple fact-finding now uses one agent with 3–10 tool calls.
- Start wide, then narrow: short broad searches first, then drill down.
- 4
When do multiple agents hurt?
The same Anthropic post is honest about the price. Agents use about 4 times more tokens than a normal chat, and multi-agent systems about 15 times more. Tokens are what you pay for, so this only makes sense for valuable tasks. In their tests, how many tokens were spent explained 80% of the difference in results on a hard browsing benchmark.
Splitting also breaks shared understanding. Workers cannot see each other’s choices, so two of them can make decisions that clash. Anthropic says multi-agent setups fit poorly when every agent must share the same context or when the pieces depend on each other, and notes that "most coding tasks involve fewer truly parallelizable tasks than research".
- Good fit: broad research, many independent questions, more information than one context window can hold.
- Poor fit: one tightly connected piece of work, like a single feature where each step builds on the last.
- Default: start with one agent. Add subagents only when you can name the separate, parallel pieces.
Key ideaMore agents means more cost and more coordination. Use them only when the work truly splits.
- 5
How do subagents work in Claude Code?
Claude Code ships with built-in subagents. Explore is a fast, read-only agent for searching a codebase. Plan gathers context in plan mode. General-purpose can both explore and make changes. Claude decides when to hand work to them, or you can ask, for example "use a subagent to find every place we call the payments API".
You can make your own by adding a Markdown file to .claude/agents/ in a project (or ~/.claude/agents/ for all projects). Only name and description are required; the description tells Claude when to delegate, and the body becomes the subagent’s instructions. As of Nov 2026, a subagent can start its own subagents up to three layers deep by default.
.claude/agents/code-reviewer.md (from the Claude Code docs) --- name: code-reviewer description: Reviews code for quality and best practices tools: Read, Glob, Grep model: sonnet --- You are a code reviewer. When invoked, analyze the code and provide specific, actionable feedback on quality, security, and best practices. - 6
What are handoffs in the OpenAI Agents SDK?
OpenAI’s Agents SDK offers two ways for agents to work together. With a handoff, one agent passes the conversation to a specialist, which then answers the user directly. The SDK shows each handoff to the model as a tool named like transfer_to_refund_agent, so the model "calls" the specialist it wants.
With agents as tools, a manager agent stays in charge and calls specialists for small subtasks, then writes the final answer itself. That is the orchestrator–worker pattern again. You can mix both.
A triage agent with handoffs (simplified from the SDK docs) from agents import Agent, Runner refund_agent = Agent(name="Refund agent", handoff_description="Handles refund requests") order_agent = Agent(name="Order status agent", handoff_description="Looks up order delivery status") triage_agent = Agent( name="Triage agent", instructions="Hand each customer message to the right specialist.", handoffs=[refund_agent, order_agent], ) result = await Runner.run(triage_agent, "I was charged twice.")
Straight from the source
The original idea, then the same idea taken apart, then how you use it today.
- 1 · Understand
- Research is open-ended, so a lead agent should plan and send parallel subagents, each with its own context, to explore different angles and return condensed findings.
- 2 · Break it down
- Parallel subagents gave a 90.2% gain over a single agent on Anthropic’s internal research eval.
- Each subagent acts like a filter: it reads a lot and returns a little.
- The cost is real: about 15 times the tokens of a chat.
- It fits broad, splittable tasks better than tightly linked ones like most coding.
- 3 · Use it
- Before adding agents, list the subtasks. If they are independent and valuable, try parallel subagents; if not, keep one agent.
- 1 · Understand
- Look for "the simplest solution possible, and only increasing complexity when needed"; orchestrator–workers is one pattern to reach for when subtasks cannot be known in advance.
- 2 · Break it down
- Orchestrator–workers: a central model decides the subtasks for each input and merges the results.
- Parallelization: fixed subtasks run at once, or the same task runs several times to vote.
- Every added layer trades speed and cost for quality, so it has to earn its place.
- 3 · Use it
- Build the single-agent version first, measure it, and add workers only where the measurements show it falls short.
Words to know
- Multi-agent system
- Several AI agents, each with its own instructions, tools and context, working on parts of one task.
- Subagent
- A helper agent started by a main agent for one piece of work; it works in its own context and returns a summary.
- Orchestrator–worker
- A pattern where a lead agent plans, hands subtasks to worker agents, and combines their results.
- Handoff
- In the OpenAI Agents SDK, passing the conversation from one agent to a specialist agent that takes over.
- Parallel
- Running several pieces of work at the same time instead of one after another.
Watch
Hand-picked from the people who explain this best. The video loads only when you press play.
A clear whiteboard tour of supervisor, hierarchical and network shapes, plus the risks of shared weaknesses. Watch after step 2.
Try it
Run an orchestrator–worker team by hand
- 1Pick a broad question, such as "Which three AI tools should a fresher learn for a data analyst job in 2026, and why?"
- 2In one chat with any free assistant (ChatGPT, Claude or Gemini), act as the orchestrator: ask it to split the question into 3 independent research subtasks, each with a goal and a 5-line output format.
- 3Open a new, separate chat for each subtask and paste just that subtask. These are your workers, each with a clean context.
- 4Paste the three short answers back into the first chat and ask it to combine them, flag conflicts and name what is still unknown.
- 5Compare with asking the whole question in one chat. Note what improved, and how many more messages (tokens) it took.
Check yourself
Pick an answer to see if you are right, and why.
Done? Keep going
Mark this lesson complete to keep your place. Progress is saved on this device, no login.
Questions people ask
What is the difference between an AI agent and a multi-agent system?
An AI agent is one model using tools in a loop to finish a task. A multi-agent system has several agents, often a lead that plans and helpers that each handle one part in their own context, with the lead combining the results.
Are multi-agent systems better than a single agent?
Only for some tasks. Anthropic found big gains on broad research that splits into parallel parts, but multi-agent systems used about 15 times more tokens than chat and fit poorly when every step depends on the last, as in most coding.
What is a subagent in Claude Code?
A specialised helper with its own context window, instructions and tool permissions. Claude Code includes Explore, Plan and general-purpose subagents, and you can add your own as Markdown files in .claude/agents/.