Skip to content

Claude Code Router on WSL: Step-by-Step Install

Install Claude Code Router on WSL and route Claude Code to DeepSeek, GLM, Qwen, or Kimi. Node setup, config.json, env vars, and the WSL-specific gotchas to avoid.

MGMCSA Guru Team June 10, 2026 4 min read
A WSL terminal installing Claude Code Router with npm and editing its config on Windows

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.json under /mnt/c invites permission and line-ending problems. ~/.claude-code-router/ is the right place.
  • Edit from inside WSL. Use nano, vim, or code . (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/c boundary. Copy active repos in for heavy sessions — see access your Windows files from WSL.
  • ccr ui opens a browser. On WSL it should launch your Windows browser automatically; if not, copy the printed 127.0.0.1 URL 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.

Frequently asked questions

Why install Claude Code Router in WSL instead of native Windows?

WSL gives you a clean Linux Node environment, standard shell scripting, and straightforward environment variables — all of which make the proxy and its config behave the way the docs assume. It avoids several Windows-specific PATH and shell quirks.

Do I need a separate Node install in WSL?

Yes. WSL has its own Linux file system and toolchain, so install Node inside WSL (via nvm or your distro) rather than relying on the Windows Node. The npm global installs then live in your Linux home.

Where does the config file live in WSL?

At ~/.claude-code-router/config.json inside your Linux home directory — not under /mnt/c. Keep it in the Linux file system so the router and Node read it with the right permissions and speed.

Can I edit the config from Windows?

You can browse to it via \\wsl$ in Explorer, but it's cleaner to edit from within WSL (nano, vim, or code .) to avoid line-ending and permission issues on the JSON file.

Does my project need to be inside WSL too?

It runs faster if it is. You can work on a project under /mnt/c, but file-heavy agent work is quicker in the Linux file system. Copy active projects into your Linux home for the best performance.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.