cost-aware-routing
Skill0 starsChanged 8 months agoMITView on GitHub
Use when deciding which model or agent to use for a task - guides cost-optimized model selection based on task complexity
1 other project uses a version of this.
Adopted by
Most recently taken up by
- socialadsmentor/sam-agentic-harnesstheir own version, first seen Sep 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- socialadsmentor/sam-agentic-harness★ 4same name
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 repository190 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-auditSkill
- accessibility-complianceSkill
- ado-api-cliSkill
- ado-artifactsSkill
- ado-container-deploymentsSkill
- ado-organizationSkill
- ado-pipeline-designSkill
- ado-pipeline-optimizationSkill
- ado-pipeline-securitySkill
- ado-pipelines-opsSkill
- ado-release-managementSkill
- ado-security-policiesSkill
- ado-work-trackingSkill
- adr-writingSkill
- agentic-ai-patternsSkill
- agentic-evalSkill
- agentic-memorySkill
- agentic-reliabilitySkill
- agentic-securitySkill
- ai-data-moatSkill
- ai-harnessSkill
- ai-product-designSkill
- ai-product-monetizationSkill
- ai-product-positioningSkill
- ai-product-retentionSkill
- ai-product-validationSkill
- ai-safety-guardrailsSkill
- add-analytics-instrumentationSkill
- analyze-account-healthSkill
- analyze-ai-topicsSkill
- analyze-chartSkill
- analyze-dashboardSkill
- analyze-experimentSkill
- analyze-feedbackSkill
- compare-user-journeysSkill
- create-chartSkill
- create-dashboardSkill
- daily-briefSkill
- debug-replaySkill
- diagnose-errorsSkill
- diff-intakeSkill
- discover-analytics-patternsSkill
- discover-event-surfacesSkill
- discover-opportunitiesSkill
- instrument-eventsSkill
- investigate-ai-sessionSkill
- monitor-ai-qualitySkill
- monitor-reliabilitySkill
- replay-ux-auditSkill
- review-agent-insightsSkill
- taxonomySkill
- weekly-briefSkill
- what-would-lenny-doSkill
- analytics-reportingSkill
- api-contract-testingSkill
- api-designSkill
- authentication-patternsSkill
- blockchain-auditSkill
- brainstormingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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 10
Not every task needs the most expensive model.
- Distinctive: line 94
Before: ~98% Opus = high cost
- Distinctive: line 95
After: ~10% Opus, ~70% Sonnet, ~20% Haiku = ~75% cost reduction
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Cost-Aware Model Routing
Overview
Not every task needs the most expensive model. Route tasks to the right model based on complexity, saving cost without sacrificing quality.
The Routing Table
| Model | Agent | Cost | Best For |
| Opus | architect | $$$$$ | Complex architecture, novel design, ambiguous requirements |
| Sonnet | debugger, ui-designer, (default) | $$ | Implementation, debugging, most coding tasks |
| Haiku | reviewer | $ | Code review, verification, simple lookups, formatting |
Cost ratios (approximate):
- Opus : Sonnet : Haiku ≈ 25 : 5 : 1
- A Haiku review costs ~1/60th of an Opus review
Decision Framework
WHEN receiving a task:
1. Can Haiku handle this? (review, verify, format, lookup)
→ YES: Use reviewer agent or --model haiku
2. Is this standard implementation/debugging?
→ YES: Use default Sonnet (or debugger/ui-designer agent)
3. Does this require deep reasoning about novel problems?
→ YES: Use architect agent (Opus)Task → Model Mapping
Use Haiku (reviewer agent) for:
- Code review after implementation
- Verification checks (tests pass? linter clean?)
- Simple refactoring (rename, reformat)
- Documentation review
- Checking git status/diff
- Quick lookups in codebase
Use Sonnet (default) for:
- Feature implementation
- Bug fixing and debugging
- Writing tests
- Database migrations
- API development
- UI component building
- Most day-to-day coding
Use Opus (architect agent) for:
- System architecture design
- Complex brainstorming with many trade-offs
- Ambiguous requirements that need deep analysis
- Cross-system integration planning
- Performance optimization strategy
- Security architecture review
Anti-Patterns
| Pattern | Problem | Fix |
| Using Opus for everything | 25x cost for same result | Default to Sonnet |
| Using Opus for code review | Overkill, slow | Use Haiku reviewer |
| Using Haiku for implementation | Too many mistakes | Use Sonnet |
| Not using agents at all | Missing cost savings | Dispatch to right agent |
CLI Shortcuts
# Quick review with Haiku
claude -p "review the last commit" --model haiku
# Debug with Sonnet (default)
claude -p "fix the failing test in auth.py"
# Architecture with Opus
claude -p "design the caching layer" --model opus
# Budget cap
claude --max-budget-usd 0.50 -p "implement the login form"Measuring Impact
Track your usage in Claude Code settings or Vertex AI console:
- Before: ~98% Opus = high cost
- After: ~10% Opus, ~70% Sonnet, ~20% Haiku = ~75% cost reduction
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.

