← AI glossary

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
Fields
Agents
Added
2026-10-08
In plain words It is like a team lead assigning research to a team member, who reads through lots of material alone and submits only a one-page report. Unlike a team member, though, a subagent does not stick around once its task is done. It is closer to a temporary worker that operates only within the same work session.

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.

How work is handed off to a subagentUser request → Main agent; Main agent → Subagent(Delegate task); Subagent → Search results, logs(Explore); Subagent → Summary(Summarize); Summary → Main agent(Report); Main agent → Final answerUser requestMain agentKeeps the conversationflowFinal answerSubagentSeparate contextLimited toolsSearch results,logsNot added to mainSummaryDelegate taskExploreSummarizeReport
How work is handed off to a subagent The main agent hands off side tasks to a subagent. The subagent handles search results and logs only within its own context and returns just a summary 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.

Where it came up on this site

Related terms

References