Advanced 5 min read

Subagents

Specialized AI assistants with isolated context windows

Prerequisites

  • Basic Claude Code usage
  • Understanding of context windows

What You'll Learn

  • Understand parent-child agent relationships
  • Know when subagents are automatically used
  • Explicitly request specific subagent types
  • Leverage parallel execution for complex tasks

TASKRefactorauthmainClaudeTask Arrives
01/05
0:00 / 0:22

Built-in Subagent Types

Explore

Purpose: Fast codebase exploration and search

Use when: Finding files, understanding structure, locating patterns

Plan

Purpose: Software architecture and implementation planning

Use when: Designing features, planning refactors, strategizing

general-purpose

Purpose: Flexible multi-step task handling

Use when: Complex queries, research, open-ended tasks

claude-code-guide

Purpose: Answer questions about Claude Code

Use when: Asking "can Claude...", "how do I...", feature questions

Plugins can provide additional subagent types like feature-dev:code-reviewer for specialized tasks.

Using Subagents via the Task Tool

// Claude automatically uses subagents when beneficial
// You can also explicitly request them:

User: "Use the Explore agent to find all
       authentication-related files"

// Claude spawns an Explore subagent with:
{
  "subagent_type": "Explore",
  "prompt": "Find authentication files...",
  "description": "Search for auth files"
}

Why Context Isolation Matters

🎯

Focused Attention

Each subagent only sees relevant context, preventing distraction from unrelated information and enabling deeper focus on the specific subtask.

đź”’

Context Window Efficiency

Instead of cramming everything into one context, work is distributed. Each subagent uses its context efficiently for its specific task.

⚡

Parallel Processing

Multiple subagents can work simultaneously, dramatically reducing time for complex tasks compared to sequential processing.

đź’ˇ Pro Tips

  • 1.Let Claude decide when to use subagents—it automatically detects complex tasks that benefit from delegation.
  • 2.For explicit control, specify the subagent type: "Use the Explore agent to..." or "Have the code-reviewer check..."
  • 3.Subagents can be run in background mode, allowing you to continue working while they execute.
  • 4.Results from subagents are returned to the parent context—they don't have direct access to your conversation history.

Master Claude Code faster

Get notified when new animated guides are released.

Subscribe to the newsletter