Claude Code Router: Route Claude Code to Any Model (2026)
Claude Code Router sits between Claude Code and the model provider, letting you route requests to GPT, Gemini, DeepSeek, or a local model.
Claude Code talks to Anthropic's API by default. Claude Code Router sits in between and lets you send those requests somewhere else, GPT, Gemini, DeepSeek, or a model running on your own machine, while keeping the Claude Code interface, skills, and workflow.
Quick Answer: Claude Code Router is a community proxy that intercepts Claude Code's API calls and forwards them to another provider. Install with
npm install -g @musistudio/claude-code-router, configure providers in~/.claude-code-router/config.json, then runccr codeinstead ofclaude. Your SKILL.md skills work unchanged.
Why route to a different model
Three reasons come up repeatedly.
Cost. Claude Code on a Pro plan hits usage limits. Routing routine work to a cheaper model and reserving Claude for hard problems stretches the same budget further.
Privacy. Some codebases can't leave the building. Routing to a local model via Ollama means no code reaches any third-party API.
Model fit. Different models are better at different jobs. Some teams route planning to one model and implementation to another.
Recommended skills
skill-router-2
by Shippers · 5
Automatically detect, load, and stack the perfect skills combo for any user requ…

AI Feature Eval Writer
by PubsProToolkit
Design and write the eval suite for your LLM-powered feature — the metrics that…
Hooks & Settings for Claude Code
by Markus Isaksson · 19
Master Claude Code's settings hierarchy and hook framework to automate workflows…
Installing the router
npm install -g @musistudio/claude-code-router
Then create the config at ~/.claude-code-router/config.json:
{
"Providers": [
{
"name": "openrouter",
"api_base_url": "https://openrouter.ai/api/v1/chat/completions",
"api_key": "sk-or-your-key",
"models": [
"anthropic/claude-sonnet-4.5",
"google/gemini-2.5-pro",
"deepseek/deepseek-chat"
]
}
],
"Router": {
"default": "openrouter,anthropic/claude-sonnet-4.5",
"background": "openrouter,deepseek/deepseek-chat",
"think": "openrouter,google/gemini-2.5-pro"
}
}
Start a session with ccr code rather than claude.
What this config does: routes normal work to Sonnet, background tasks to a cheap model, and extended reasoning to Gemini. The Router block is where the value is, you're assigning models to job types rather than picking one.
Routing to a local model
Point a provider at your Ollama endpoint:
{
"Providers": [
{
"name": "ollama",
"api_base_url": "http://localhost:11434/v1/chat/completions",
"api_key": "not-needed",
"models": ["qwen2.5-coder:14b"]
}
],
"Router": {
"default": "ollama,qwen2.5-coder:14b"
}
}
Pull the model first with ollama pull qwen2.5-coder:14b. Expect 16GB RAM minimum for a 14B model.
What this gets you: a fully local coding agent. No API calls, no per-token cost, no code leaving your machine.
What breaks when you route away from Claude
Be clear about the trade-offs before switching.
Anthropic-specific features degrade or stop working. Plan Mode, Channels, and extended thinking are built around Claude's behaviour and may not translate to another provider.
Tool-calling reliability varies. Claude Code leans heavily on structured tool use. Models with weaker tool-calling will fail at multi-step tasks that Claude handles cleanly.
Smaller local models follow instructions less reliably. A 7B model will miss steps in a long skill that a frontier model follows exactly.
You're running unofficial software in the request path. Anthropic doesn't support this configuration.
Do skills still work
Yes. SKILL.md files are read by Claude Code before the request leaves your machine, so they're already in the prompt by the time the router forwards it. Skills work with any provider.
Quality depends on the model. code-reviewer (764 installs, free) needs a capable model to apply severity ratings well. git-commit-writer (232 installs, free) works fine even on small local models, because writing a commit message from a diff is a simpler task.
Browse skills that work across every agent on Agensi.
Setting it up
- Install the router globally with npm
- Create
~/.claude-code-router/config.jsonwith at least one provider - Set a
defaultroute, then addbackgroundandthinkroutes if you want job-specific models - Start with
ccr code - Test with a small task before trusting it with a refactor
To go fully local, read OpenClaw + Ollama, the Ollama setup is identical.
Keep reading
- Claude Code Best Practices: What Actually Works (2026)
- Claude Code Remote Control: Monitor and Control Your Agent from Anywhere (2026)
- Claude Code Channels: Control Your Agent from Telegram and Discord (2026)
- Claude Code Plan Mode: What It Is and How to Use It (2026)
- The Best AI Development Workflow in 2026