Subagent
A separate, focused agent that the main agent can hand a specific task to - for example, exploring a codebase, running a test suite, or making a targeted set of edits - so the work happens in its own isolated context. Subagents let the orchestrating agent parallelize work across multiple concerns without mixing them up in a single long conversation. In Claude Code you can explicitly invoke subagent-style delegation using the Task tool, which launches a fresh context for a specific job and returns the result.
A subagent is an agent that another agent spins up to handle one well-scoped job. The orchestrating agent stays focused on the overall goal; the subagent goes off, does the specific task in its own fresh context, and reports back a result. Because the subagent's work happens in a separate context window, all the intermediate noise - the dozens of files it read, the commands it tried, the dead ends it explored - never pollutes the main conversation. The orchestrator just gets the clean answer.
In Claude Code, subagent-style delegation is exposed through the Task tool. When Claude launches a Task, it spins up a fresh agent with its own instructions and its own context budget, points it at a single concern - 'find every place this function is called', 'run the test suite and summarize the failures', 'make this targeted refactor' - and waits for the result. This is the same pattern a good engineering lead uses with their team: hand off a contained problem, get back the outcome, don't micromanage every step.
Subagents matter for two practical reasons. First, context hygiene: a long task that reads a hundred files can blow through a context window, and a subagent keeps that exploration out of the main thread. Second, parallelism: independent subtasks can be delegated to separate subagents that run at the same time, which is faster than doing everything in one linear conversation. The skill is in scoping - a subagent works best when its job has a clear input and a clear, returnable output, not when it is handed something open-ended.
Related terms
Put it to work
Learn it by building it
Definitions get you oriented. The club gets you shipping. Join Claude Code Club for $9/month.
Related: the full glossary, the learn hub, and our guides.
