agentleFS
m2ai-mcp-serversm2ai-mcp-servers/claude-skills/skills/model-router/SKILL.md

model-router

Skill0 starsChanged 7 months agoMITView on GitHub

Classify a task and recommend the optimal model tier (Opus/Sonnet/Haiku) based on reasoning complexity, output length, and cost sensitivity. Produces a routing decision with rationale and estimated cost delta.

17 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 9

    Distinctive

    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
  1. Distinctive:

    Use when the user says "which model should I use", "model router", "route this task", "is this an Opus task", "Haiku or Sonnet for this", …

    line 12
  2. Distinctive:

    If the task involves planning or architecture: always Opus

    line 56
  3. Distinctive:

    If the task is pure formatting/cleanup: always Haiku

    line 57
  4. Distinctive:

    If the task requires long output (>2K tokens) of code: Sonnet minimum

    line 58
  5. Distinctive:

    If the user says "make it good" or similar quality signal: upgrade one tier

    line 59
  6. Distinctive:

    If the user says "quick and dirty" or similar speed signal: downgrade one tier

    line 60
  7. Distinctive:

    Use current pricing (verify via /chub before citing -- do not assume from training data).

    line 81
  8. Distinctive:

    If the user describes a multi-step pipeline, route each step independently:

    line 85
  9. Distinctive:

    If the user is building an agent pipeline (YCE harness, ClaudeClaw, etc.), suggest a routing function pattern matching task types to model …

    line 98

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Model Router

Analyzes a task description and recommends which model tier to use. Prevents the common pattern of using Opus for everything (expensive) or Haiku for everything (quality loss).

Trigger

Use when the user says "which model should I use", "model router", "route this task", "is this an Opus task", "Haiku or Sonnet for this", "model selection", or describes a task and asks about the right model tier.

Phase 1: Task Classification

Analyze the task against these dimensions:

Reasoning Depth

  • Low: Formatting, cleanup, simple transforms, template filling
  • Medium: Standard code generation, bug fixes, content writing, data extraction
  • High: Architecture decisions, multi-step reasoning, novel algorithm design, nuanced analysis

Output Complexity

  • Structured: JSON, YAML, tables, lists -- predictable format
  • Creative: Prose, explanations, design docs -- open-ended
  • Code: Functions, classes, full files -- needs correctness

Context Requirements

  • Minimal (<5K tokens): Self-contained task, no project context needed
  • Moderate (5K-50K): Some files/docs for reference
  • Heavy (50K+): Full codebase context, long documents, multi-file analysis

Error Tolerance

  • High: Draft content, brainstorming, exploration -- mistakes are cheap to fix
  • Medium: Code that will be reviewed, content with editing pass
  • Low: Production code, client deliverables, one-shot outputs

Phase 2: Routing Decision

Apply this decision matrix:

ReasoningOutputError ToleranceRecommended Model
LowStructuredAnyHaiku
LowCreativeHighHaiku
LowCreativeLowSonnet
LowCodeAnySonnet
MediumAnyHighSonnet
MediumAnyMediumSonnet
MediumAnyLowSonnet (with review pass)
HighAnyHighSonnet
HighAnyMediumOpus
HighAnyLowOpus

Override Rules

  • If the task involves planning or architecture: always Opus
  • If the task is pure formatting/cleanup: always Haiku
  • If the task requires long output (>2K tokens) of code: Sonnet minimum
  • If the user says "make it good" or similar quality signal: upgrade one tier
  • If the user says "quick and dirty" or similar speed signal: downgrade one tier

Phase 3: Cost Comparison

Show what each tier would cost for this task (estimate):

Task: [short description]
Estimated input:  ~XXK tokens
Estimated output: ~XXK tokens

| Model  | Input Cost | Output Cost | Total   | Quality |
|--------|-----------|-------------|---------|---------|
| Haiku  | $X.XXX    | $X.XXX      | $X.XXX  | [risk]  |
| Sonnet | $X.XXX    | $X.XXX      | $X.XXX  | [ok]    |
| Opus   | $X.XXX    | $X.XXX      | $X.XXX  | [best]  |

Recommendation: **[Model]** -- [one-line rationale]
Savings vs Opus: $X.XX per call / $X.XX per day at [N] calls

Use current pricing (verify via /chub before citing -- do not assume from training data).

Phase 4: Batch Routing (Optional)

If the user describes a multi-step pipeline, route each step independently:

Pipeline: [name]
Step 1: [task] -> Haiku  ($X.XX/call)
Step 2: [task] -> Sonnet ($X.XX/call)
Step 3: [task] -> Opus   ($X.XX/call)
Total per run: $X.XX
vs all-Opus:   $X.XX (XX% savings)

Phase 5: Agent Harness Integration (Optional)

If the user is building an agent pipeline (YCE harness, ClaudeClaw, etc.), suggest a routing function pattern matching task types to model tiers.

Output Format

Lead with the recommendation. Show the cost table. Keep rationale to one line. Don't over-explain the obvious.

Source Attribution

Technique derived from Nate's Newsletter (2026-04-02): "You're Loading 66,000 Tokens of Plugins Before You Even Type" -- model tier routing as a token cost optimization strategy, formalized into a decision framework.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.