If you’re routing Claude Code to a cheaper model on a Windows machine, doing it inside WSL is the path of least resistance. You get a normal Linux Node environment, shell scripting that matches every tutorial, and environment variables that behave predictably — none of the PATH and quoting headaches that native Windows sometimes throws at Node CLIs.
This walks through Claude Code Router (CCR) on WSL specifically: getting Node in place, installing the packages, where the config belongs, and the WSL-only details that trip people up. For the tool’s full config reference, see Claude Code Router setup on Windows.
First, make sure WSL itself is installed — our WSL install guide covers the one-command setup.
Get Node in WSL
CCR and Claude Code are Node packages, so you need Node inside the Linux environment (the Windows Node install doesn’t carry over). The cleanest way is nvm:
sudo apt update && sudo apt install -y curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# reopen the shell, then:
nvm install --lts
node -v
Install Claude Code and the router
npm install -g @anthropic-ai/claude-code
npm install -g @musistudio/claude-code-router
Confirm the binary is available:
ccr -v
Configure
The config lives at ~/.claude-code-router/config.json — that’s your Linux home, not /mnt/c. Create it with a basic DeepSeek route:
{
"Providers": [
{
"name": "deepseek",
"api_base_url": "https://api.deepseek.com/chat/completions",
"api_key": "$DEEPSEEK_API_KEY",
"models": ["deepseek-chat", "deepseek-reasoner"],
"transformer": { "use": ["deepseek"] }
}
],
"Router": {
"default": "deepseek,deepseek-chat",
"think": "deepseek,deepseek-reasoner"
}
}
Set the key in your shell profile so it persists:
echo 'export DEEPSEEK_API_KEY="sk-your-key"' >> ~/.bashrc
source ~/.bashrc
Run
ccr code
Use ccr code rather than claude. After editing the config, reload:
ccr restart
CCR commands in WSL
| ccr code | Launch Claude Code through the router |
|---|---|
| ccr restart | Reload after editing config.json |
| ccr ui | Open the web config editor |
| ccr model | Interactive model/provider manager |
WSL-specific gotchas
- Keep the config in your Linux home. Putting
config.jsonunder/mnt/cinvites permission and line-ending problems.~/.claude-code-router/is the right place. - Edit from inside WSL. Use
nano,vim, orcode .(VS Code with the WSL extension). Editing the JSON with a Windows app can introduce CRLF line endings that break parsing. - Work on projects in the Linux file system. Agent work that reads and writes many files is faster in your Linux home than across the
/mnt/cboundary. Copy active repos in for heavy sessions — see access your Windows files from WSL. ccr uiopens a browser. On WSL it should launch your Windows browser automatically; if not, copy the printed127.0.0.1URL into the browser yourself.
Verify it’s working
Start a tiny task and watch which model answers:
ccr code
# then in Claude Code:
# "list the files in this folder and summarize the README"
If it responds and edits files normally, your cheaper backend is live. Switch models any time with /model deepseek,deepseek-reasoner.
WSL CCR checklist
- Node installed inside WSL (nvm)
- claude-code and claude-code-router installed globally
- config.json in ~/.claude-code-router/ (Linux home)
- API key exported in ~/.bashrc
- Launched with ccr code, reloaded with ccr restart
Wrapping up
On Windows, running Claude Code Router inside WSL sidesteps most of the friction: install Node with nvm, add the two npm packages, drop config.json in your Linux home, export your key, and launch with ccr code. Keep the config and your active projects in the Linux file system and the whole thing behaves exactly like the docs assume.
Next, choose a backend — DeepSeek V4 with Claude Code, Qwen3-Coder, or a local model with Ollama.