dispatching-subagents
БесплатноЗапускает вложенные скриптыНе проверенChooses how to launch subagents from Claude Code (the Agent tool, a Workflow script, or headless claude -p children) and runs a headless fan-out from one…
от oaustegard★ 425 звёзд на GitHubОб этом скилле
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 |
The headless runner is the default for volume. On 2026-10-11 a codex build
dispatched 314 Haiku children through the Agent tool. The children cost
$11.61. The 1,458 Opus parent turns the dispatching took (each re-reading a
context of about 400K tokens) cost roughly $160–170, about 14× the work. Five of
the same tasks through headless_fanout.py cost $0.10, $0.02 each against
$0.033 per Agent-tool child, and one parent call.
Choosing
Answer in order. The first yes picks the mechanism.
- Does the child need what only the session has? That means MCP connectors
(Muninn, Gmail, GitHub MCP), a context hook's transcript chunks, a worktree,
or a custom agent type with guard hooks such as
auditor. If so, use the Agent tool. Keep the count small, or batch many items into each child, because every launch costs a parent turn. - Do you need to read each result before deciding the next launch? That is iterative work where task N+1 depends on N's answer. Use the Agent tool.
- Did the user opt in to a workflow, and does the procedure have phases a
script should enforce (find → verify → fix, with retries and gates)? Use
Workflow, and load
workflow-authoringfirst. Accept 2-way concurrency on a 4-vCPU container, or move the bulk phase to headless children. - Are there ten or more independent tasks whose inputs fit in a prompt or in files, and whose output a script can check? Use headless children. This covers judges, graders, extractors, page writers, verifiers and per-file reviews.
- Fewer than ten small independent tasks: use the Agent tool in one message. The parent-turn cost is still small at that size.
Fan out across tasks, not across samples of one task
A fan-out pays when each child does a different job. Several children
attempting the same coding task and keeping the first that passes the visible
tests bought nothing past four on the 60-task code-lanes set (oaustegard/experiments
code-lanes/RESULTS.md, Haiku round, 2026-11-29):
arm (Haiku 5.5, --effort low, headless) |
solved / 60 | cost, all 60 |
|---|---|---|
| one attempt, retried on the first visible-test failure (≤3 rounds) | 53 | $0.043 |
| first visible passer of 4 samples | 53 | $0.18 |
| first visible passer of 16 samples | 53 | $0.64 |
| Sonnet 5.5, one attempt with the same retry | 55 | ≤ $0.89 |
- For a coding task with tests, launch one Haiku child and retry it on the
test output; route the model and the escalation with
agent-routing. - The remaining misses were conventions no visible test exercised (every model missed the same five) and the first-passer pick (on one task 10 of 15 passers were right and the first was wrong). Write the convention into the prompt or a test; more samples fix neither.
- If you sample anyway, select by vote or an extra test, never by first passer.
- A map step that has every child read one section of a long transcript and
extract facts lost to selecting the context: Haiku found 182 of 232 facts
with 60K-token sections (167 with 6K) against 217 for Jev-selected 10K tokens
(
transcript-lanes, 2026-11-30). Keep the selector; use the map only when the worker's input must be a few hundred tokens, and then with sections near (under) 100K tokens.
Earned exceptions
| rule | banned when | earned when |
|---|---|---|
| Use headless for volume | the child needs an MCP connector or the parent's transcript | the inputs can be written into the prompt or a file first |
| Agent tool for small counts | the parent cont |
Установить dispatching-subagents в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dispatching-subagents?
Chooses how to launch subagents from Claude Code (the Agent tool, a Workflow script, or headless claude -p children) and runs a headless fan-out from one background command. Use for "fan this out to 50 agents", "run these tasks in parallel", "launch subagents for each file", "should I spawn agents or write a workflow", "batch this through Haiku", "run claude -p in parallel", "dispatch a task list without the launches eating my context", or before any launch of more than a handful of subagents, where the launching itself is the cost. Covers the parent-turn cost of each mechanism, concurrency ceilings, what context and tools each child gets, effort control, output contracts, a cost ledger, and resume after interruption.
Как установить скилл dispatching-subagents?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dispatching-subagents запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic