Claude Code 按任务分模型路由,并用 Jev 处理分叉
9 个任务按读/写/审分给 Haiku、Sonnet、Opus,成本从 $4.34 降到 $1.11;作者称 Jev 在更底层用代码以固定锐度解决「选哪档、重试还是停」的分叉。
THIS IS A PURE F*CKING GOLDMINE Anthropic just shared one of the best tricks for Claude Code. The idea: put a router in front of every task and send each job to the cheapest model that can do it. Haiku 5.5 reads, Sonnet 5.5 writes, Opus 5.5 only reviews. Same 9 tasks, two ways: all-Opus would have cost $4.34. The router run cost $1.11. That's $3.23 kept, 74% never burned. You just launch Claude Code like this: claude --model opus # subagents: haiku, sonnet here's the split: → Haiku 5.5 takes 6 tasks (read, grep, list, tests, logs, lint): 720k tokens for $0.07 → Sonnet 5.5 takes 2 tasks (refactor auth.ts, write 1 test): 210k tokens for $0.42 → Opus 5.5 takes 1 task, reviews the diff and raises 2 flags: 155k tokens for $0.62 → everything comes back to you as summaries only, never raw output the part most people get wrong: they think the choice is just Opus or Haiku. writing code sits in the middle. Haiku can't handle it well and Opus costs too much for it. the auth.ts refactor ran on Sonnet for $0.21. Haiku is 40x cheaper per token than Opus. reading 48 files cost $0.012. running 212 tests cost $0.012. one catch worth knowing: once the prompt passes 100k, Haiku costs 5x its own price, so every lane is kept small on purpose. Opus only where it earns its price. Haiku reads. Sonnet writes. Opus signs off. JEV engineering is the same move one layer down: [X] forks this run (which tier, which agent, retry or stop) resolved in code at [0.XX] sharpness, and only the split ones ever reach Opus the full tree > a router sorts every task: read/grep/list, write/refactor, plan/review, summarize/test/lint > 6 tasks go to Haiku 5.5, each lane kept under 100k > 2 tasks go to Sonnet 5.5 for writing and refactoring > 1 task goes to Opus 5.5: review the diff, flag what's wrong > every agent returns a summary, never raw files or logs > JEV resolves [X] micro-forks in code and escalates only the split ones paste the tree and this prompt into Claude Code ↓ "Rebuild my Claude Code setup around this tree: 1. Run the main session on Opus 5.5 for planning and review only. 2. Add a router that sorts every task by kind before it runs. 3. Read, grep, list, test, lint and summarize go to Haiku 5.5. Write and refactor go to Sonnet 5.5. Plan and review stay on Opus 5.5. 4. Keep each agent under 100k of context and split the work if it goes over. Agents return summaries only. 5. Add one rule to CLAUDE.md: every task runs on the cheapest model that can do it, and Opus only touches review. Route deterministic forks (which tier, agent choice, retries) through JEV. Show me every change as a diff first. No edits until I say go." ↳ http://code.claude.com/docs/en/model-config save it, it'll come in handy.
这条是引用着另一条写的:x.com/mirku21/status/2098836008468992471