Task Router
Pick the execution shape first, the model second. Wrong shape is the expensive
mistake — a fan-out for a typo burns tokens and wall-clock; an inline guess at an
architecture change burns an afternoon.
This skill is the authorization to delegate. The standing rule in this environment
is don't use the Agent tool or Workflows unless the user, a CLAUDE.md, or a skill asks
for it. This skill asks for it — but only at the tier it selects. Tier 0 still means
no agent.
When to use
- Before spawning any subagent or workflow.
- When you can't yet name the files a request touches.
- When a request spans multiple repos, domains, or review axes.
- When choosing which model to hand a delegated task.
- When the user asks how to approach, size, delegate, or staff a piece of work.
Don't use it for a request whose target and scope are already obvious — that is
Tier 0 by inspection, and routing it is ceremony.
1. Model policy — read this first
This is a hard constraint, not a preference. It comes before any efficiency argument.
🚫 The excluded tier
Most setups have at least one model tier that is off-limits — it bills outside the plan,
it isn't approved, or it costs more than any task here justifies. Name that tier
explicitly and never pass it, because tool APIs accept a model name silently: nothing
warns you that you just left your billing plan. If a task seems to want the excluded
tier, it wants the highest permitted one instead.
Worked example — the setup this skill was written against. A Claude Max
subscription where fable (Fable 5.1, claude-fable-5-1) bills as direct API tokens
rather than against the subscription, so it is excluded outright. Substitute your own
excluded tier; the routing logic below doesn't change.
The tiers
Named for Claude models below. On another provider, map the three roles — mechanical,
default, hard — onto the equivalent tiers and keep the table's logic.
| Model |
Use for |
Never for |
haiku (Haiku 4.5) |
Purely mechanical, no-judgment passes — grep sweeps, file inventories, mass renames, formatting, link checks |
Anything deciding what to change |
sonnet (Sonnet 5) |
The default. Documentation updates, basic research and fact-gathering, features, refactors, tests, standard review, release notes |
— |
opus (Opus 5) |
Genuinely complex work — architecture, security audits, root-cause debugging, cross-system migrations, anything where a wrong answer is expensive to detect |
Bulk mechanical work |
| the excluded tier |
Nothing. Ever. |
Everything — see above |
Documentation and basic research are sonnet, not haiku. They read as cheap but
they are judgment work: what to include, what's stale, what the source actually says.
Haiku is only for passes where the answer is mechanical.
Omitting model inherits the parent's model, which is fine and often correct. When
genuinely unsure between two tiers, take sonnet.
2. Score the request
Answer these before choosing a tier. Each is countable, not a vibe.
| # |
Question |
Escalates if |
| 1 |
Do I know which files change? |
No → at least Tier 2 (recon first) |
| 2 |
How many files? |
1–3 → Tier 0/1 · 4–15 → Tier 1/2 · 15+ → Tier 2/3 |
| 3 |
How many independent dimensions? (repos, domains, review axes) |
3+ → Tier 3 |
| 4 |
Is it reversible? (deploy, delete, force-push, external send, DB write) |
No → risk gate, below |
| 5 |
Would two readings produce different work? |
Yes → ask, don't route |
| 6 |
Does the answer already exist? (memory, docs, an earlier turn) |
Yes → Tier 0, just say it |
Risk overrides size. A one-line change that deploys to production is not Tier 0. Small
and irreversible means: do the work, then stop and confirm before the irreversible step.
Ambiguity is not complexity. Q5 firing means the request is underspecified — more
agents will not fix that. One clarifying question beats a confident fan-out.
3. Pick the tier
Tier 0 — Inline (no agent)
When: the files are known and there are three or fewer, or the answer is recall.
Do: just do it. Read, edit, answer.
This is the default. Most requests stop here.
Tier 1 — One subagent
When: scoped to one domain, the target is known, and the result is independently
verifiable.
Do: one Agent call. Agent by domain (§5), model by §1.
Why bother: it keeps a large read out of the main context. Delegate when the reading
is big, not merely when the writing is.
Tier 2 — Recon or plan, then act
When: you cannot name the files yet, or the change touches shared code where the real
fix is upstream of the reported symptom.
Do: Explore (locate) or Plan (design) → then execute at Tier 0/1 with what came back.
Never skip to Tier 1 here — a subagent that has to find its own target will guess.
Tier 3 — Fan-out
When: three or more genuinely independent dimensions and the user opted in.
Do: parallel Agent calls in a single message, or Workflow if the user asked for one.
Gate: if the dimensions share state or must run in order, it is Tier 2, not Tier 3.
Escalating a tier costs one more call; de-escalating means throwing away finished work.
Start one tier low.
4. Report the decision
State the routing decision in one line before acting, so it is cheap to override:
Tier 1 · security-auditor · sonnet — scoped to one repo, findings are verifiable.
Then act. Do not narrate the scoring.
5. Agent selection
Check the project's .claude/agents/ first — a project-scoped agent knows the repo.
Fall back to user scope. If nothing fits, general-purpose.
| Domain |
Agent |
| Locate code across many files |
Explore |
| Design an approach before building |
Plan |
| Feature spanning DB + API + UI |
fullstack-developer |
| Backend, schema, auth |
backend-designer |
| UI, components, styling |
frontend-designer, frontend-developer |
| API contracts, OpenAPI |
api-designer |
| Tests, characterization |
test-engineer |
| Security sweep |
security-auditor |
| Business case, pricing, prioritization |
business-analyst |
| Reference and API documentation |
technical-writer |
| Breakdown, sequencing, estimates |
project-manager |
| Fits none of the above |
general-purpose |
6. Calibration
These are the reference points. If a routing decision disagrees with the nearest row,
re-check §2 before overriding it.
| Request |
Tier |
Model |
Shape |
| "Fix the typo in the hero headline" |
0 |
— |
Edit it |
| "What port does the SSE server bind?" |
0 |
— |
Recall or one grep |
"Add a --dry-run flag to this script" |
0 |
— |
Known file, do it |
"Find every place we read GEMINI_API_KEY" |
1 |
haiku |
Explore, mechanical |
| "Update the hosting docs for the new subdomain" |
1 |
sonnet |
Docs are Sonnet |
| "Research how Vercel handles cron on the free tier" |
1 |
sonnet |
Basic research is Sonnet |
| "Why is this test flaky?" |
1 |
sonnet |
One agent |
| "Write release notes for the last 10 commits" |
1 |
sonnet |
One agent |
| "Rename this concept across the repo" |
2 |
haiku after recon |
Explore → mechanical edit |
| "Our LCP is 4.2s, fix it" |
2 |
sonnet |
Plan → Tier 1 |
| "Migrate auth from sessions to JWT" |
2 |
opus |
Plan → execute |
| "Audit all 20 repos for leaked secrets" |
3 |
sonnet |
Fan out per repo |
| "Review this PR for bugs, perf, and security" |
3 |
opus |
3 parallel agents |
| "Make the site better" |
— |
— |
Ask. Q5 fired. |
Anti-patterns
- Passing the excluded model tier. Ever, for anything — nothing warns you that you just left your billing plan.
- Sending documentation or research to
haiku because it "looks cheap." Both are
judgment work — they are sonnet.
- Fanning out to look thorough. Three agents on one dimension is one agent plus noise.
- Tier 1 with an unknown target. The subagent will guess at what to change. Recon first.
- Routing an ambiguous request. If two readings give different work, ask one question.
- Treating a small diff as low risk. Reversibility, not line count, sets the risk gate.
- Narrating the scoring. One line, then act.
- Opus for bulk mechanical work. That is what the tiers are for.
1---2name: task-router3description: Decide how much machinery a request deserves before starting it — answer inline, delegate to one subagent, recon-then-plan, or fan out across agents — and pick a model tier to match, so a two-line answer doesn't cost a five-agent workflow. Use when a request's size or blast radius is unclear, before spawning any subagent or workflow, when choosing which model an agent should run on, or when the user asks "how should we approach this", "is this a big job", "what's the best way to tackle this", "route this", "delegate this", "who should do this", or "which model should handle this". Also use when a task spans several repos, domains, or unknown files, and before any multi-agent fan-out to confirm the fan-out is actually warranted. The cost policy is a parameter — set it once and the routing table follows it.4---56# Task Router78Pick the **execution shape** first, the **model** second. Wrong shape is the expensive9mistake — a fan-out for a typo burns tokens and wall-clock; an inline guess at an10architecture change burns an afternoon.1112> **This skill is the authorization to delegate.** The standing rule in this environment13> is *don't use the Agent tool or Workflows unless the user, a CLAUDE.md, or a skill asks14> for it.* This skill asks for it — but only at the tier it selects. Tier 0 still means15> no agent.1617## When to use1819- Before spawning **any** subagent or workflow.20- When you can't yet name the files a request touches.21- When a request spans multiple repos, domains, or review axes.22- When choosing which model to hand a delegated task.23- When the user asks how to approach, size, delegate, or staff a piece of work.2425**Don't use it** for a request whose target and scope are already obvious — that is26Tier 0 by inspection, and routing it is ceremony.2728---2930## 1. Model policy — read this first3132This is a **hard constraint**, not a preference. It comes before any efficiency argument.3334### 🚫 The excluded tier3536Most setups have at least one model tier that is off-limits — it bills outside the plan,37it isn't approved, or it costs more than any task here justifies. **Name that tier38explicitly and never pass it**, because tool APIs accept a model name silently: nothing39warns you that you just left your billing plan. If a task seems to want the excluded40tier, it wants the highest permitted one instead.4142> **Worked example — the setup this skill was written against.** A Claude Max43> subscription where `fable` (Fable 5.1, `claude-fable-5-1`) bills as direct API tokens44> rather than against the subscription, so it is excluded outright. Substitute your own45> excluded tier; the routing logic below doesn't change.4647### The tiers4849Named for Claude models below. On another provider, map the three roles — *mechanical*,50*default*, *hard* — onto the equivalent tiers and keep the table's logic.5152| Model | Use for | Never for |53|:---|:---|:---|54| **`haiku`** (Haiku 4.5) | Purely mechanical, no-judgment passes — grep sweeps, file inventories, mass renames, formatting, link checks | Anything deciding *what* to change |55| **`sonnet`** (Sonnet 5) | **The default.** Documentation updates, basic research and fact-gathering, features, refactors, tests, standard review, release notes | — |56| **`opus`** (Opus 5) | Genuinely complex work — architecture, security audits, root-cause debugging, cross-system migrations, anything where a wrong answer is expensive to *detect* | Bulk mechanical work |57| *the excluded tier* | **Nothing. Ever.** | Everything — see above |5859**Documentation and basic research are `sonnet`, not `haiku`.** They read as cheap but60they are judgment work: what to include, what's stale, what the source actually says.61Haiku is only for passes where the answer is mechanical.6263Omitting `model` inherits the parent's model, which is fine and often correct. When64genuinely unsure between two tiers, take `sonnet`.6566---6768## 2. Score the request6970Answer these before choosing a tier. Each is countable, not a vibe.7172| # | Question | Escalates if |73|:--|:---|:---|74| 1 | **Do I know which files change?** | No → at least Tier 2 (recon first) |75| 2 | **How many files?** | 1–3 → Tier 0/1 · 4–15 → Tier 1/2 · 15+ → Tier 2/3 |76| 3 | **How many independent dimensions?** (repos, domains, review axes) | 3+ → Tier 3 |77| 4 | **Is it reversible?** (deploy, delete, force-push, external send, DB write) | No → risk gate, below |78| 5 | **Would two readings produce different work?** | Yes → **ask, don't route** |79| 6 | **Does the answer already exist?** (memory, docs, an earlier turn) | Yes → Tier 0, just say it |8081**Risk overrides size.** A one-line change that deploys to production is not Tier 0. Small82and irreversible means: do the work, then stop and confirm before the irreversible step.8384**Ambiguity is not complexity.** Q5 firing means the request is underspecified — more85agents will not fix that. One clarifying question beats a confident fan-out.8687---8889## 3. Pick the tier9091### Tier 0 — Inline (no agent)9293**When:** the files are known and there are three or fewer, or the answer is recall.94**Do:** just do it. Read, edit, answer.95**This is the default.** Most requests stop here.9697### Tier 1 — One subagent9899**When:** scoped to one domain, the target is known, and the result is independently100verifiable.101**Do:** one `Agent` call. Agent by domain (§5), model by §1.102**Why bother:** it keeps a large *read* out of the main context. Delegate when the reading103is big, not merely when the writing is.104105### Tier 2 — Recon or plan, then act106107**When:** you cannot name the files yet, or the change touches shared code where the real108fix is upstream of the reported symptom.109**Do:** `Explore` (locate) or `Plan` (design) → then execute at Tier 0/1 with what came back.110**Never skip to Tier 1 here** — a subagent that has to find its own target will guess.111112### Tier 3 — Fan-out113114**When:** three or more genuinely independent dimensions **and** the user opted in.115**Do:** parallel `Agent` calls in a single message, or `Workflow` if the user asked for one.116**Gate:** if the dimensions share state or must run in order, it is Tier 2, not Tier 3.117118**Escalating a tier costs one more call; de-escalating means throwing away finished work.119Start one tier low.**120121---122123## 4. Report the decision124125State the routing decision in **one line** before acting, so it is cheap to override:126127> `Tier 1 · security-auditor · sonnet — scoped to one repo, findings are verifiable.`128129Then act. Do not narrate the scoring.130131---132133## 5. Agent selection134135Check the project's `.claude/agents/` first — a project-scoped agent knows the repo.136Fall back to user scope. If nothing fits, `general-purpose`.137138| Domain | Agent |139|:---|:---|140| Locate code across many files | `Explore` |141| Design an approach before building | `Plan` |142| Feature spanning DB + API + UI | `fullstack-developer` |143| Backend, schema, auth | `backend-designer` |144| UI, components, styling | `frontend-designer`, `frontend-developer` |145| API contracts, OpenAPI | `api-designer` |146| Tests, characterization | `test-engineer` |147| Security sweep | `security-auditor` |148| Business case, pricing, prioritization | `business-analyst` |149| Reference and API documentation | `technical-writer` |150| Breakdown, sequencing, estimates | `project-manager` |151| Fits none of the above | `general-purpose` |152153---154155## 6. Calibration156157These are the reference points. If a routing decision disagrees with the nearest row,158re-check §2 before overriding it.159160| Request | Tier | Model | Shape |161|:---|:---:|:---|:---|162| "Fix the typo in the hero headline" | 0 | — | Edit it |163| "What port does the SSE server bind?" | 0 | — | Recall or one grep |164| "Add a `--dry-run` flag to this script" | 0 | — | Known file, do it |165| "Find every place we read `GEMINI_API_KEY`" | 1 | `haiku` | `Explore`, mechanical |166| "Update the hosting docs for the new subdomain" | 1 | `sonnet` | Docs are Sonnet |167| "Research how Vercel handles cron on the free tier" | 1 | `sonnet` | Basic research is Sonnet |168| "Why is this test flaky?" | 1 | `sonnet` | One agent |169| "Write release notes for the last 10 commits" | 1 | `sonnet` | One agent |170| "Rename this concept across the repo" | 2 | `haiku` after recon | `Explore` → mechanical edit |171| "Our LCP is 4.2s, fix it" | 2 | `sonnet` | `Plan` → Tier 1 |172| "Migrate auth from sessions to JWT" | 2 | `opus` | `Plan` → execute |173| "Audit all 20 repos for leaked secrets" | 3 | `sonnet` | Fan out per repo |174| "Review this PR for bugs, perf, and security" | 3 | `opus` | 3 parallel agents |175| "Make the site better" | — | — | **Ask.** Q5 fired. |176177---178179## Anti-patterns180181- **Passing the excluded model tier.** Ever, for anything — nothing warns you that you just left your billing plan.182- **Sending documentation or research to `haiku`** because it "looks cheap." Both are183 judgment work — they are `sonnet`.184- **Fanning out to look thorough.** Three agents on one dimension is one agent plus noise.185- **Tier 1 with an unknown target.** The subagent will guess at what to change. Recon first.186- **Routing an ambiguous request.** If two readings give different work, ask one question.187- **Treating a small diff as low risk.** Reversibility, not line count, sets the risk gate.188- **Narrating the scoring.** One line, then act.189- **Opus for bulk mechanical work.** That is what the tiers are for.