
claude-router
Claude Code plugin that auto-picks the right model for each turn — micro, low, medium, or high tier — using Jev/Clef routing.
Install with your AI
Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.
Install and set up claude-router (git-clone project) into my current project. Found on https://claudeers.com/claude-router Repo: https://github.com/alexei-led/claude-router Homepage/docs: — Detected install method: git-clone → git clone https://github.com/alexei-led/claude-router Category: plugins. Platforms: cli, api, mobile. Read the repo's README for exact setup and env vars, then install it and wire it into my project. Claudeers Health Verdict: unknown; community-verified: false. Confirm the source before running anything.
git clone https://github.com/alexei-led/claude-router
// compatibility
| Platforms | cli, api, mobile |
|---|---|
| Operating systems | — |
| AI compatibility | claude |
| License | MIT |
| Pricing | open-source |
| Language | JavaScript |
Claude Model Router
A Claude Code Mod that chooses a model and effort for each main-conversation turn, advised by a prompt classifier: Jev, or Cloudflare's Clef and Clef Flash.
The Mod changes only the model and effort in Claude Code's turn hook. Claude Code sends the request, streams the reply, runs tools, and reports usage. The router does not proxy Anthropic traffic or start a local server. Subagent model choices pass through unchanged.
The band above the prompt shows the tier, model, and reason for each turn. /router opens a pane to pin a tier, edit the model and effort of each tier, and tune the policy. See the user guide.
The router needs Claude Code 2.1.289 or newer. Current savings are not measured. The panel shows Claude's reported usage and configured-price scenarios, not a savings total. See the evaluation.
How it works
sequenceDiagram
actor Dev as Developer
participant Code as Claude Code
participant Mod as Router Mod
participant Cls as Classifier
participant API as Anthropic
Dev->>Code: Prompt
Code->>Mod: Main or subagent step
alt Main conversation in Auto
Mod->>Cls: Bounded prompt and dialogue
Cls-->>Mod: Tier advice
Mod-->>Code: Selected model and effort
else Manual or subagent
Mod-->>Code: Original model and effort
end
Code->>API: Native request and tools
API-->>Code: Response stream and usage
Mod-->>Dev: Status band and router pane
The active classifier labels a new logical turn once. Tool continuations keep that choice. A local policy applies vote, context, failure, and cache-cost rules before the Mod changes the next step. Claude Code owns request construction, model credentials, tools, streaming, and the API cost ledger.
| Tier | Default model | Effort |
|---|---|---|
micro | Haiku 4.5 | No effort setting |
low | Sonnet 5.5 | Keeps the session effort |
medium | Opus 5.5 | medium |
high | Opus 5.5 | xhigh |
These are routing defaults. They do not claim equal model quality.
Install
You need Claude Code 2.1.289 or newer and credentials for one classifier: a Jev API key from typesafe.ai, or a Cloudflare API token and account ID for Clef or Clef Flash on Workers AI.
claude plugin marketplace add alexei-led/claude-router
claude plugin install router@alexei-led-claude-router
Start Claude Code on the full baseline model, for example claude --model claude-sonnet-5-5. Run /plugin configure router and save the key. For Clef or Clef Flash, save the Cloudflare token and account ID, then pick the classifier on the pane's Classifier tab. A session on the baseline model starts in Auto; on another model it starts in Manual, and /router auto turns routing on.
Claude Code updates the plugin at startup when auto-update is on for this marketplace. Otherwise run claude plugin marketplace update alexei-led-claude-router, then claude plugin update router@alexei-led-claude-router.
Upgrading from 0.8? Remove the gateway settings that 0.8 /router:setup wrote before the first 1.0 session, or requests go to a gateway that 1.0 no longer starts. Follow the migration steps.
Run from a checkout
Start Claude Code with this directory as a local plugin and the full Sonnet baseline model:
claude --plugin-dir "$PWD" --model claude-sonnet-5-5
In Claude Code, run /plugin configure router and save your classifier key in the sensitive plugin option. The Mod adds its status band and /router pane. No status-line setup or gateway environment variables are needed.
Run /router to open the pane: route status, per-tier controls, tuning, and usage. Run /model to select a model and enter Manual mode, and /router auto to resume. For controls, metrics, tuning, and troubleshooting, see the user guide.
Before a push, run the same checks as CI. npm run validate and npm run test:plugin need the claude CLI: they load the Mod in the Claude Code engine, which refuses some faults that lint and unit tests miss.
npm run check && npm test && npm run validate && npm run test:plugin
Documentation
- User guide: install, use the controls, read the panel, and troubleshoot.
- Configuration: classifiers and keys, the optional profile
router.json, defaults, and migrations. - Architecture: Mod event flow, state, safeguards, and runtime boundaries.
- Native router details: panel semantics, tuning, and accepted limits.
- Evaluation: historical gateway results and the native shadow replay.
- Changelog: user-visible changes by version.
// faq
What is claude-router?
Claude Code plugin that auto-picks the right model for each turn — micro, low, medium, or high tier — using Jev/Clef routing.. It is open-source on GitHub.
Is claude-router free to use?
claude-router is open-source under the MIT license, so it is free to use.
What category does claude-router belong to?
claude-router is listed under plugins in the Claudeers registry of Claude-compatible tools.
// embed badge
[](https://claudeers.com/claude-router)
// retro hit counter
[](https://claudeers.com/claude-router)
// reviews
// guestbook
// related in Claude Plugins
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explainin…
"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/
financial-services — a Claude ecosystem project on GitHub.