subagent-orchestration

subagent-orchestration is a skill for Claude Code, Codex from dirtybits/agent-skills. It costs 46 tokens per session (2,920 once invoked), scanned A, original, MIT.

Guidance for dividing work between a main coding agent and smaller helper agents. A sub-agent is a separate assistant context that handles one focused task and returns its conclusion.

In plain words
What is it for?
It covers choosing tasks to delegate, writing self-contained prompts, running independent work in parallel, and designing reusable agent roles.
Why use it?
It helps decide when delegation will save effort and how to give helpers enough context to produce useful results.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dirtybits/agent-skills/subagent-orchestration
Any agent
npx skills add dirtybits/agent-skills --skill subagent-orchestration
Clone the repo
git clone --depth 1 https://github.com/dirtybits/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for subagent-orchestration

README.md
[![agentmods](https://agentmods.dev/badge/skills/dirtybits/agent-skills/subagent-orchestration.svg)](https://agentmods.dev/skills/dirtybits/agent-skills/subagent-orchestration)
Your own site
<a href="https://agentmods.dev/skills/dirtybits/agent-skills/subagent-orchestration"><img src="https://agentmods.dev/badge/skills/dirtybits/agent-skills/subagent-orchestration.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,920 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.02920
Opus 5 $0.00023 $0.01460
Sonnet 5 $0.00009 $0.00584
Haiku 4.5 $0.00005 $0.00292

Measured 5d ago against content hash 31f1f4b591a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

subagent-orchestration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (assets/workflow-script-template.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/subagent-orchestration/SKILL.md · 256 lines

How it starts

The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sub-agent Orchestration

A sub-agent is a fresh context window with its own tools that does one scoped task and returns a single final message. The agent that spawned it (the orchestrator) sees only that final message — never the sub-agent's intermediate reads, greps, or reasoning. That one fact drives almost every decision below, so hold onto it:

The orchestrator pays for the sub-agent's conclusion, not its work.

Harnesses name this primitive differently — a Task tool, an Agent tool, a "subagent", a Workflow step — but the contract is the same everywhere. This skill is written to that contract, not to any one tool. Substitute your harness's spawn mechanism wherever you see "spawn a sub-agent".

Most agents get the balance wrong in both directions: they under-delegate broad searches and parallelizable work (doing serially, inline, what should fan out), and they over-delegate trivial lookups (spawning a whole agent to read one known file). The goal here is to get the balance right.


The one-line test

Delegate when the work is large to do but small to report, or independent enough to run in parallel. Keep it inline when you need the details rather than a summary, when the steps depend on each other turn-by-turn, or when it's faster to just do it than to describe it.

Everything below is that test, expanded.


When to spawn a sub-agent

1. Fan-out search / exploration. The question can only be answered by sweeping many files, directories, or naming conventions, and you want the conclusion, not the raw material. "Where is auth enforced across this monorepo?" → an explorer reads 40 files and returns a 15-line map. Your context grows by 15 lines, not 40 files.

2. Independent work that can run in parallel. N items with no cross-dependencies — review 8 changed files, research 5 topics, audit 12 endpoints. Spawn them concurrently and wall-clock collapses to the slowest single item instead of the sum.

3. Large-but-disposable intermediate output. Any task whose byproducts are huge but whose payload is small: tailing logs to find the one stack trace, running a test suite to extract the failures, scanning a dataset for outliers. Isolation keeps the noise out of your context.

Read the full file on GitHub · 256 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 256 lines · 46 tokens per session scan A 31f1f4b591a4

Subscribe to this mod's changes

subagent-orchestration is a skill published in the GitHub repository dirtybits/agent-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 46 tokens to every session and 2,920 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.