Subagent

Definition

A subagent is a helper AI agent that a main agent hands a side task to: it works in its own separate context, with its own instructions and tool access, and sends back only a summary. This keeps the main conversation focused and lets tasks run in parallel.

By Ronan Liedmeier, fractional head of growth and course author · Published 17 October 2026 · Last updated 17 October 2026

Also called: sub-agent, child agent

An agent's context window fills up with search results, logs and file contents it will never look at again. Pushing that work into a subagent keeps the main agent's memory for the task you actually care about.

How it works

In Claude Code, a subagent is a Markdown file. A short header at the top gives it a name, a description of when to use it and a list of allowed tools, and the text below becomes its instructions. When a task matches the description, the main agent delegates it. The subagent does the searching or reading in its own context and returns a summary.

Research setups use the same pattern at a larger scale. A lead agent splits a question into parts, a subagent works on each part in parallel, and the lead agent combines the results. That arrangement is a form of orchestration.

Example

Before a sales call, an account manager runs a research setup with four subagents: company profile, recent news, key people and likely pain points. Each one searches and reads on its own. The main agent merges the four summaries into a two-page brief she reads in the five minutes before the call.

Common mistake

A common slip is giving every subagent every tool. A fact-checking subagent needs search and read access, and nothing that can write or send. Narrow tool access per subagent is one of the main reasons to define them separately in the first place.

Learn it in AI Academy

Related terms

Claude Code
Claude Code is Anthropic's AI agent that works inside your files and terminal: it reads a project, edits files, runs commands and connects to other tools. Anthropic built it for software work, but it also handles other tasks made of files, APIs and repeatable steps.
AI orchestration
AI orchestration is coordinating the steps around an AI model so a task runs reliably from start to finish: what starts it, which tools and data it gets, what happens when a step fails, and when a person must approve. The model is one step in that chain.
Context window
A context window is the maximum amount of text an AI model can take into account at once, measured in tokens. It holds your messages, any files you add, its instructions and its own replies, and whatever doesn't fit is left out.
Deep research
Deep research is a mode in AI assistants where the model runs many web searches on its own, reads the sources it finds and writes a longer report with citations. It takes longer than a normal answer and suits questions that need several sources compared.

Sources

Browse all terms

Find your next step with AI