Hoh Chuan’s claude-model-router offers a Jev-router alternative built around Claude Code’s function hooks. Haiku classifies requests, and code routes them to Haiku, Sonnet or Opus.
The plugin runs locally; classification still uses Anthropic’s cloud. The design avoids adding TypeSafe or OpenRouter to this classification path.
Separate deciding from carrying out a decision
The classifier sorts work into three tiers:
- Lookup: retrieving information or doing a mechanical task.
- Execute: implementing work whose target is already settled.
- Decide: choosing a design, investigating an unexplained failure or making an outward-facing decision.
The model receives instructions to escalate when its assignment exceeds its tier. Code prevents downward model escalation within a turn. An unsure verdict preserves a higher previous tier; a failed main-thread classification retains the previous tier or leaves the first turn on its session model.
Those rules handle reported uncertainty and errors. A confident misclassification can still choose the wrong tier.
Include the cost of moving the conversation
Prompt caching lets repeated requests reuse previously processed context. Changing model families can require another cache write, making a cheaper model expensive for a short continuation.
- The implementation keeps a warm main-thread context on its current model when it reaches 50,000 tokens, under its assumed one-hour cache lifetime.
- A warm large Opus context skips classification entirely because the routing guard would keep Opus anyway.
- Explicit model pins override the guard. Smaller contexts use an estimated cost comparison.
- The meter counts classifier overhead and adjusts its Opus baseline for cache writes caused by switching models.
These are implementation rules, verified with offline checks. The displayed difference compares the same tokens at configured prices; it is not measured savings from an equivalent untouched session.
Give delegated work a stopping point
The router can raise a subagent after repeated tool errors, first increasing effort and then moving to a larger model. Code caps that automatic ladder at Opus with medium effort, subject to the parent’s tier. The main conversation can raise a tracked subagent further, within another explicit cap.
Local checks reproduced the ladder and its stopping point. They do not establish that escalation makes the agent’s work correct.
Check the data path and host support
- Pattern-based masking runs before classification. Ordinary confidential prose can still reach the model.
- An optional reviewer is off by default. When enabled, it receives request and answer text without masking.
- Optional output shrinking archives original tool output locally before reducing it. Those originals remain unmasked.
- The README requires early-access function-hook support and reports Windows testing. It warns that unsupported hosts may install the plugin without activating it.
Verification: inspected routing, metering, masking, subagent rules and relevant host hooks; 17 local pure-function checks passed. The Claude Code plugin and live classification were not exercised, and no routing-quality or savings benchmark was reproduced.