Stop Paying Opus Prices for grep: A Claude Code Task Routing Matrix
Short_Regular_7191 · reddit · 2026-07-25
The author shares a task routing strategy used in Claude Code, utilizing a ROUTING.md file to guide the LLM in automatically selecting the appropriate model tier based on task complexity (R1-R9).
Core Mechanism
- Task Classification: Divides dev tasks into 9 levels. R1 is a micro-fix handled by the current session; R2 is codebase recon delegated to a Haiku subagent; R8 covers high-risk ops like DB migrations, strictly requiring a top-tier model (e.g., Opus) and human confirmation.
- Escalation Red Lines: Forces a model tier upgrade after 2 failed attempts or scope surprises, preventing low-tier models from grinding and wasting tokens.
- Context Cost: Notes that if the current session has already loaded relevant context, delegating down to a cheaper model might actually increase costs due to the need to re-read files.
Auto-loaded via CLAUDE.md at session start, this setup turns the model into a dispatcher, effectively controlling API overhead while ensuring code safety.
More from coding & agent
- GPT-6 Astra beats Factorio with enemies in 44 in-game hours at ~$4,500 API cost — liminal_bardo · 2026-09-11
- Investment Analyst Asks How to Build a Claude-Based Diligence Agent Stack — Careless_Tie2286 · 2026-09-11
- Treating agents like 50 First Dates: a 3-layer context system so every conversation doesn't start from zero — evielync · 2026-09-11
- Running the Firefox MCP on Android via Termux, ngrok, and mcp-proxy — Nervous-Strain7544 · 2026-09-11
- SmolVM open-sources persistent computer infrastructure for agents that outlive chat sessions — aniketmaurya · 2026-09-11
- ARRM targets silent economic regressions in AI agents that functional tests miss — Beautiful_Belt_601 · 2026-09-11