If you’re on Windows, the cleanest way to run Claude Code on DeepSeek is inside WSL. You get a normal Linux shell where Node, environment variables, and Claude Code all behave the way every tutorial assumes — no PowerShell quirks, no PATH surprises. And because DeepSeek offers an Anthropic-compatible endpoint, there’s no proxy to set up; it’s three environment variables.
This is the WSL-specific walkthrough. For the native-Windows version, see run DeepSeek V4 with Claude Code on Windows. If WSL isn’t installed yet, start with the WSL install guide.
Step 1: Node in WSL
Claude Code is a Node package, so install Node inside the Linux environment (nvm is the cleanest):
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
Then Claude Code:
npm install -g @anthropic-ai/claude-code
Step 2: DeepSeek API key
Create an account on the DeepSeek platform, add a little credit, and generate an API key. The rates are low, so a small top-up lasts a long time.
Step 3: Point Claude Code at DeepSeek
Add the three variables to your shell profile so they persist across sessions:
echo 'export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="sk-your-deepseek-key"' >> ~/.bashrc
echo 'export ANTHROPIC_MODEL="deepseek-chat"' >> ~/.bashrc
source ~/.bashrc
Now launch:
claude
Claude Code runs on DeepSeek in every new WSL shell.
Step 4: Choose the model
DeepSeek models
| deepseek-chat | General coding; fastest, cheapest |
|---|---|
| deepseek-reasoner | Thinking mode for tough problems |
Change ANTHROPIC_MODEL in ~/.bashrc and source it again to switch. Keep deepseek-chat as your default and reach for deepseek-reasoner on the hard stuff.
Work in the Linux file system for speed
DeepSeek-backed Claude Code reads and writes a lot of files. That’s faster inside your Linux home than across the /mnt/c boundary. For heavy sessions, copy the project in:
cp -r /mnt/c/Users/YourName/myproject ~/myproject
cd ~/myproject
claude
More on this in access your Windows files from WSL.
Pricing notes
DeepSeek is pay-per-token with no flat coding plan, plus cache-hit discounts and off-peak windows that cut the rate during set hours. Schedule long jobs for the discount window if they’re not urgent. Rates move with promotions and versions, so confirm on the official pricing page — full detail in DeepSeek V4 pricing explained.
Troubleshooting
claude: command not found— Node/npm global bin isn’t on PATH; reopen the shell after installing.- Auth errors — the token variable isn’t loaded;
source ~/.bashrcor open a new shell. - Format errors — switch from
/v1to/anthropic. - Slow file operations — move the project into your Linux home.
WSL DeepSeek checklist
- Node installed in WSL via nvm
- Claude Code installed (npm i -g @anthropic-ai/claude-code)
- Three ANTHROPIC_* vars in ~/.bashrc, then source it
- Using the /anthropic endpoint
- Active project copied into the Linux home for speed
Wrapping up
On Windows, WSL is the smooth path to Claude Code on DeepSeek: install Node with nvm, add Claude Code, and set the three ANTHROPIC_* variables in ~/.bashrc pointing at the /anthropic endpoint. Keep deepseek-chat as default, escalate to deepseek-reasoner when needed, and run heavy jobs from your Linux home during the off-peak window.
To use DeepSeek with a different agent, see DeepSeek + OpenCode or DeepSeek with Codex CLI.