In plain words
An AI agent working on a big task fills up its working memory fast: every search result, every file it reads, every note. Its context window gets crowded and it starts to lose track.
So the agent can hand a piece of the job to a helper: "search these 40 files and tell me where payments are handled". The helper starts with a clean slate, does all the messy reading, then sends back only the answer. That helper is a subagent.
The main agent stays focused on the big picture. Several subagents can work at the same time on different pieces, and each can be set up with its own instructions, its own tools and even a cheaper, faster model. AI coding tools such as Claude Code, OpenAI's Codex and Google's Gemini CLI all offer them (as of November 2026).
Everyday example
A wedding planner and her runners
A wedding planner can't visit every caterer, florist and tent house herself. She sends a runner: "check three caterers in Jayanagar, budget ₹800 a plate". The runner spends the afternoon tasting and haggling, then comes back with one sheet: the best option and why. The planner never sees the afternoon, just the result, and her head stays clear for the big decisions.
Where the example breaks: A runner remembers yesterday's errands. A subagent usually starts fresh every time and knows only what the main agent wrote in its instructions.
How it actually works
Subagents are the building block of a multi-agent system: a lead agent delegates, each subagent works in its own separate context, and only a summary comes back.
The main agent writes a brief
When a task matches a subagent's description, the lead agent starts it with a short brief. The brief is all the subagent knows, so a vague brief gives a vague result.
The subagent works alone
It has its own system prompt, its own set of allowed tools and its own context window. It may make dozens of tool calls, such as searches and file reads, that the main agent never sees.
Only the summary returns
When it finishes, the subagent's work is condensed into a single reply. Anthropic's engineers describe search as compression: distilling a large pile of material into the few insights that matter.
Parallel and specialised
A lead can start several subagents at once. Each can be locked down, for example read-only, or run on a smaller model to save cost. The catch: parallel helpers can clash if they edit the same thing, and total token use grows quickly.
- Typical setup
- A name, a description of when to use it, instructions, allowed tools and a model choice, often stored as a small text file
- Found in (as of November 2026)
- Claude Code, OpenAI Codex (generally available March 2026), Gemini CLI (April 2026), Cursor and other coding tools
- Research result
- In June 2025 Anthropic reported a lead agent with subagents beat a single agent by 90.2% on its internal research test
- Cost
- Anthropic found multi-agent setups used about 15 times the tokens of a normal chat
Some frameworks offer two ways to delegate: call a helper like a tool and keep control, or hand the conversation over to a specialist. OpenAI's Agents SDK calls these "agents as tools" and "handoffs".
Questions people ask
What is the difference between an agent and a subagent?
Same kind of thing, different role. A subagent is an agent started by another agent for one piece of work. It reports back to its parent instead of to you.
Why use subagents instead of one big agent?
To keep the main agent's memory clean. Long search results and logs stay in the helper's context, so the main agent has room to think. Helpers can also run in parallel and be given narrower permissions.
Can a subagent start its own subagents?
In some tools, yes, up to a set depth. Claude Code, for example, allows nesting a few layers deep by default and lets you switch it off. Deep nesting multiplies cost, so most setups keep it shallow.
Do subagents cost more?
Usually. Every subagent uses its own tokens, and they count toward the same usage limits as the main conversation. Routing simple jobs to a smaller model helps.
Was this clear?
1 is confusing, 5 is crystal clear. One tap, no account needed.
Spotted something wrong, or know a better example? Suggest a change