Route agent work across cheap, mid, and max models with SKILL.md
Cursor or Claude Code loads a SKILL.md that assigns read-only and test tasks to a fast tier, refactors to a mid tier, and merge-gate or architecture work to max — cutting spend without hiding quality gaps.
A model-router SKILL.md checked into the repo, explicit tier rules your team agrees on, and session habits that escalate tier only when the checklist says so.
- 1
Align tiers with billing reality
Name the three models your org allows. Abstract fast/mid/max labels fail if engineers guess wrong in Cursor settings.
- 2
Commit beside other agent policy
Link from AGENTS.md next to secrets and CI skills. Routing rules scattered in Slack do not load in cloud agents.
- 3
Review one week of sessions
Spot-check whether max tier was used for summaries. Tighten the routing table where habits drift.
The prompt to paste
Write SKILL.md that tells agents (and humans driving them) which model tier to use for which task. Goal: lower cost on shallow work without using a max model for grep-and-summarize or a cheap model for risky refactors. Team context: [products: Cursor, Claude Code — which you use] [your tier names: e.g. fast / default / max — map to actual model picks in your org] [repo type: app, infra, monorepo — affects test commands] [merge gates: required CI jobs, human review rules] SKILL.md must include: 1. Purpose — predictable spend and quality: right model for the step, explicit escalation when stuck. 2. When to use — start of any multi-step agent session on this repo. When not to use — single one-line typo fix where tier is obvious. 3. Tier definitions (agent fills with your names, not vendor marketing): - Fast tier: read files, explain code, draft comments, run read-only git/log, small doc edits, enumerate options — no multi-file refactors. - Mid tier: implement bounded features, fix failing unit tests, update types across ≤ N files [set N e.g. 5], routine dependency bumps with skill-assisted review. - Max tier: cross-cutting refactors, security-sensitive changes, migration/rollback design, novel architecture, debugging after two failed mid-tier attempts on same task. 4. Routing table the agent must follow (markdown table): - Task pattern → default tier → escalate when - Examples: "summarize PR diff" → fast; "implement ticket with tests" → mid; "redesign auth flow" → max. 5. Escalation protocol: - Document what was tried at lower tier (commands run, files touched). - Human may override down only with written acceptance of risk in PR. - Never downgrade tier to save tokens on tasks marked Block/Warn in other skills (security, migrations). 6. Session habits: - Open with tier declaration in agent notes: "Tier: fast — scope: read billing module." - Re-evaluate tier after each milestone, not only at start. - Stop and ask human before max tier if estimate exceeds [budget note or timebox]. 7. Cost hygiene without cheating: - Prefer targeted file reads over whole-repo uploads. - Batch test runs; do not re-run full e2e on every typo at max tier. 8. Two example prompts: "explain this module" (fast) vs "refactor payment service with characterization tests" (mid → max if tests red twice). 9. Pitfalls: max tier for exploration, fast tier for SQL migrations, switching models mid-diff without re-reading constraints, hiding failed attempts when escalating. 10. Done means: tier stated at session start, task completed at declared tier or escalation documented, no security/migration work at fast tier. Rules: - Map tiers to models your team actually pays for; use [confirm model name] placeholders if policy is unset. - Do not claim exact dollar savings — describe relative cost only. - Output only SKILL.md markdown.
Cheap models miss subtle type or concurrency bugs. The skill must require mid tier minimum for production code paths and tests green before merge.
Sample case written by Hidden Logic Lab. Not affiliated with Cursor or Claude Code.
More in Coding
Get new cases in your inbox
Weekly notes on new use cases and agent workflows. No product pitches.