Subagent
Definition
A separate agent instance with its own context window, launched by a main agent to handle a focused task and report back a short result.
In more detail
The main agent writes a brief, the subagent works on it with its own tools and a fresh context, and only its final answer comes back. This keeps noisy work such as searching a large codebase out of the main conversation.
Claude Code, Codex and other coding agents support subagents, and several can run in parallel. The trade-off is extra tokens and the risk that a vague brief produces an unhelpful result.
Related terms
Agent
A system where a model decides which actions or tools to use, in a loop, until a goal or stop condition is met, rather than following fixed steps.
Context isolation
Running a subtask in a separate context window so raw tool output and intermediate noise never enter the parent conversation.
Context window
The maximum number of tokens a model can consider in one request, covering both the input you send and the output it writes.
Multi-agent system
An application in which several agents, often with different roles, tools or instructions, cooperate or hand work to each other.
Agent2Agent (A2A)
An open protocol that lets agents built on different systems discover each other's capabilities and exchange tasks and results.
Git worktree
An extra working directory attached to the same Git repository, with its own branch checked out, created with `git worktree add`.
Read more about Subagent
- Multi-agent orchestration
Splitting work across subagents or cooperating agents with separate context.