Extend Coordinated by the main session GA ⓘ legend

Subagents

A specialized worker the main conversation spawns to run a side task in its own fresh context window; only a summary returns. The first form of parallelism — still inside one session.

Analogy โ€” handing an intern a self-contained errand: “go read these 50 log files and tell me the one error that matters.” They do the messy work elsewhere; you get the one-line answer, not the 50 files in your lap.

Mechanism

Markdown files with YAML frontmatter. The main conversation reads each subagent’s description, delegates, and decides what runs next. The subagent works in an isolated window; only its final summary returns to the caller. Subagents cannot spawn other subagents (no nesting).

---
name: log-triage
description: Use proactively to scan logs and report the single root-cause error.
tools: Read, Grep, Bash
model: haiku
isolation: worktree   # optional: own git checkout
---
You are a log triage specialist. ...
Built-ins, scopes & resumability

Built-ins: Explore (Haiku, read-only search), Plan (read-only, plan mode), general-purpose (all tools). Scopes by priority: managed > --agents CLI > .claude/agents/ (project) > ~/.claude/agents/ (user) > plugin. Manage with /agents.

Foreground = blocking; background = concurrent. A subagent can be resumed and retains its history. Transcripts persist separately from the main conversation, so they survive its compaction.

When to reach for it

โœ“
A side task would flood your context with output you won’t reference again (search, logs, doc fetches).
โœ“
You want a restricted tool/permission profile, or to route to a cheaper model (Haiku) for cost.
โœ“
Work is self-contained and only the summary matters.

When not to

โœ•
Frequent back-and-forth or iterative refinement — the fresh-context re-gather is wasteful.
โœ•
Workers need to talk to each other โ†’ agent teams.
โœ•
Reusable prompt for the main context (no isolation needed) โ†’ a skill.

Best practices

โ˜…
One focused task per subagent.
โ˜…
Write a detailed description (add “use proactively”) — Claude uses it to decide delegation.
โ˜…
Restrict tools for focus and safety; check project subagents into version control.
โ˜…
Use isolation: worktree when a subagent edits files in parallel with others.
The transition point Running parallel subagents but hitting context limits, or needing them to communicate? That’s the documented signal to graduate to agent teams or a workflow.

Sources