All notes

Route one Claude Code request to another model

Claude Code hooks can watch a session, but a mod can route one model request elsewhere and change its effort.

You have a model recommender and want Claude Code to use its choice for the next request. A regular hook can watch what Claude Code is doing, but it cannot make that choice take effect.

A hook can watch

I tested this in a spatz (opens in a new tab) hooks spike on 2026-10-04. No settings hook input field sets the model or effort. A hook can observe a session and add a hint. A model-switch hook can only block a switch. (Claude Code hooks (opens in a new tab))

A mod can route a request

Claude Code mods are plugins with JavaScript hooks that run inside Claude Code. The docs describe a different point to act: turn.step fires before each request to the model. A mod can send that request to a different model with next({ ...e, model }). A subagent is a helper Claude Code starts for a task. The request says which helper sent it, and the result reports token counts and the model that answered. (Follow a turn (opens in a new tab))

Think of a session as a row of orders at a counter. A regular hook can watch the orders and leave a note for the person taking them. A mod can redirect one order before it is made. The orders stand for requests to the model. Unlike a counter, a mod runs as part of Claude Code and has the same permissions as you.

That means a recommender such as spatz can route a single request to the model and effort it suggests. The turn.step input has a rewritable effort field as well as model, so the same hook can change both. (Mods reference (opens in a new tab)) Mods need Claude Code v2.1.287 or later and run with your permissions. (Mods overview (opens in a new tab))

A mod can also set a helper's model when the helper starts. There the Agent tool accepts only the short names sonnet, opus, haiku and fable. A rewrite of a single request accepts the full model id.

The spatz mod now routes requests this way. Part 6 of the decision-models series, "Where should a decision model decide?", shows it.

Update (2026-10-07)

I've switched the spatz mod off for now and put the work into hooks. The technique above still holds: a mod can route one request to another model. But a mod runs only in Claude Code, and spatz needs an outcome for each suggestion, from Codex too. When a helper or a session ends, its hook now closes every suggestion of that run that has no outcome yet, in Claude Code and in Codex (spatz pull request #101 (opens in a new tab), merged on 2026-10-07). Part 6, "Where should a decision model decide?", still shows the mod and adds why I went back to hooks.