Skip to content

How to Run DeepSeek V4 With Claude Code on WSL

Run DeepSeek V4 with Claude Code inside WSL on Windows. Node setup, the Anthropic-compatible endpoint, persistent env vars, model choice, and pricing notes.

MGMCSA Guru Team June 17, 2026 3 min read
A WSL terminal running Claude Code on DeepSeek V4 on Windows

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 ~/.bashrc or open a new shell.
  • Format errors — switch from /v1 to /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.

Frequently asked questions

Why run DeepSeek with Claude Code in WSL?

WSL gives a standard Linux shell where environment variables, Node, and Claude Code behave exactly as the docs assume. On Windows it avoids PATH and quoting quirks, and it's the smoother environment for agent work that touches many files.

Do I need Node installed inside WSL?

Yes. WSL has its own Linux toolchain, so install Node there (via nvm) and run npm install -g @anthropic-ai/claude-code inside WSL. The Windows Node install doesn't carry into the Linux environment.

How do I make the environment variables stick?

Add the export lines to ~/.bashrc (or ~/.zshrc) and run source ~/.bashrc. They'll then be set in every new WSL shell, so claude always routes to DeepSeek until you remove them.

Which DeepSeek model is best for coding?

deepseek-chat for general work — fast and cheapest — and deepseek-reasoner for harder, reasoning-heavy tasks. Set ANTHROPIC_MODEL to switch. Start with chat and escalate only when needed.

Does DeepSeek have a subscription plan?

No, it's pay-per-token only, with cache-hit discounts and periodic off-peak discount windows. There's no flat coding plan, so cost scales with usage. Confirm current rates on DeepSeek's official pricing page.

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.