harness-model-router
Skill1 starsChanged 3 months agoMITView on GitHub
Use when harness-orchestrator is about to dispatch any task — parallel or serial — as a subagent, to classify each task by complexity, annotate it with the right model tier (haiku/sonnet/opus), and decide which adjacent serial tasks can fold into one dispatch.
In this repository6 other files it gives its agents.
- harness-analyzerSkill
- harness-context-loaderSkill
- harness-learningsSkill
- harness-orchestratorSkill
- harness-verifierSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
Ambiguous → sonnet: Never silently under-allocate.
- Distinctive: line 68
Only haiku-tier tasks are ever foldable.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Harness Model Router
Classify the full task list — parallel and serial alike — by complexity and emit a routing table that maps each task to a model tier. You do this yourself — read each task description and apply the classification procedure below.
When to run
- Called by
harness-orchestratorimmediately after decomposition, for the full task list — parallel and serial alike — before anyAgent()calls are built.
Procedure
1. Receive the full task list
Take the full task list from harness-orchestrator — parallel and serial alike. For each task, you receive its description, whether it's parallel or serial, and whether it was flagged with ambiguous acceptance criteria during decomposition (used by step 4's fold rule).
2. Classify each task
Apply both signals in order. Keywords can only upgrade a tier, never downgrade.
Signal 1 — Task type (primary signal)
| Task type | Tier |
| Read-only / explanation | haiku |
| Trivial mutation (rename, typo, constant, comment) | haiku |
| Simple type/dataclass/constant definition (no branching or algorithmic logic) | haiku |
| Documentation / README (no code logic) | haiku |
| Code generation (component, endpoint, hook, service) | sonnet |
| Standard feature addition | sonnet |
| Cross-cutting reasoning (debug across layers, investigate) | opus |
| Architecture / design / migration | opus |
Signal 2 — Keyword scan (confirms or upgrades)
| Keywords present | Tier signal |
rename, typo, comment, explain, describe, list, show, format | haiku |
implement, generate, update, test, endpoint, component, hook | sonnet |
refactor, debug, design, architect, analyze, migrate, restructure, investigate, across, system-wide | opus |
Note: add, create, write, build were deliberately removed from the sonnet list — they're near-ubiquitous in constructive task descriptions regardless of actual complexity (e.g. "add a dataclass", "write a README"), so they over-tiered trivial tasks. Signal 1's task-type classification now carries that distinction instead.
Tie-breaking rules
- Ambiguous → sonnet. Never silently under-allocate.
- Multiple modules or layers mentioned → minimum sonnet. Upgrade to opus if opus keywords are also present.
- Keywords only upgrade. A haiku-type task with sonnet keywords becomes sonnet. Never the reverse.
3. Apply the configured size floor
harness-orchestrator passes each task's size (S/M, from its decomposition step) alongside the description. If the project's CLAUDE.md config (## Harness configuration, "Model tier floor by task size") sets a floor for that size and it's not "(none)", clamp the tier up to at least the floor — never down. A task Signal 1/2 already classified above the floor keeps its higher tier. Default config has no floor for either size, so this step is a no-op unless a consumer configured one.
4. Fold adjacent serial tasks
For consecutive serial tasks only (parallel tasks are already independent by definition, so they never fold), decide whether adjacent tasks can share one dispatch instead of each getting a fresh one. Apply this to each adjacent pair, in task order:
| Task A tier | Task B tier | Same/adjacent file? | Ambiguous criteria on either? | Result |
| haiku | haiku | yes | no | fold |
| haiku | haiku | no | — | fresh |
| any non-haiku | any | — | — | fresh |
| any | any | — | yes | fresh |
Rules:
- Only haiku-tier tasks are ever foldable. Any sonnet/opus task always gets its own fresh dispatch — it's substantial enough that isolated verification and dedicated grounding are worth the cold-start cost.
- "Adjacent file" means task B reads or modifies a file task A just created or modified, or both touch the same file.
- A task flagged with unclear/ambiguous acceptance criteria during decomposition never folds, regardless of tier — isolate its blast radius so a retry doesn't drag adjacent work with it.
- Batch cap: 3 tasks per fold. A 4th otherwise-foldable task starts a new batch.
- A fold produces one dispatch carrying all folded tasks' descriptions in order, verified as a single combined
harness-verifierpass covering all of them together — it must not become a mini-orchestrator that re-accumulates context.
5. Emit the routing table
Output the table in context (do not write to a file — it is ephemeral per dispatch):
ROUTING TABLE — <run identifier>
[1] "<task description>" → haiku batch: A
[2] "<task description>" → haiku batch: A
[3] "<task description>" → sonnet batch: — (fresh, own dispatch)
[4] "<task description>" → opus batch: — (fresh, own dispatch)A shared batch: letter means those tasks fold into one dispatch; — means the task gets its own fresh instance. The run identifier is a short label (e.g. the batch name or a sequential counter) so multiple routing calls in the same session are distinguishable.
harness-orchestrator reads this table: for batch: — rows it makes one Agent() call per task with model: "<tier>"; for rows sharing a batch letter it makes one Agent() call carrying all of that batch's task descriptions, using that batch's (uniformly haiku) tier.
Model tier reference
| Tier | Model ID | Best for |
| haiku | claude-haiku-4-5-20251001 | Trivial mutations, read-only, explanations |
| sonnet | claude-sonnet-5 | Code generation, standard feature work, tests |
| opus | claude-opus-5 | Architecture, cross-cutting refactors, debugging across layers |
harness-orchestrator passes the tier name ("haiku" / "sonnet" / "opus") as Agent's model parameter, not the model ID column above — the ID column is reference only.
See also
harness-orchestrator— invokes this skill for the full task list before any dispatchsuperpowers:dispatching-parallel-agents— the dispatch mechanism this routing feeds into
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

