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-v4-flash"' >> ~/.bashrc
source ~/.bashrc
Now launch:
claude
Claude Code runs on DeepSeek in every new WSL shell.
Step 4: Choose the model
DeepSeek models
| deepseek-v4-flash | Routine coding and faster responses |
|---|---|
| deepseek-v4-pro | Harder reasoning and complex debugging |
Change ANTHROPIC_MODEL in ~/.bashrc, then source the file again. Use deepseek-v4-flash as the routine default and switch to deepseek-v4-pro for difficult work.
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
Verify the setup
After setting the three ANTHROPIC_* variables, run a small task from a repository in your Linux home. Confirm that it reaches DeepSeek before starting a long session. Use deepseek-v4-flash for routine work and deepseek-v4-pro when a task needs more reasoning.
To use DeepSeek with a different agent, see DeepSeek + OpenCode or DeepSeek with Codex CLI.