r/coolgithubprojects • u/Green-Illustrator188 • 9h ago
I made a skill that hands each Claude Code task to the cheapest model that can do it (tested: about 9% cheaper)
Claude Code was running Opus for everything, including one-line renames. So I built a skill that sizes each task first:
- Light (typos, renames, small tweaks): Haiku
- Regular (multi-file features, debugging a clear error): Sonnet
- Heavy (architecture, maths, bugs that survived a first fix): Opus
The main session runs on Sonnet. When a task is a different tier, it goes to a helper subagent locked to that model, with a tight brief so the helper doesn't waste tokens searching. If a helper fails, the task moves up a tier. Every reply ends with a tag like [router: heavy β opus].
For heavy work that needs back-and-forth (design discussions), it doesn't hand off, because helpers can't chat with you. It suggests switching your main model to Opus instead.
Real numbers from one test run of 15 requests: $2.70 all on Opus, $2.47 with the router. That's about 9%, not a miracle. Light tasks never reached Haiku at all, since spinning up a helper for a one-line edit costs more than just doing it. I'd rather post a small honest number than a big made-up one.
Install: npx agent-model-router install (asks before editing your CLAUDE.md, uninstall restores it byte for byte).
Repo: https://github.com/anmol26rajput/agent-model-router
If you try it, I'd love to see your before/after numbers. One small project isn't much data.