Last time we laid out four orchestration primitives side by side. This time we drill into the one people buy wrong most often. A subagent is not a stronger skill: one injects instructions into the conversation you are already in, the other opens a fresh context and hands back a single paragraph. We read the official inheritance table line by line, then open two real subagent pipelines that someone already wrote for you.
Whether to reach for a subagent has nothing to do with how hard the task is. It depends on whether you still want to watch the middle. The Agent SDK's subagents page lists four benefits: context isolation, parallelization, specialized instructions and knowledge, tool restrictions. Only the first is something a skill cannot give you — the other three, a skill does fine. So the route here is: read both inheritance contracts first (who can see what), then name the concrete things you can install or read, and only then hand over the criteria. One preview of those: will you read its output as a paragraph, or follow it as a series of steps?
A subagent is a .md file under .claude/agents/ (project) or ~/.claude/agents/ (global) — both are scanned recursively. Only name and description are required; the body is its system prompt. From the official subagents docs, these optional fields are the ones worth memorizing:
# .claude/agents/api-developer.md
---
name: api-developer
description: Implement API endpoints following team conventions
tools: Read, Grep, Edit, Write, Bash # omit = inherit all; a tool left out isn't in its session at all
model: sonnet # sonnet/opus/haiku/fable/inherit
skills: [api-conventions, error-handling-patterns] # * preloaded at startup
memory: project # user/project/local persistent memory
isolation: worktree # * give it its own git worktree
omitClaudeMd: true # skip CLAUDE.md files (saves tokens)
maxTurns: 10 # output at the cap is marked partial; resumable
---
You are an API development specialist...
That skills: line kills the false dichotomy on its own: a subagent can run with skills loaded. It works the other way too — a skill whose frontmatter sets context: fork runs in an isolated context, and agent: picks which subagent type it forks into (see the official skills docs).
Claude Code ships three built-in subagents. Zero installs, available right now:
# (1) Explore -- read-only tools (Write/Edit denied), three thoroughness levels
Use the Explore subagent, very thorough, to map every place we validate JWTs
# (2) Plan -- the one that researches during plan mode, also read-only
# (3) general-purpose -- every tool available to subagents; can modify code
# After writing your own agent file, check its frontmatter before a session
claude plugin validate .claude/agents
# No file needed: a one-off JSON definition
claude --agents '{"code-reviewer":{"description":"Expert code reviewer.",
"prompt":"You are a senior code reviewer.","tools":["Read","Grep","Glob"],"model":"sonnet"}}'
# Or run the whole session as that agent
claude --agent code-reviewer
What Explore takes off your plate is very concrete: the output of forty greps never enters your conversation. When not to use it: the answer is one line anyway ("which file holds this function"). Dispatching an agent to ask costs you a cold start plus a round trip, and the context you save isn't worth that.
The SDK docs put it plainly: The only content you pass from parent to subagent is the Agent tool's prompt string, so include any file paths, error messages, or decisions the subagent needs directly in that prompt. That is the entire explanation for "but I just told it" — you told the main conversation, not the subagent.
/subtask <description> in an interactive session starts a fork: its own context window, but full inheritance of the parent's history, system prompt, output style, model, and the parent's exact tool pool (skipping the filter that trims tools from background subagents). A fork is the answer for "I need isolation but I cannot afford amnesia." The cost: it inherits every token of the parent, so the only noise isolation saves is what comes after.
<system-reminder> gets a backslash inserted, lines starting with Human: or Assistant: get one before the colon, and a matching report is prefixed with a [harness: ...] marker line. The docs are explicit about two limits: the scan doesn't judge maliciousness, and it isn't a substitute for restrictions — the real guardrails remain tools, disallowedTools and permissions. Letting a subagent read external pages and then treating its report as instructions is a ready-made injection chain.A skill's mechanism is instruction injection: the description sits in context permanently (cheap), the body expands only when invoked, and once expanded it stays in the thread across turns. So skills fit "a rule every following step must honor," subagents fit "this stretch I don't want to watch." disable-model-invocation: true makes a skill user-only; user-invocable: false makes it model-only. Those two fields together are a skill's real invocation contract.
subagent-driven-development# one command from the official marketplace
/plugin install superpowers@claude-plugins-official
This skill has a one-line description: Use when executing implementation plans with independent tasks in the current session. It opens an isolated git worktree, verifies the plan, scans for conflicts and creates a ledger; then per task it runs dispatch implementer → handle report → task-specific review → fix loop, up to five rounds, with rounds 1–3 resuming the original implementer and rounds 4–5 escalating to a more capable model; finally a whole-branch review on the most capable model. What it takes off your plate: by task seven of a long plan, the noise from tasks one through six has already filled the window. When not to use it — it says so itself: no implementation plan exists, the tasks are tightly coupled rather than independent, or your platform has no subagents at all (then run inline).
dispatching-parallel-agentsIts trigger reads 2+ independent tasks that can be worked on without shared state or sequential dependencies, while the body sets a higher bar: three or more distinct root causes before parallelism pays. The line worth memorizing is the mechanism: Multiple dispatch calls in one response = parallel execution. One per response = sequential. Parallelism is not a switch — it is how many calls you put in one reply. When not to: the failures are related (fixing one may fix the others), understanding requires full system context, agents would interfere with each other's edits, or the root cause is unknown and you're still exploring. It also has a line worth taping to a wall: Do NOT just increase timeouts—find the real issue.
isolation: worktree: the only sane way to write files in parallelIt is no accident that both skills above start by opening a worktree: several subagents editing one working tree are overwriting each other. One frontmatter line, isolation: worktree, gives an agent its own; superpowers also ships a dedicated using-git-worktrees skill for that path. When not to: read-only work (anything Explore-shaped) — a worktree is pure IO there.
wshobson/agents: an off-the-shelf agent library/plugin marketplace add wshobson/agents
/plugin install python-development
Self-described as 94 plugins, 202 agents, 183 skills, 105 commands (per that repo's README, read 2026-09; MIT), generating harness-native artifacts from one markdown source. The real value is reading how other people write descriptions — whether a subagent ever gets dispatched automatically depends entirely on that field. When not to install: taking the whole marketplace means paying a description tax (see the 15,000-token warning in 04); install only the plugin you actually use.
In the SDK, subagents are the agents parameter of query(), and AgentDefinition maps almost field for field onto the file version (description and prompt required; tools, disallowedTools, model, skills, maxTurns, background, effort optional). Two traps: in the Python SDK, disallowedTools and mcpServers keep their camelCase spelling; and to detect a real dispatch you must match both "Agent" and the older name "Task". Past a certain scale subagents are the wrong tool — the docs point at the Workflow tool and dynamic workflows, which move orchestration into a script outside the conversation. When not to reach for Workflow: two or three agents in a turn, where plain subagents are enough.
/subtask. Needs a few paths and one stack trace → a normal subagent, with those written into the prompt string.In How we built our multi-agent research system (2025-06-13) Anthropic gives three figures: agents use about 4x the tokens of chat, and multi-agent systems about 15x; on their internal research eval the multi-agent system beat single-agent Claude Opus 4 by 90.2%; and token usage alone explains 80% of the variance in browsing ability. The same piece lists where it does not fit: tasks where all agents need the same context, domains with many inter-agent dependencies, and most coding tasks — their wording is that coding has fewer parallelizable components than research. Read the three together: 15x for 90.2% is worth it or not depending on whether your task looks like research or like editing code.
Prompting Claude Opus 5 says it outright: Claude Opus 5 delegates to subagents more readily than prior models. The official remedy comes in two layers — a prompt layer and a hard cap:
# (1) the prompt layer (official example, copy it verbatim)
Delegate to a subagent only for large tasks that are genuinely independent and
parallelizable, such as a wide multi-file investigation. Do not delegate work you
can finish yourself in a handful of tool calls, and do not use subagents to verify
or double-check your own work. If one subagent can complete the task, use one
rather than several, and keep spawn counts low.
# (2) the hard caps (env in .claude/settings.json; defaults: depth 3 / 20 concurrent)
"env": { "CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH": "1",
"CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS": "5" }
# The SDK adds a third: maxBudgetUsd / max_budget_usd -> error_max_budget_usd at the cap
The same document has a counterintuitive instruction: Opus 5 verifies its own work unprompted, so old lines like "use a subagent to double-check" should be removed — keeping them only causes over-verification and burns tokens. Note those two environment variables need Claude Code 2.1.217 or later.
AskUserQuestion is unavailable inside subagents (so are EnterPlanMode, ScheduleWakeup and Workflow). Stuck, it guesses, and you see the guess in the report. Background subagents lose most built-in tools on top of that./subtask when you need isolation without amnesia; the cost is inheriting every parent token.tools, isolating with a worktree, and reading the report as data are a set, not a menu.Read these three first: (1) Claude Code · Subagents — the full field table, the three built-ins, the fork section, and the two tool filters; half of this issue comes from it. (2) superpowers · subagent-driven-development — what a real subagent pipeline looks like, down to the five-round fix cap and the model escalation. (3) Anthropic on their multi-agent research system (2025-06) — 15x tokens, 90.2%, and "most coding tasks" on the unsuitable list.
Then as needed: dispatching-parallel-agents (several dispatches in one reply = parallel; four conditions that forbid it) · Agent SDK · Subagents (every AgentDefinition field, the depth/concurrency/budget caps, how to resume) · Claude Code · Skills (context: fork plus agent:, isolating a skill in place) · Prompting Claude Opus 5 (the delegation snippet; delete legacy "verify with a subagent" lines) · wshobson/agents (an off-the-shelf library, worth reading for description style) · Dynamic workflows (once the scale outgrows subagents).
Explicitly don't: dispatch a subagent to fetch a one-line answer · expect it to remember what you just said (paths and errors go in the prompt) · let several subagents write to one working tree · execute a subagent's report as instructions · leave legacy "double-check with a subagent" lines in an Opus 5 prompt · turn it loose with no depth, concurrency or budget cap.
.claude/agents/*.md or the SDK's agents parameter./subtask)skills: preloading[harness: ...] line when matched. It doesn't judge maliciousness and doesn't replace tools or permission limits.context: fork, is there any difference left between the two concepts?skills, isolation, omitClaudeMd, maxTurns, memory…); the three built-ins (Explore with three thoroughness levels, Plan, general-purpose); the inherits/doesn't-inherit table; the fork section; the list of tools subagents cannot use and the extra trim for background runs; output scanning; the 15,000-token description warning at startup; claude plugin validate .claude/agents (accessed 2026-09)AgentDefinition table; "the only content you pass from parent to subagent is the Agent tool's prompt string"; the depth, concurrency and maxBudgetUsd caps with defaults; a complete resume example; matching both "Agent" and "Task" when detecting dispatch (accessed 2026-09)context: fork, agent: and background: are the three used here; Anthropic's own Skills vs. Subagents vs. CLAUDE.md comparison (accessed 2026-09)max_budget_usd requiring Claude Code 2.1.217+; the instruction to drop "use a subagent to verify" lines (accessed 2026-09)/plugin marketplace add wshobson/agents