When you’re working with Claude Code, you’re talking to an agent — an AI that plans, acts, checks, and loops until a job is done. But sometimes that agent spins up a second Claude to handle a sub-task. That second Claude is a subagent.
The distinction matters because it’s the key to keeping long sessions productive.
The one-line version
- The agent is your main Claude — the one you’re talking to.
- A subagent is a helper Claude it delegates work to, with its own separate context.
Why the split exists
Your main conversation has a finite context window. Every file read, every command output, every message — it all takes up space. When a side-quest requires reading thirty files just to answer one question, doing it in the main thread fills the window with noise you don’t care about.
A subagent solves this by doing the messy middle somewhere else and returning just the answer.
How it looks in practice
You ask your main Claude:
Find every place we send email in this codebase and summarize how each one works.
Claude could read all those files itself — but that would eat your context with implementation details you don’t need. Instead, it spins up a subagent:
- The subagent gets its own fresh context window
- It reads all the files, traces the logic, takes notes
- It reports back a clean summary
- Your main thread gets the answer without the mess
When to delegate
| Situation | Use the main agent | Use a subagent |
|---|---|---|
| Quick question about one file | Yes | Overkill |
| Read 30 files and summarize | No — context pollution | Yes |
| Research side-quest | No — buries the thread | Yes |
| Multi-step task you want to watch | Yes | No — you’d lose visibility |
| Parallel investigation | Not possible alone | Yes — spin up several |
The mental model
Think of it like a manager and a researcher. You (the main agent) stay focused on the decision-making thread. When you need someone to “go dig into this and come back with findings,” that’s a subagent.
The main agent is the conversation you care about. The subagent is the work you don’t want to watch.
The key trade-off
A subagent can’t see your conversation. It starts blank. So you need to give it everything it needs in the request — enough context to do the job, but not so much that you’re defeating the purpose. The payoff is that your main thread stays clean, focused, and capable of handling the next task without being weighed down by the last one.