Claude Code installs on Windows with one npm command: npm install -g @anthropic-ai/claude-code, then you run claude. The whole setup takes about 15 minutes, and the only real prerequisite is Node.js 18 or newer. That's the short version. The rest of this guide covers the parts that actually trip people up — whether to run it natively or inside WSL2, how to authenticate when you don't have an Anthropic account, and how to fix the PATH and execution-policy errors that show up on a fresh Windows machine.
Claude Code is Anthropic's command-line coding agent. It reads your repo, edits files, runs tests, and opens pull requests from the terminal. It runs natively on Windows now, so you don't strictly need WSL — but the WSL2 experience is noticeably smoother for many developers, and we'll cover both.
What do you need before installing Claude Code on Windows?
Three things:
- Windows 10 or 11. Older versions (Windows 7/8) aren't supported and the CLI usually won't start.
- Node.js 18 or newer (LTS). Claude Code is an npm package, so Node and npm have to be present.
- A way to authenticate — an Anthropic account or subscription, an Anthropic API key, or a Claudexia API key. More on that below.
Why Node 18 specifically? The CLI uses modern runtime features that older Node builds don't have. Installing the current LTS sidesteps a whole category of "it crashes on launch" reports.
Installing Node.js on Windows
Grab the LTS installer from nodejs.org, run it, and accept the defaults. The installer adds Node and npm to your PATH automatically. Open a fresh PowerShell window and check:
node --version
npm --version
You want node --version to print v18.x.x or higher (v20 or v22 LTS are fine). If node isn't recognized, close every terminal window and open a new one — PATH changes don't apply to shells that were already open.
Prefer a version manager? On native Windows, nvm-windows is the common choice. Inside WSL2, use the standard nvm.
Native PowerShell or WSL2 — which should you pick?
Both work. Here's the honest trade-off.
| Native (PowerShell / Terminal) | WSL2 (Ubuntu) | |
|---|---|---|
| Setup effort | Lowest — install Node, install Claude Code | Extra step: enable WSL, install Ubuntu |
| Git / shell tooling | Windows Git, occasional path quirks | Native Linux Git, bash, the usual Unix tools |
| File paths | C:\Users\you\... backslashes | /home/you/... forward slashes |
| Hooks & scripts | Some shell scripts assume bash | bash everywhere, fewer surprises |
| Performance on big repos | Fine for most projects | Fast — keep code inside the Linux filesystem |
| Best for | Quick start, Windows-only stacks | Node/Python/Go projects, anyone used to Linux |
Short answer: if you already live in PowerShell and your project is Windows-native, install natively. If your toolchain expects a Unix environment — most Node, Python, and Go work does — WSL2 will save you headaches. One important rule with WSL2: keep your code inside the Linux filesystem (/home/you/projects), not under /mnt/c/.... Cross-filesystem access is slow and confuses file watchers.
Setting up WSL2 (if you go that route)
In an admin PowerShell:
wsl --install
This enables WSL, installs WSL2, and pulls Ubuntu by default. Reboot when prompted, then launch "Ubuntu" from the Start menu and create your Linux username and password. Inside Ubuntu, install Node via nvm or your package manager, then continue with the npm install below — the command is identical.
How do you install Claude Code with npm?
Same command on both native PowerShell and WSL2:
npm install -g @anthropic-ai/claude-code
The -g flag installs it globally so the claude command is available everywhere. Once it finishes, verify:
claude --version
You should see a version string. If you get a permissions error during install, don't reach for sudo on the global npm directory — that causes more problems than it solves. See the troubleshooting section below for the clean fix.
Skip
npm install -gon Windows? Some users run it inside WSL2 only and never touch native npm. That's perfectly valid — pick one environment and stay consistent so you don't end up with twoclaudebinaries.
First run and authentication
Move into any project folder and start the agent:
cd C:\Users\you\projects\my-app # PowerShell
# or, in WSL2:
cd ~/projects/my-app
claude
On first launch Claude Code asks how you want to authenticate. You have three options.
Option A — Anthropic account or subscription
If you have a Claude Pro or Max subscription, or a Console account, pick the login flow. Claude Code opens a browser, you sign in, and it stores the token. Straightforward — if you can create and keep an Anthropic account. Many developers outside the US can't, because signup checks IP, phone number, and card country all at once.
Option B — Anthropic API key
Have an sk-ant-… key from the Anthropic Console? Set it as an environment variable and Claude Code uses it directly. Billing runs through your Anthropic account.
Option C — Claudexia key (no Anthropic account, no VPN)
This is the route for developers without an Anthropic account or working from Russia. Claudexia is a gateway to Claude that speaks the same Messages API protocol. You get a key in the sk_cdx_… format, point Claude Code at the Claudexia base URL, and everything else works the same — MCP servers, hooks, the lot. No VPN, no Anthropic signup. Payment is pay-per-token from $0.33 per 1M tokens, with SBP, Russian cards, MTS, and crypto accepted.
Pointing Claude Code at Claudexia
Claude Code reads two environment variables: the base URL and an auth credential. Set ANTHROPIC_BASE_URL to the Claudexia endpoint, and supply your key via ANTHROPIC_API_KEY (Claude Code also accepts ANTHROPIC_AUTH_TOKEN for the same purpose). Always confirm the exact variable names against the Claude Code guide before you start.
Get a Claudexia key first
- Sign up at claudexia.tech — email only.
- Top up the balance with SBP, a Russian or international card, MTS, or crypto. No minimum.
- Dashboard → API Keys → create a key. Copy the
sk_cdx_…value.
PowerShell — try it for one session
For a quick test in the current window only:
$env:ANTHROPIC_BASE_URL = "https://api.claudexia.tech"
$env:ANTHROPIC_API_KEY = "sk_cdx_YOUR_KEY"
claude
These vanish when you close the window. Good for testing, not for daily use.
PowerShell — make it persistent
To keep the values across reboots, write them to your user environment:
setx ANTHROPIC_BASE_URL "https://api.claudexia.tech"
setx ANTHROPIC_API_KEY "sk_cdx_YOUR_KEY"
setx persists the variables, but it does not update the current window. Close PowerShell and open a fresh one, then run claude.
WSL2 / Ubuntu
Add the exports to ~/.bashrc (or ~/.zshrc):
export ANTHROPIC_BASE_URL="https://api.claudexia.tech"
export ANTHROPIC_API_KEY="sk_cdx_YOUR_KEY"
Then reload: source ~/.bashrc. Run claude from any repo and the agent talks to Claudexia.
How do you verify Claude Code is working?
Quick checks, in order:
claude --versionprints a build number — the binary is installed and onPATH.- Inside a repo, run
claudeand ask something simple: "list the files in this project." A correct answer means auth and the network path both work. - Ask it to make a tiny change — "add a comment at the top of README.md" — and confirm it edits the file.
If step 2 fails with an auth error, your key or base URL didn't take. Jump to troubleshooting.
Configuring MCP servers on Windows
MCP (Model Context Protocol) servers extend Claude Code with extra tools — filesystem access, web fetch, database connectors, and more. They behave the same whether you authenticate through Anthropic or Claudexia; the gateway is transparent to MCP.
Add a server with the CLI:
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem C:\Users\you\projects
On native Windows, watch the path format — backslashes and spaces in folder names need care. Inside WSL2, use Linux paths (/home/you/projects). List configured servers with claude mcp list. For a deeper walkthrough, see our MCP servers guide.
Common Windows errors and how to fix them
claude is not recognized / node is not recognized. The install directory isn't on PATH, or the terminal predates the install. Open a brand-new PowerShell window first. Still failing? Check $env:PATH (PowerShell) and confirm npm's global bin folder is listed — find it with npm config get prefix.
npm ERR! EACCES / permission denied on global install. Don't sudo the global directory. On native Windows this is rare; if it appears, reinstall Node from the official installer (it sets permissions correctly). In WSL2, point npm's global prefix at your home directory:
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Then reinstall: npm install -g @anthropic-ai/claude-code.
running scripts is disabled on this system (execution policy). PowerShell blocks scripts by default. Allow signed local scripts for your user:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
This is scoped to your account and is the standard, safe setting.
401 Unauthorized / invalid_api_key. The key has a stray space, or an old value is still in the environment. Create a fresh key in the Claudexia dashboard, re-set the variable, and open a new terminal.
getaddrinfo ENOTFOUND api.anthropic.com. ANTHROPIC_BASE_URL didn't apply. Run echo $env:ANTHROPIC_BASE_URL (PowerShell) or echo $ANTHROPIC_BASE_URL (WSL) — it must print https://api.claudexia.tech. If it's empty, you set it with setx but didn't reopen the window.
429 rate_limit_exceeded. Your key's daily cap fired or the balance hit zero. Top up or raise the cap in the dashboard.
Updating and uninstalling Claude Code
Update to the latest release:
npm update -g @anthropic-ai/claude-code
Check what you're running with claude --version afterward. To remove it completely:
npm uninstall -g @anthropic-ai/claude-code
That deletes the binary. Your environment variables stay set — clear them in PowerShell with setx ANTHROPIC_API_KEY "" (then reopen the window), or delete the export lines from ~/.bashrc in WSL.
Where to go next
- New to the tool? Start with our Claude Code setup guide.
- Working from Russia or without an Anthropic account? The Russia setup walkthrough goes deeper on payment and access.
- Deciding between tools? Read Claude Code vs Cursor.
- Connecting the gateway? The Claude Code guide has the canonical config, and the quickstart gets you a key in minutes.
Ready to wire it up? Grab a key and follow the Claude Code guide — you'll have the agent editing your repo before your coffee's cold.
FAQ
Do I need WSL to run Claude Code on Windows? No. It runs natively in PowerShell or Windows Terminal. WSL2 is optional and smoother for Unix-style toolchains, but plenty of people run it natively without issue.
Does Claude Code work without an Anthropic account? Yes — through Claudexia. The gateway issues its own sk_cdx_… keys, so you skip Anthropic signup entirely. No VPN needed, and it's reachable from Russia.
Which Node.js version should I install? The current LTS — version 18 at minimum, 20 or 22 recommended. Anything older risks crashes on launch.
How do I download Claude Code — is there an installer .exe? The supported install path on Windows is npm: npm install -g @anthropic-ai/claude-code. There's no standalone installer to download; npm handles it.
Will MCP servers and hooks work on Windows? Yes. They work natively and inside WSL2, and they behave identically whether you authenticate via Anthropic or Claudexia. Mind the path format on native Windows.
Questions? Reach the team on Telegram or email support@claudexia.tech.