In Claude Code, subagents are specialized helpers that Claude delegates a task to. Each subagent runs in its own isolated context window -- its own separate workspace -- does the work on its own, and reports only the result back to your main conversation. Think of it as handing a well-scoped job to an assistant who goes off, gets it done, and comes back with the answer instead of narrating every step to you. You create and manage them with the /agents command.
What Claude Code subagents actually are
When you ask Claude to do something large, like search an entire codebase or research a self-contained question, all of that digging normally happens right in front of you, filling your conversation with search results and file contents you will never look at again. A subagent moves that work somewhere else. It gets a task, its own set of tools, and its own instructions, then works in a separate context and returns a short summary. Two things make this valuable: the main thread stays clean, and more than one subagent can run at the same time.
The two big benefits
Almost every reason to reach for a subagent comes down to one of these two ideas.
The built-in subagents
You do not have to build these from scratch. Claude Code ships with a few subagents it reaches for automatically, and each one has a clear job.
Claude picks the right built-in subagent for the job automatically.
You can also define your own. A custom subagent is described by three things: a plain-English note about when to use it, a system prompt that tells it how to behave, and the set of tools it is allowed to touch. That last part is a real safety lever -- you can give a "reviewer" subagent read-only access so it can look but never change anything.
A real example
Say you are trying to understand how billing works across a large project before you change anything. On your own, you would open a dozen files and lose the thread. Instead you send that search to a subagent:
Hand a broad search to a subagent. Click to copy.
The Explore subagent reads through the code in its own space and comes back with a short, plain summary -- not a wall of file dumps. Your main conversation stays clean and ready for the actual work. And when you have several unrelated questions, Claude can fan them out to run at the same time:
Three subagents run at once and report back separately.
Foreground, background, and staying in control
Subagents can run in the foreground, where you watch them finish before moving on, or in the background, where they work while you keep going with something else. Either way, a subagent only ever reports a result back to you -- it does not take over your conversation. One thing worth knowing: built-in subagents work within a single Claude Code session. If you want many fully independent sessions running side by side, that is a related but different feature.
When to reach for a subagent
Use one when a side task would otherwise flood your main conversation with results you will not reference again, or when you have several self-contained jobs that can run at once. A broad codebase search, a research question that stands on its own, or a "go read all of this and tell me the gist" task are the classic fits. If a job is small and its output is the thing you are actually working on, just ask Claude directly -- there is nothing to isolate.
