Choosing Claude Code Models with Jev: Recommendation Hooks vs. Automatic Routing
In one Claude Code session, you might check a README for typos and then investigate a failure that spans several modules. Sonnet is a starting point for routine work with a narrow scope. Opus is worth considering when you need to compare competing hypotheses or reason through the consequences of a change. Those are starting rules, not benchmark results.
The Jev skill selection guide picks which task instructions to load. Here the question is which model should receive a request in the same session. A hook that recommends a model and leaves the decision to you is different from automatic routing that changes the model for an individual request.
Jev picks a candidate and the hook controls submission
Section titled “Jev picks a candidate and the hook controls submission”Give TypeSafe Choice an input and descriptions of the options, and it returns a selection and probabilities for those options. In this example, the criteria distinguish routine work for Sonnet from more complex analysis for Opus. A probability is the classifier’s estimate, not the chance that the recommended model will succeed at the task. Jev does not change the Claude Code model itself.
The UserPromptSubmit command hook runs before Claude processes a prompt. It classifies only in allowed projects and returns decision: "block" when the selected candidate meets the threshold and differs from the current model. You can switch manually with /model and resubmit, or resend the exact blocked input without switching. The second option bypasses that block only once in the same session. The hook implements that exception; it is not a built-in Claude Code retry behavior.

Diagram by noisonnoiton. It illustrates the decision flow, not a transcript of the observed interaction.
What the UI showed: resending without switching
Section titled “What the UI showed: resending without switching”“Check this sample README sentence for typos only” is a fictional input. If it receives a Sonnet recommendation in an Opus session, the mismatch notice lets you decide what to do next. Neither this sentence nor the threshold is taken from a measured log.
What the user saw was a submission blocked with a Sonnet recommendation. Resending the identical input without changing the model let it through on Opus. Seeing a recommendation was not the same as seeing a model switch.
Use model switch events, not the last reply
Section titled “Use model switch events, not the last reply”The last model reply tells you what handled a previous request. Right after /model, the new model may not have replied yet. A hook that reads only the last reply can mistake the old model for the current one.
The design records the session model at SessionStart and updates it with the new model at PostModelSwitch. The comparison uses that session’s own state. Once the switch is recorded, a fresh classification that agrees with the current model gives the hook no reason to block. If the current model is not known yet, the hook is better off not blocking based on a guess.
| Condition | Result in a simulation with fictional inputs |
|---|---|
| Same request resubmitted after the switch event was recorded | Passes when the recommendation matches the current model |
| Recommendation probability below the threshold | Passes on the current model |
| Classification error | Passes on the current model |
| Outside an allowed folder | Passes without calling the external classifier |
Automatic routing changes an individual model request
Section titled “Automatic routing changes an individual model request”The documented output of an ordinary UserPromptSubmit command hook has no model field. The official Claude Code Mods turn.step event fires just before an individual model request. A mod can change the event’s model before passing it to the next handler. That is not the same as using /model to change the session default. A single user turn can make several model requests when Claude calls tools and reasons over the results. Reusing the same decision across the turn requires deciding which of those requests it applies to.
| Public example | Difference documented by the project |
|---|---|
| phoem/jev-router | Report mode shows a recommendation; Apply mode uses it for the model request. |
| moelahmady/jev-model-router | It favors changing reasoning effort over changing models. Its documented policy restricts model switches in long sessions even when model routing is enabled. |
| Pulumi’s local proxy example | Claude Code sends requests to a local proxy, which forwards Claude requests according to the classification. The proxy is local; Jev classification is not. |
Account for cost and external data separately
Section titled “Account for cost and external data separately”Classification is billed according to TypeSafe’s pricing, independently of Claude requests. According to the Claude Code caching documentation, each model has its own cache. If there is no matching cache on the destination model, a long conversation prefix has to be processed and cached again. The classifier’s price alone does not tell you whether routing saves money. Compare recommendation accuracy, rework after a bad choice, classification latency, and cache reads and writes by model.
TypeSafe is an external API. Enable it only in personal projects where you have allowed that transfer, and check scope before classifying. Send only the input needed for the decision, without attaching history or files. An allowed folder does not make every prompt in it safe to share. Do not submit sensitive content or record API keys or prompt bodies in hook logs. Passing through when classification fails keeps the recommendation feature from blocking work; it does not enforce a security policy.
Evidence and limits
Section titled “Evidence and limits”The UI observation covers a blocked prompt that passed on Opus when resubmitted unchanged. Passing after a model switch and the other exception paths were simulated with fictional inputs and classifier responses. The comparison of Mods and external implementations comes from public documentation; those implementations were not installed or run. Actual recommendation accuracy, latency, and savings were not measured.