Jev Router picks a Claude Code or Codex model for every turn, using the Jev decision model to score the prompt
Jev Router is an npm package that routes each fresh turn in Claude Code or OpenAI Codex to a fast, balanced or strong model tier, using the Jev decision model to score the prompt once per turn.
Image: GitHub
Why it mattersA per-turn router that leaves the CLI, login and session untouched lets a team cut Claude Code and Codex spend on simple prompts without the risk of a wrapper that silently swaps the model you asked for.
A rename and a hard architecture question both cost the same Opus usage inside Claude Code, and the usage cap arrives earlier because of it. Jev Router is an npm package by GitHub user gargpratyush that watches each fresh turn in Claude Code or OpenAI Codex, asks the Jev decision model from TypeSafe to score it, and sends the simple ones to the fast tier and the difficult ones to the strong tier. The repository at github.com/gargpratyush/jev-router has 534 stars gained in the 30 days since it was created on 16 September 2026, and the licence is MIT.
The install is one command, npm install -g jev-router, after which jev-claude launches the real Claude Code with Jev Router selected in /model, and jev-codex launches the real Codex with a temporary Jev Router provider. Both commands forward every CLI argument through, and no Anthropic or OpenAI API key is required when the matching CLI is already logged in with a subscription. The only key needed is a JEV_API_KEY from TypeSafe.
How the routing works
Each command starts a loopback proxy, launches the upstream CLI, and forwards the CLI's existing authorization headers without reading, storing or modifying them. One Jev call per fresh user turn picks one of four shared tiers:
| Tier | Claude Code default | Codex default |
|---|---|---|
| Fast | Haiku | gpt-5.6-luna |
| Balanced | Sonnet | gpt-5.6-terra |
| Strong | Opus | gpt-5.6-sol |
| Long | Fable | gpt-6-astra |
The README states six policy rules that live in src/policy.mjs: an explicit request such as use opus or use luna wins; a failure, timeout or unrecognised Jev answer keeps the current model; low confidence never downgrades and caps upgrades at the balanced tier; a large conversation refuses a downgrade that would waste more prompt-cache work than it saves; an unavailable tier steps up rather than silently picking a weaker model; and the long tier stays off unless JEV_ALLOW_FABLE=1. Tool-loop continuations keep the tier chosen at the start of the turn, main conversations and sub-agents are pinned separately, and if Jev is unreachable, the CLI keeps running on the current model instead of stopping.
What it does to the interface
In Claude Code, an injected status line shows the model the last turn used, with the active tier, context percentage and project name on one line. A custom statusLine set by the user is preserved, and JEV_NO_STATUSLINE=1 turns the injected line off. Selecting a concrete model from /model pauses routing, and selecting Jev Router resumes it; jev-claude restores the previous default on exit, so a plain claude session is unaffected afterwards. In Codex, each fresh decision appears as commentary like [Jev] routed this turn to gpt-5.6-sol (jev, confidence 0.91).
A bundled /jev-explain skill prints the Jev request and response for the last turn locally, with the four scores the model returned (task complexity, reasoning required, tool complexity and context size), its recommended tier and the final selected tier. The exchanges live in a temporary directory under the operating system's temp folder, written with directory mode 700 and file mode 600, and are deleted automatically after seven days.
Three limits the README states
The user's prompt text is the only data sent to TypeSafe for the routing decision. Jev adds latency only to the first request of a turn, and tool-loop continuations add none. Claude Code and Codex request formats can change at any time, so a JEV_DUMP environment variable is provided to show the exact request bodies and spot upstream changes, and development and testing is documented on Windows against Claude Code v2.1.101 and OpenAI Codex v0.154.0. The compatibility notes also flag Haiku dropping adaptive thinking fields before forwarding and Codex's ChatGPT backend streaming SSE without a Content-Type header.
The CLI, the login, the tools, /compact, /resume and permission prompts all keep working through the proxy. A routing failure never silently moves you to a cheaper model you did not pick, because an unreachable Jev keeps the current model.
Source
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.