Sub-agents
A sub-agent is a helper AI that a main agent sends off to do one side task in its own workspace, then report back a short result.
An AI agent is a model that can use tools and take steps on its own. It can also hand tasks to sub-agents. A sub-agent is a separate AI helper. It has its own instructions and tools, and it handles one kind of task. The main agent gives it a job. The helper works on it alone, then reports back what it found.
The point is to keep the main agent’s working memory clean. That memory is the context window: the text a model can see at once. Picture asking a coding assistant which tests fail. A helper runs the whole test suite, reads every line of output, and sends back just the failing tests. The long output never lands in your main conversation.
Helpers can also work side by side. In a research system, a lead agent plans the search and starts several sub-agents to explore different parts at once. In that system, running three to five helpers at once, each using several tools at once, cut the research time for hard questions by up to 90%. It could also go wrong: early versions sometimes started 50 sub-agents for a simple question.
For builders: a manager agent can keep control and call specialist agents as tools. Helpers can also be lined up in a chain, where each one passes its result to the next. By default a helper does not remember past jobs. Only the main agent keeps the memory of your conversation.
One agent doing everything in one conversation runs into trouble.
Follow one big research task through a main agent and its helpers.
- 1 · splitThe main agent looks at the task and decides which parts to hand out.
- 2 · delegateEach sub-agent gets a short description of its part of the task.
- 3 · workEach one works in a separate context window, sometimes at the same time as the others.
- 4 · reportIt returns only its result, and the main agent combines the results.
Sub-agents keep the main conversation short by doing side work somewhere else.
| Who | What they ask | What it works with |
|---|---|---|
| Software developer | “Which of our tests are failing and why?” | A helper runs the whole test suite and reports only the failures |
| Research assistant | “What are the main sides of this big question?” | A lead agent starts several helpers to explore different parts at once |
| Code review team | “Are there performance problems in this change?” | A reviewer helper finds issues, then a second helper fixes them |
| Developer on call | “What do these long logs say went wrong?” | A helper reads the logs and returns only a short summary |
- Bulky output stays inside the helper, so the main conversation stays clear.
- Independent parts of a task can run in parallel.
- Each helper can have its own focused instructions and a limited set of tools.
- Simple side tasks can go to a faster, cheaper model.
- They use many more tokens, so they cost more than a single chat.
- They fit poorly when every step needs the same shared context.
- Vague instructions can make helpers repeat each other's work.
- They add waiting time, so a quick change is often faster without them.
Sources used
This explainer is written in original language. The links below support its factual claims.
- docsCreate custom subagents, Anthropic (Claude Code Docs) · read 28 Sept 2026
- officialHow we built our multi-agent research system, Anthropic · read 28 Sept 2026
- docsAgent orchestration, OpenAI Agents SDK · read 28 Sept 2026
- docsSubagents, LangChain · read 28 Sept 2026
- officialBuilding effective agents, Anthropic · read 28 Sept 2026