Subagents for Claude Code. Invoke when creating, debugging, or deciding whether to use agents for task delegation.
A subagent is a separate context with its own system prompt. It inherits none of the caller's conversation, and everything it reads is discarded when it stops โ only what it returns survives. Isolation is the reason to pay for one, and the return value is the entire product.
prompt-engineering for the wording, instruction budget, and
timelessness rules that govern every line written here. This skill covers only what is specific to the subagent
artifact โ the delegation decision, the frontmatter, and the prompt the agent wakes up with.
keep-coding-instructions: false, drops the # Doing tasks section โ it never gives the
work a context of its own.Explore for read-only search on Haiku, Plan for read-only
research, and general-purpose, which is what an Agent call gets when it names no type.name and description when it decides to delegate. The body loads after that decision, so no
line in it rescues a description that never fires.code-reviewer". A concrete exclusion beats abstract precision.Description tuning against observed misfires, the constraint block that stops scope creep, the efficiency and
return-length caps that stop context bloat, A/B comparison between versions, the fan-out iteration loop and the
parallel-session bias it carries, and the criteria separating a fix from a split from a rebuild:
[${CLAUDE_SKILL_DIR}/references/iteration.md]. Read it when a working agent fires on the wrong requests, never fires,
underperforms on part of its scope, or is being tuned across a fan-out.
name takes lowercase letters, numbers, and hyphens, caps at 64 characters, matches the filename stem, and must not
contain "anthropic" or "claude". claude-code-guide ships as a built-in, so an author copying that naming style
writes a name the loader rejects. description caps at 1024 characters; neither field accepts < or >.tools set the task needs. An omitted tools field inherits everything the parent holds. The
allowlist is the enforcement; a prose constraint in the body is not.skills. A subagent inherits none from the parent, and the field injects the
full skill text rather than making it invocable.permissionMode restricts and never escalates. A parent running auto makes the field inert, and a parent's
bypassPermissions is inherited and cannot be revoked from the definition.model to the work, not to the caller. inherit is the default, so a cheap high-volume agent pays the
caller's price until the field says otherwise. A per-invocation model and CLAUDE_CODE_SUBAGENT_MODEL both outrank
it.Agent tool's name parameter makes the spawn a teammate while agent teams are enabled, and a teammate's
idle notification carries no output. Spawn without a name when the caller needs the result back.hooks, mcpServers, and permissionMode are ignored without warning in a plugin-bundled agent. Copy the file
into .claude/agents/ to use them.The full field list, the Agent tool parameters, permission-mode semantics, storage and scope priority, the hooks
schema, and the SDK settingSources requirement: [${CLAUDE_SKILL_DIR}/references/spec.md]. Read it when setting a
field this section does not cover, or when deciding where the definition file lives.
Creation methods, tool sets by agent type, model selection and resolution order, the prompt skeleton, and four
agent-type templates: [${CLAUDE_SKILL_DIR}/references/creation.md]. Read it before writing a new definition file.
An agent that finds problems will find problems. Left uncalibrated it treats an empty report as a failed run and manufactures findings to look diligent โ which costs more than the review saves, because every false finding buys a human ruling. State the control explicitly in the prompt:
An agent whose method mutates the tree โ a test auditor that breaks code to prove a test catches it, a migration
prover, anything running a negative control โ needs isolation: worktree, not merely permission to edit. The risk is
not two agents colliding but one agent crashing mid-mutation and stranding a broken tree that its caller believes is
clean.
git diff that the file is back to its pre-mutation
state. An unverified restore is an unrestored file.blockedBy on a shared task
list. Independent one-shot work stays cheaper as standalone spawns.Pipeline, parallel fan-out, orchestrator-workers, agent teams end to end, worktree isolation, background execution, the
Agent SDK, and six complete agent definitions: [${CLAUDE_SKILL_DIR}/references/patterns.md]. Read it when more than
one agent is involved, or when the run is backgrounded or driven from the SDK.
Score trigger accuracy separately from output quality. They break for different reasons and take different fixes โ a wrong description misroutes, a wrong body misreports โ and a single overall impression hides which one failed. The requests that should route elsewhere are where a description fails, and they are the cases nobody runs by accident.
The five weighted scoring dimensions with their score guides, the quality thresholds, the five-level testing protocol,
and regression benchmarking: [${CLAUDE_SKILL_DIR}/references/evaluation.md]. Read it when scoring an agent, or before
other people depend on one.
Symptom-to-cause-to-fix for discovery failures, tool permissions, stalled teammates, background agents, worktree
cleanup, hooks, and the SDK: [${CLAUDE_SKILL_DIR}/references/troubleshooting.md]. Read it when an agent fails outright
rather than underperforms.