AI glossary · Basic · Agents
Subagent
A subagent is a helper agent to which the main AI agent hands off part of its work. It works in its own context and returns only a summary of the results to the main agent.
About this term
- Level
- Basic · Technical terms you often meet in AI news
- Category
- Perception & action
- Fields
- Agents
- Added
- 2026-10-08
What it is
When an AI agent works on a large task, side tasks come up, such as searching files or checking logs. If all the intermediate results of these tasks pile up in the main conversation, the context window (the amount of text a model can see at once) fills up quickly, with content that will never be looked at again. A subagent is a helper agent that takes on these side tasks separately. The official Claude Code documentation describes subagents as 'specialized AI assistants that handle specific types of tasks.'
How it works
A subagent runs in its own context window, separate from the main conversation. Each subagent can have its own system prompt (instructions that define its role and rules). The tools and permissions it can use are also set separately. The main agent reads the short description written for each subagent and decides whether to hand off the current task. The subagent that takes the task works independently and, when done, returns only a summarized result to the main agent.
Why it's getting attention
The biggest benefit is saving context in the main conversation. Long records of exploration or implementation do not pile up there. Work can also be split safely by limiting which tools are available. For example, you can have a subagent that can only read. The same configuration can be reused across projects, and simple tasks can be given to a faster, cheaper model such as Haiku to cut costs. For these reasons, subagents have become a standard way to divide work in coding agents.
Things to know
Subagents also send their own requests to the model, so they share the same usage limits as the main conversation. Each subagent's description takes up space in the main agent's context, so it should be kept short. Detailed instructions are better placed in the system prompt, which is loaded only when that subagent runs. A subagent works only within a single session. Running multiple sessions at once or having sessions collaborate is handled by other features.
Example
The coding tool Claude Code comes with several built-in subagents. A notable one is Explore, a read-only agent that quickly searches and analyzes a codebase. Others include Plan and General-purpose. Users can also define their own subagents for tasks they often hand off. When small, fast models come out, like the 'Claude Haiku 5.5' release covered on this site, there are more options for giving simple tasks to such subagents.