Originally published at claudeguide.io/claude-code-subagents-parallel-research
How to Use Claude Code Subagents for Parallel Research
Subagents are the single feature that changes how much work you can get through Claude Code per hour. Used right, a three-subagent fan-out completes cross-codebase research in 90 seconds that a linear pass would spend 7–10 minutes on. Used wrong, you burn tokens and end up with three redundant reports. This is the operating manual. For the broader Claude Code feature set, see the Claude Code Complete Guide.
TL;DR
- A subagent is a fresh Claude conversation with its own context window, started by your main agent to do a scoped task.
- Use subagents when the work is genuinely independent (multiple files, multiple topics, multiple codebases).
- Do not use subagents when the work is sequential (each step needs the previous result).
- The Explore subagent is the right default for search/read tasks; it has no write tools and returns a summary.
- Spawn up to 3 in parallel in a single message; more produces diminishing returns and noisy context.
- The parent does not see the subagent's internal tool calls — only the final summary. Write the prompt so the summary is the thing you need.
What exactly is a subagent
When your main Claude Code session calls the Agent tool, it spawns a new Claude instance. That instance:
- Gets its own system prompt (defined by the subagent type — e.g.,
Explore,Plan,general-purpose). - Starts with an empty context window.
- Has its own tool access, possibly narrower than the parent's.
- Runs to completion independently.
- Returns a single message to the parent.
The parent sees the return message and nothing else — not the subagent's intermediate reads, greps, or reasoning. This is a feature. Your parent conversation stays clean.
The three subagent types worth knowing
As of April 2026, Claude Code ships with a handful of built-in subagents plus any project- or user-defined ones. The three you will use 80% of the time:
Explore
Fast search and read agent. No Edit, Write, or other mutation tools. Ideal for:
- Finding where a function or pattern is defined
- Answering "how does X work in this codebase"
- Surveying multiple areas of a codebase in parallel
Plan
Software architect agent. Returns a step-by-step implementation plan with critical files and architectural tradeoffs. Use when you need a design pass before coding.
general-purpose
Full tool access. Use for multi-step tasks that require both reading and writing. More expensive because it carries the full toolset into its context.
You can also define custom subagents — a .claude/agents/*.md file with a description and tool list. I have a design-system-extractor agent, a code-reviewer agent, and a security-auditor agent. Each is narrow enough to do one thing well.
When subagents actually help
The rule is: subagents help when the work is independent and parallelizable. Three cases where they pay off handsomely, and three where they don't.
Subagents help:
Case A — Cross-codebase survey. "How do Stripe, Polar, and Lemonsqueezy each handle webhook signature verification in our codebase?" Three subagents, one per integration, run in parallel. A linear sweep of the same question takes 3-4x longer because each probe blocks the next.
Case B — Independent file reads. "Read these 8 migration files and tell me if any of them drop columns unsafely." Two or three subagents, each handling a subset, run concurrently.
Case C — Broad-to-narrow research. The parent needs a shallow answer across many areas before deciding where to go deep. One subagent per area, all parallel, and the parent integrates the findings.
Subagents do NOT help:
Case D — Sequential dependency. "Refactor the auth module, then update the tests, then update the docs." Each step needs the previous step's output. Subagents here just add overhead.
Case E — Single-file work. Editing one file with one context. The main agent is already scoped correctly.
Case F — Tight feedback loops. Iterating on a single implementation with the user. Subagents break the loop.
The parallel fan-out pattern
The single most useful pattern:
User question: "How does this codebase handle [X] across [A, B, C]?"
Main agent → spawns in parallel:
- Subagent 1: investigate A
- Subagent 2: investigate B
- Subagent 3: investigate C
Main agent → integrates three summaries → delivers unified answer.
To get the parallelism, the parent must emit multiple Agent tool calls in a single message. Emitting them one at a time serializes them. This is the most common user mistake.
In practice, inside Claude Code, prompt the main agent explicitly:
40 slash command templates. Token-optimized variants. JSONL file for direct import. Tested in production sessions.
→ Get Claude Code Power Prompts 300 — $29
30-day money-back guarantee. Instant download.
Top comments (0)