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
- NVIDIA says Nemotron 3 Ultra hit 97.1% on agentic RTL chip-design tasks — NVIDIAAI · 2026-07-27
- Tokyo Agent Forge hackathon shipped production-ready AI agents in one day — DavidBennett__ · 2026-07-27
- Long-running agents will need immutable event logs, this thread argues — sebpaquet · 2026-07-27
- Agentic Data Science in Practice: Agents Write Code but Answer Wrong Questions — hugobowne · 2026-07-27
- A VS Code extension adds Markdown-style highlighting to Alchemy string templates — samgoodwin89 · 2026-07-27
- Claude’s Stripe MCP connector is being called unusable after repeated disconnects — evielync · 2026-07-27