ع
Learn Tracks Reference Guides Saved
Compare & decide

Agent vs Subagent in Claude Code

The moment you understand the agent/subagent split, you stop stuffing everything into one long conversation and start keeping your main thread clean.

4 min read · Updated 2026-06-16
Agent vs Subagent in Claude Code

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

SituationUse the main agentUse a subagent
Quick question about one fileYesOverkill
Read 30 files and summarizeNo — context pollutionYes
Research side-questNo — buries the threadYes
Multi-step task you want to watchYesNo — you’d lose visibility
Parallel investigationNot possible aloneYes — 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.

Topics

Questions people ask

Does a subagent see my conversation history?
No. A subagent starts with a fresh context — it only knows what you put in the request. That's the point: it does the messy work without cluttering your main thread, and reports back just the result.
When should I use a subagent instead of just asking my main Claude?
When the task would bury your main conversation in noise — reading forty files, searching for every use of something, or any research-heavy side-quest where you only care about the summary, not the process.
Can a subagent use tools and edit files?
Yes. A subagent is a full Claude with tool access. It can read files, run commands, and make changes — it just does it in its own context window and reports back.
Put it into practice
Take the guided course
Start