On Windows, the smoothest way to run Claude Code is inside WSL. It’s a Node tool built around a Unix-like shell, so WSL gives it the environment it expects — predictable variables, clean paths, and proxies that behave. This guide gets Claude Code installed and running in WSL, including pointing it at a cheaper model, with the WSL-specific details that trip people up.
If WSL isn’t installed yet, start with the WSL install guide.
Step 1: Node in WSL
Claude Code is an npm package, so install Node inside the Linux environment. nvm is the cleanest way:
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
Step 2: Install Claude Code
npm install -g @anthropic-ai/claude-code
claude --version
Step 3: Run it (with Anthropic or a cheap model)
With an Anthropic account, just run claude and sign in. To run on a cheaper model, set the endpoint variables in your shell profile so they persist:
echo 'export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="sk-your-key"' >> ~/.bashrc
echo 'export ANTHROPIC_MODEL="deepseek-chat"' >> ~/.bashrc
source ~/.bashrc
claude
This points Claude Code at DeepSeek; swap the URL/model for GLM or Kimi. For OpenAI-only providers, use Claude Code Router.
Step 4: Work in the Linux file system
Claude Code reads and writes a lot of files; that’s faster in your Linux home than across /mnt/c. For heavy sessions, copy the project in:
cp -r /mnt/c/Users/YourName/myproject ~/myproject
cd ~/myproject
claude
More on the file bridge in access your Windows files from WSL.
Claude Code in WSL essentials
| nvm install --lts | Get Node inside WSL |
|---|---|
| npm i -g @anthropic-ai/claude-code | Install Claude Code |
| ANTHROPIC_BASE_URL in ~/.bashrc | Point at a cheap model (optional) |
| cp project into ~ | Speed up file-heavy work |
| claude | Launch the agent |
WSL gotchas
- Global binaries missing — reopen the shell after the npm install so PATH updates.
- Variables don’t stick — add them to
~/.bashrcandsourceit; setting them inline only lasts the session. - Slow on big repos — move the project into your Linux home.
- Browser auth — sign-in flows open your Windows browser from WSL; if not, copy the URL across.
Claude Code on WSL checklist
- WSL installed; Node via nvm inside WSL
- Claude Code installed globally with npm
- Optional: cheap-model env vars in ~/.bashrc
- Active project copied into Linux home
- Launched with claude and tested
Wrapping up
Running Claude Code on Windows is cleanest in WSL: install Node with nvm, add Claude Code via npm, and optionally point it at a cheap model with ANTHROPIC_* variables in ~/.bashrc. Keep active projects in your Linux home for speed, and reopen the shell after installs so the binary is on PATH.
From here, connect a backend — DeepSeek, GLM, or via Claude Code Router on WSL.