dispatching-subagents
Installation
SKILL.md
Dispatching subagents
Claude Code has three ways to start a subagent. They differ most in what the launching costs the parent.
| Agent tool | Workflow tool | claude -p children (scripts/headless_fanout.py) |
|
|---|---|---|---|
| parent cost | one parent turn per launch and one per completion | one tool call per run | one Bash call per run |
| concurrency | 20, and a 21st launch errors (it does not queue) | min(16, vCPUs − 2): 2 on a 4-vCPU CCotw container | RAM-bound, about 210 MB per child: 40 ran clean on 4 vCPU / 15 GB |
| child context | session prefix (~32–55K tokens), plus parent transcript chunks if a context hook is installed | session prefix | what you pass: about 1.2K tokens with --system-prompt and no tools, 39K with the default prompt |
| tools | agent type's tools, the session's MCP connectors, hooks | as Agent | built-in tools named in --tools, write paths allowlisted; no MCP, hooks or skills |
| effort | session's level, or the effort: in a named agent type's frontmatter |
agent(prompt, {effort}) |
--effort (measured: low gave 0 thinking tokens, high gave 112–197) |
| needs user opt-in | no | yes: an explicit request, ultracode, or a skill that calls it | no |
| cost visibility | none per child | none per child | total_cost_usd and tokens per child, in a ledger |
| output check | yours | in-script | file plus JSON Schema, or CLI-validated --json-schema |