model-router
A Claude Code plugin that routes each coding subtask to the cheapest Claude model and effort that can do it reliably. It measures what every subagent really costs and learns routing rules from verified runs.
Install (pick one)
1. From the marketplace (recommended, gets updates). At the Claude Code prompt:
/plugin install model-router --marketplace DevstateBelgium/model-router
Answer y to add the marketplace, then pick a scope. Or in two steps:
/plugin marketplace add DevstateBelgium/model-router
/plugin install model-router@model-router
2. Drop-in, zero commands. Clone this repo into ~/.claude/skills/model-router/ (Windows: %USERPROFILE%\.claude\skills\model-router\) and start a new session:
git clone https://github.com/DevstateBelgium/model-router ~/.claude/skills/model-router
Claude Code loads any folder there that has .claude-plugin/plugin.json as a plugin (model-router@skills-dir), including its agents and hooks.
3. Whole team, per repository. Commit this to the project's .claude/settings.json. Teammates get it after they trust the folder:
{
"extraKnownMarketplaces": { "model-router": { "source": { "source": "github", "repo": "DevstateBelgium/model-router" } } },
"enabledPlugins": { "model-router@model-router": true }
}
4. Ask Claude to install it, in any session. Say "install the plugin from https://github.com/DevstateBelgium/model-router". Claude follows INSTALL.md, which runs node scripts/install.mjs --live.
First run
The first time the plugin loads, it starts a short configuration run. In an interactive session the mod queues it automatically; in every other session the SessionStart hook tells Claude to run it on your first message. The run checks Node.js, Claude Code and gh, then asks one question: local-only, connect an existing knowledge repo, or create a new private one. Run it again any time with /model-router:setup.
Cloud sessions
A cloud session starts from a fresh clone of your repository, and Claude Code loads plugins only at session start. There are two ways to get model-router there:
Requirements: a recent Claude Code (tested on 2.1.292). Node.js 18+ on PATH for the hooks and scripts. Without Node.js the skill and agents still work, but automatic telemetry and push/pull are off. gh is needed only for push/pull.
How to use it
Start a task. Ask for the work as you normally would. The skill loads by itself when Claude splits multi-step work across subagents. To force it, start the request with /model-router (or /model-router:run when the mod is not loaded):
/model-router move the date helpers into utils/ and add tests
Ask "which model should do X?" to get a routing suggestion without running anything. Orchestration works best when the main session runs Claude Opus 5.5 at xhigh effort, because the orchestrator does the planning and verification.
Automatic mode. Type /model-router:start once, and every prompt you type after that is routed, without a prefix. The status line starts with auto · while it is on. /model-router:stop turns it off. It lasts for the current session only, so each new session starts with it off. Prompts that start with a slash command are left alone, and /model-router <task> keeps working as a one-off without changing the mode. The first routed prompt loads the skill; later prompts get a short reminder, so the skill text is not repeated every turn. Needs the mod.
What happens during a run. Claude splits the request into tasks, each with the files it may touch and an acceptance check. Each task goes to the cheapest tier that fits: