Subagent
A separate agent run with its own fresh context, started by a main agent for one subtask.
A subagent is a separate agent run with its own fresh context, started by a main agent for one focused subtask. It works in its own context window and reports back only a summary of what it found, so the main conversation stays clean.
There are three reasons to use one. Context isolation: a search through dozens of files or a long review happens in the subagent’s window, and the main agent gets a few paragraphs instead of the whole transcript, which delays context rot. Parallelism: independent subtasks run at the same time. Specialization: a subagent can get its own instructions, a narrower tool set or a cheaper model. The costs are tokens, because every subagent rereads what it needs, and lost detail: the summary is lossy, and whatever the subagent saw but did not write down is gone for the main agent. Ask for a structured result with sources, so the main agent can check claims instead of trusting them.
With subagents the main agent decides turn by turn what to delegate, and the results land in its context (Claude Code docs). In an agent team, long-running peers coordinate through a shared task list. In a dynamic workflow, a script runs dozens or hundreds of agents and keeps their results out of any one context. All three are forms of a multi-agent system.
Sources
- Claude Code Docs: Create custom subagents code.claude.com
Related terms
- AI agent: A model that decides its next step itself, calls tools and repeats until the task is done.
- Context window: The maximum number of tokens the model can read and write in one request.
- Context rot: Model quality drops as the context fills with old, irrelevant or conflicting material.
- Multi-agent system (multi-agent orchestration): Several AI agents with separate roles and contexts working on one task, usually coordinated by a lead agent or a fixed workflow.
- Agent team: A lead agent coordinating several long-running agent sessions that share a task list and message each other directly.
- Dynamic workflow: An orchestration script the agent writes at run time. A runtime executes it, starting many subagents in phases and combining their results in code.
- Orchestrator-workers pattern (supervisor): One model plans the task, hands parts of it to worker models or subagents, and combines their results.
- Agent Skills: Folders with instructions, scripts and references that an agent loads only when the task needs them.
