Most Claude Users Think Agents Are One Level Deep — They're Not
Claude Code can now spawn agents that spawn their own agents, up to five levels deep, so it can break a huge task into a whole tree of specialists that work independently.
01. What It Is
Since Claude Code v2.1.172 (released June 10, 2026), a sub-agent isn't limited to being a single helper the main assistant hands work to. A sub-agent can itself spawn more sub-agents — and those can spawn even more — creating a recursive tree of workers up to five levels deep. The parent spawns a child, the child spawns a grandchild, and so on.
This is implemented through the Task tool inside Claude Code's agentic mode. There are no config file edits, no special flags, and no setting to switch on. When a task is complex enough, Claude can delegate branches of it to specialized agents that run with their own isolated context windows, then report structured status and results back up to the agent that created them.
The main design goal here isn't raw parallelism — it's context management. Each level gets a clean, isolated context window so a deep, multi-step architecture doesn't clog a single conversation with thousands of tokens of intermediate detail. Up to 10 parallel sub-agents can run at once under a single orchestrator, and the whole thing aggregates back to the top.
Why It Matters
Complex builds — a new service with a data layer, API, tests, and docs — normally require you to babysit each step. Nested sub-agents let Claude carve the work into a delegation tree where each branch keeps its own clean context, so it can finish larger architectures with far less human micro-management and without a single context window overflowing.
Who Can Benefit
- Developers orchestrating large, multi-step codebases
- Teams building complex features with many independent parts
- Anyone hitting context-window limits on big agentic tasks
- Cost-conscious users who want to tier models across a workflow
02. Step-by-Step Guide
- 1
Update to v2.1.172 or later
Nested sub-agents require Claude Code v2.1.172 (June 10, 2026) or newer. Update your CLI first — nothing else works without the right version.
- 2
Just ask for the complex task — no flags needed
There's no configuration to enable nesting. In agentic mode, give Claude a task big enough to warrant delegation and it will use the Task tool to spawn sub-agents, which may in turn spawn their own.
- 3
Define reusable specialists in .claude/agents/
Create file-based subagents in the .claude/agents/ directory. These become named specialists Claude can spawn — a test-writer, a schema-designer, a docs-writer — and they can be nested inside the tree.
- 4
Let it branch up to 5 levels
The recursion goes parent → child → grandchild down to depth 5. That cap is hard-enforced server-side; there is no way to raise, lower, or disable it, so architect your delegation to fit within five layers.
- 5
Tier your models across levels
For cost efficiency, put Opus at the orchestration layer for high-level planning, Sonnet at the mid levels, and Haiku for leaf tasks. Each level consumes its own context window, so token costs compound per branch.
- 6
Let results aggregate upward
Each sub-agent returns structured status and results to its parent. The orchestrator collects everything back up the tree, so you review one consolidated outcome instead of chasing each branch.
Pro Tips
- Use model tiering deliberately: Opus for the orchestrator, Sonnet mid-tree, Haiku for leaf tasks — this is the cleanest way to control compounding token costs.
- Think of nesting as context hygiene, not a parallelism hack. The real win is keeping each branch's context isolated and clean.
- Design your delegation tree to fit inside five levels from the start; the depth cap won't budge.
Warnings & Limitations
- Token costs compound per branch — each level consumes its own context window, so a deep, wide tree can get expensive fast.
- The 5-level depth cap is hard-enforced server-side. You cannot raise, lower, or disable it.
- Only 10 parallel sub-agents can run at once per orchestrator — that's a single-orchestrator limit, not a global budget you can expand.
- The Agent(name1, name2) allowlist only restricts spawning when an agent runs as the main thread. Inside nested sub-agent definitions the list is silently ignored, so don't rely on it for guardrails deep in the tree.
- Nesting is designed for context management, not primarily for running more work in parallel — don't expect it to multiply throughput.
Related Tricks
Most Claude Users Still Don't Know Cowork Can Run Automation Agents Right on Their Desktop
Claude Cowork turns a single prompt into an agent that drives your spreadsheets, email, browser, and files directly on your own machine—no manual uploads or copy-pasting.

ChatGPT Can Now Send Real Emails Directly—Most Users Still Don't Know It Exists
ChatGPT quietly gained the power to send actual emails from your Gmail or Outlook—not just draft them. It's buried, paid-only, and most people assume it can't.

Most Perplexity Users Don't Know It Can Run 19 AI Models at Once
Everyone treats Perplexity like a single smart search box. Hidden inside is Computer—a multi-agent system that dispatches 19 AI models in parallel to take a project from question to finished deliverable.
