Context is the one resource every Claude Code session has a limited amount of — and every exploratory search, every side investigation, every "let me check how this other part of the codebase works" eats into the same budget as the actual task at hand. A subagent is how you keep that exploration from polluting the work you're actually there to do.
Think of it as dispatching a focused, temporary version of Claude Code to go do one self-contained thing — read through an unfamiliar module, review a diff, research how a third-party library's API actually behaves — and come back with just the answer. The main session doesn't carry the weight of however many files it had to open or dead ends it explored to get there; it only sees the result.
| Main Session | Subagent |
|---|---|
| Shares full conversation history | Isolated context, own history |
| Best for the actual task at hand | Best for self-contained side work |
| Context grows with everything discussed | Context stays scoped to its one job |
| One thread of work | Multiple can run on independent pieces at once |
Before showing a client a finished feature, dispatch a subagent specifically to review the diff for anything the main session might have missed while focused on making the feature work — edge cases, leftover debug code, an unhandled error path. It comes back with a focused review rather than requiring the main session to context-switch out of "build mode" into "review mode" and back.
Picking up an unfamiliar client codebase, you might dispatch separate subagents to independently map out the authentication flow, the data layer, and the deployment setup — each one doing its own focused exploration without any of them needing to share context with the others. The main session then works from three concise summaries instead of one session's context window filled with every file all three explorations touched.
If the work depends on decisions already made earlier in the conversation — a naming convention you agreed on, a design tradeoff you already discussed — a subagent starting fresh won't have that context unless you explicitly hand it over, which often costs more than just doing the work in the main session directly. Subagents earn their overhead on self-contained work, not on anything threaded through the ongoing conversation.
Subagents, hooks, MCP, and Skills all solve different problems — the free guide covers the fundamentals first if you're still getting oriented.
Get the Free Guide →A subagent is a separate Claude Code instance with its own context window, its own tool access, and its own instructions, launched by the main session to handle a specific piece of work. It reports back a result rather than sharing the main conversation's full history.
Context is a limited, shared resource — dumping a large exploratory search or a long side-investigation into the main session's context pollutes it for the actual task you're there to do. A subagent absorbs that exploration and returns only the useful result.
When the work is self-contained and doesn't need the main session's full history to complete — a focused code review, a search across an unfamiliar codebase, a specialized deep dive. If the task genuinely needs the ongoing conversation's context to make sense, keep it in the main session.
Yes — since each subagent has its own isolated context, independent subagents can be dispatched to work on separate, non-conflicting pieces of a task at the same time rather than one after another.