Tools, MCP and agents

What are subagents and multi-agent systems?

A subagent is a separate instance of an AI agent, with its own context window, instructions and tools, that a main agent hands a self-contained task to. The subagent does the work, then returns a short result, keeping the main agent's context clean. Systems built from a lead agent and several subagents are called multi-agent systems.

3 min read·Checked ·Also called multi-agent systems, orchestrator-worker agents, Claude Code subagents

The main benefit of a subagent is not that it is smart; it is that it is separate. It can read fifty files or twenty search results in its own context and hand back a one-paragraph answer, so the main agent never has to carry all that material.

How do subagents work?

A subagent works as a delegated task with a fresh context. The main agent, sometimes called the orchestrator or lead agent, decides a piece of work can be done independently, writes a task description, and starts a subagent with that description plus its own system prompt and tools. The subagent runs its own agent loop, and when finished returns only its final result.

  1. 1
    Delegate
    The lead agent writes a clear brief: the goal, what to return, and any limits.
  2. 2
    Work in isolation
    The subagent searches, reads, runs tools and reasons in its own context window.
  3. 3
    Report back
    It returns a concise summary, findings or a finished piece of work.
  4. 4
    Integrate
    The lead agent uses the summary and continues, with its own context still uncluttered.

Several subagents can run in parallel on independent parts of a task, such as researching different companies or reviewing different modules.

Why use subagents instead of one agent?

Subagents solve two problems that single agents hit on large tasks: context overload and slow sequential work.

BenefitWhy it helps
Clean contextIntermediate work stays in the subagent, so the lead agent's context window holds only results
ParallelismIndependent parts of a task run at the same time
SpecialisationEach subagent can have its own instructions, tools and even a cheaper model
FocusA narrow brief is easier for a model to complete well than one huge goal

Anthropic described this approach in detail for its research feature in 2025. Its multi-agent system, a lead agent directing parallel subagents, outperformed a single agent by 90.2% on an internal research evaluation. The same write-up reported that multi-agent runs used about 15 times more tokens than a chat interaction, and that token usage explained most of the difference in performance.

When do multi-agent systems not pay off?

Multi-agent systems cost more and add coordination problems, so they suit only certain tasks.

  • Do: Broad tasks that split into independent parts, such as researching many sources
  • Do: Tasks where a large amount of reading produces a small amount of useful output
  • Do: Reviews and checks that benefit from a fresh context, such as a separate reviewer
  • Avoid: Tightly connected tasks, like most coding changes, where every part depends on the others
  • Avoid: Simple tasks a single call or short workflow can handle
  • Avoid: Situations where token cost matters more than a moderate quality gain

The most common failure is a vague brief. A subagent knows only what its brief and system prompt tell it; if the lead agent writes "research the market", two subagents may duplicate work or both miss what was needed. Good briefs name the goal, the scope, the output format and what to leave out.

How are subagents different from Agent Skills?

A subagent is a separate worker with its own context. An Agent Skill is a set of instructions loaded into the current agent's context when needed. Use a skill when the same agent needs to know how to do something; use a subagent when a task should be done out of sight and only its result brought back. In tools like Claude Code, you can define subagents as files with their own instructions and allowed tools, and they can use skills too.

Frequently asked questions

What is a subagent in Claude Code?

In Claude Code, a subagent is a specialised assistant defined with its own instructions, tools and optionally model, which the main session can hand tasks to. It works in a separate context window and returns its result to the main conversation.

Are multi-agent systems better than single agents?

For broad, parallelisable tasks such as research, they can be much better, but they use many more tokens. For tightly connected tasks, a single well-equipped agent is often more reliable and cheaper.

How do subagents share information?

Usually through the lead agent: each subagent returns a result that the lead agent reads. Some systems also let agents write to shared files or memory so later steps can use earlier findings without passing everything through context.

What is the orchestrator-worker pattern?

It is a design in which one model breaks a task into parts and assigns them to worker models, then combines their results. Subagent-based multi-agent systems are a common form of it.

Last checked for accuracy on . Written by the solidcoder team.

Go deeper in the free guides