model-routing
Skill1 starsChanged 2 months agoMITView on GitHub
Intelligent model selection - routes tasks to Haiku (fast/cheap), Sonnet (balanced), or Opus (complex/strategic) based on task complexity analysis
15 other projects use a version of this.
Adopted by
Most recently taken up by
- aditya-deokar/software-factorytheir own version, first seen Sep 29, 2026
- lucas-Oliveira-01/agentstheir own version, first seen Sep 28, 2026
- nahid-sparktales/agent-dispatchertheir own version, first seen Sep 21, 2026
- verivus-oss/llm-cli-gatewaytheir own version, first seen Sep 3, 2026
- gaganjainse/shesh-skillstheir own version, first seen Aug 15, 2026
- echo-of-machines/fable-advisortheir own version, first seen Aug 7, 2026
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- Archive228/loopkit★ 756same name
- alinaqi/maggy★ 707same name
- fal-ai-community/skills★ 249same name
- nahid-sparktales/agent-dispatcher★ 59same name
- echo-of-machines/fable-advisor★ 26same name
- cobusgreyling/agent-skills★ 18same name
- verivus-oss/llm-cli-gateway★ 17same name
- FaisalAlqarni/sp-ecc★ 9same name
- naman10parikh/agentgrid★ 9same name
- yeaight7/agent-powerups★ 6same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- claude-mdSkill
- claude-sdkSkill
- langgraph-patternsSkill
- openai-agentkitSkill
- mcp-2025-patternsSkill
- mcp-architectureSkill
- mcp-least-privilegeSkill
- agentic-orchestrationSkill
- agent-stop-conditionsSkill
- fail-closed-eval-gateSkill
- run-receiptSkill
- tool-allowlistSkill
- agent-design-reviewSkill
- defuddleSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
4
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
- Distinctive: line 63
When processing a request, apply these rules:
- Distinctive: line 96
When using the Task tool, specify model based on routing:
- Distinctive: line 142
If a haiku-routed task fails or produces poor results:
- Distinctive: line 144
If still failing, escalate to opus
“Common” is measured: kept by at least 6 in 10 of the 14 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.
Files
Model Routing System
You have access to intelligent model routing. Before executing any task, analyze complexity and route to the appropriate model tier.
Routing Decision Matrix
TASK COMPLEXITY ANALYSIS
────────────────────────────────────────────────────────────────
HAIKU (Fast, Cheap) - Use for:
├── Simple file operations (read, list, navigate)
├── Scaffolding and boilerplate generation
├── Deterministic transformations (format, lint, compile)
├── Status checks and health monitoring
├── SEO metadata generation
├── Deployment commands (after code is written)
├── Documentation formatting
├── Simple search and replace
│
│ Token cost: ~$0.25/1M input, $1.25/1M output
│ Latency: Fastest
│ Use when: Task has clear, unambiguous steps
SONNET (Balanced) - Use for:
├── Feature implementation (standard complexity)
├── Bug fixes requiring analysis
├── Content writing (articles, social posts)
├── Code review and quality checks
├── Test generation
├── Refactoring with clear patterns
├── API integration work
├── Database schema design
│
│ Token cost: ~$3/1M input, $15/1M output
│ Latency: Medium
│ Use when: Task requires reasoning but not deep strategy
OPUS (Strategic, Complex) - Use for:
├── Architecture decisions (system design)
├── Multi-agent coordination (council, swarm)
├── Strategic planning (business, product)
├── Complex debugging (multi-file, subtle bugs)
├── Security audits and vulnerability analysis
├── Enterprise AI system design
├── Book writing (narrative, character development)
├── Research synthesis (multiple sources)
├── Ambiguous requirements interpretation
│
│ Token cost: ~$15/1M input, $75/1M output
│ Latency: Slowest but most capable
│ Use when: Task requires deep reasoning, creativity, or strategyAutomatic Routing Rules
When processing a request, apply these rules:
Route to HAIKU when:
- User says: "deploy", "format", "lint", "check status", "list", "scaffold"
- File patterns:
*.config.*,package.json,tsconfig.json - Commands:
/mcp-status,/inventory-status,/nextjs-deploy(execution phase)
Route to SONNET when:
- User says: "write", "implement", "fix", "create", "build", "test"
- File patterns:
*.ts,*.tsx,*.py,*.md(content files) - Commands:
/article-creator,/create-music,/spec,/generate-social
Route to OPUS when:
- User says: "design", "architect", "strategy", "council", "analyze", "research"
- Keywords: "enterprise", "system", "multi-agent", "complex", "strategic"
- Commands:
/architect,/council,/writing-team,/research
Cost Optimization
BEFORE (No routing):
All tasks → Opus → $75/1M output tokens
AFTER (With routing):
Simple tasks (40%) → Haiku → $1.25/1M = $0.50
Medium tasks (45%) → Sonnet → $15/1M = $6.75
Complex tasks (15%) → Opus → $75/1M = $11.25
──────────────────────────────────────────────
TOTAL: $18.50 vs $75 = 75% cost reductionImplementation in Task Tool
When using the Task tool, specify model based on routing:
// Simple task - use haiku
Task({
subagent_type: "Explore",
model: "haiku",
prompt: "List all files in src/"
})
// Medium task - use sonnet (default)
Task({
subagent_type: "code-reviewer",
model: "sonnet",
prompt: "Review this PR for issues"
})
// Complex task - use opus
Task({
subagent_type: "Plan",
model: "opus",
prompt: "Design the architecture for a multi-tenant SaaS platform"
})Command-Level Routing
| Command | Default Model | Rationale |
/orchestrate | sonnet | Router needs reasoning |
/article-creator | sonnet | Content creation |
/create-music | sonnet | Creative work |
/deep-research | sonnet | Research + creation |
/architect | opus | Strategic design |
/council | opus | Multi-perspective |
/research | sonnet | Information synthesis |
/spec | sonnet | Feature planning |
/nextjs-deploy | haiku | Execution |
/mcp-status | haiku | Status check |
/inventory-status | haiku | Status check |
/publish | haiku | Execution |
/polish-content | sonnet | Editing |
/review-content | sonnet | Quality check |
Escalation Pattern
If a haiku-routed task fails or produces poor results:
- Automatically escalate to sonnet
- If still failing, escalate to opus
- Log escalation for learning
haiku (attempt) → fail → sonnet (retry) → fail → opus (final)Model Routing v1.0 - Implementing claude-flow's intelligent routing pattern
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.

