Recipe · Basic · 10 min
Install Claude Code on Windows: native, WSL and common errors
How to install Claude Code on Windows 10 or 11 from PowerShell, CMD or WSL, fix your PATH, log in and solve the most common install errors.
Tested with Claude Code 2.1.316 · reviewed
The problem
Claude Code runs on Windows, but there are three ways to install it (PowerShell, CMD or WSL), and each one uses a different command. If you paste the wrong one, you get errors like 'irm' is not recognized or The token '&&' is not a valid statement separator. If the installer finishes but its folder isn't on your PATH, you get 'claude' is not recognized. This recipe tells you which option to pick, which command to paste and how to fix each error.
How this was checked: the commands and error messages come from the official setup docs and the official install troubleshooting guide, reviewed on 2026-10-31. claude --version and claude doctor were tested on Linux with version 2.1.316. We couldn't test on a real Windows machine: if something doesn't match on yours, follow the official install troubleshooting guide.
The solution
1. Check the requirements
- Windows 10 1809 or later, or Windows Server 2019 or later, 64-bit.
- 4 GB of RAM or more, an x64 or ARM64 processor and an internet connection.
- A Pro, Max, Ultra, Team, Enterprise or Console account. The free claude.ai plan doesn't include Claude Code.
- Being in a country Anthropic supports.
You don't need Node.js or administrator rights.
2. Choose: native Windows or WSL
| Option | What you need | Sandbox | When to use it |
|---|---|---|---|
| Native Windows | Nothing; Git for Windows is optional | No | Windows projects and tools |
| WSL 2 | WSL 2 enabled | Yes | Linux toolchains or sandboxed commands |
| WSL 1 | WSL 1 enabled | No | Only if you can't use WSL 2 |
If in doubt, start with native Windows.
3a. Native Windows: open the right terminal
Search for "PowerShell" in the Start menu and open Windows PowerShell, not the entry ending in (x86). To tell which terminal you're in, look at the start of the line: PS C:\Users\YourName> is PowerShell, and C:\Users\YourName> (no PS) is CMD.
In PowerShell:
irm https://claude.ai/install.ps1 | iex
In CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
The installer shows no progress while it downloads, so wait for it to finish. When it's done, close the terminal and open a new one. The window you installed from keeps the old PATH.
Another option is WinGet. Keep in mind that this install doesn't update itself:
winget install Anthropic.ClaudeCode
3b. WSL: install inside Linux
Open your WSL distribution (for example, Ubuntu) and run the Linux installer inside that terminal, not in PowerShell:
curl -fsSL https://claude.ai/install.sh | bash
In WSL, you install and run claude inside the Linux terminal. You don't need Git for Windows.
4. (Native Windows) Install Git for Windows if you want Bash
Without Git for Windows, Claude Code runs commands with its PowerShell tool. If you install Git for Windows, select "Add to PATH" during setup. Claude Code can then use Git Bash for its Bash tool, which the Monitor tool also needs. If Git is installed in an unusual folder and Claude Code can't find it, set the path in %USERPROFILE%\.claude\settings.json:
{
"env": {
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
}
}
The path must end in bash.exe, sh.exe, bash or sh. If you point it at git-bash.exe, Claude Code doesn't use it. To find where your Git is, run where.exe git in PowerShell.
5. Log in
Open a terminal in your project folder and run:
claude
The browser opens so you can log in. If it doesn't open, press c to copy the login URL and paste it into your browser. On WSL2, if the browser can't get back to localhost, it shows you a code instead: paste it into the terminal where it says Paste code here. If pasting doesn't work, try right-click or Shift+Insert in Windows Terminal, or use claude auth login.
On Windows, credentials are saved in %USERPROFILE%\.claude\.credentials.json.
Check it
In a new terminal:
claude --version
If everything is fine, you'll see the version number. This is the real output on our machine (Linux):
2.1.316 (Claude Code)
For a fuller check, without opening a session:
claude doctor
This is the real output on Linux. On Windows the platform and path change, but the layout is the same:
Claude Code doctor
Running: native (2.1.316)
Commit: cd7ceb459c68
Platform: linux-x64
Path: /home/jahir/.local/share/claude/versions/2.1.316
Config install method: native
Search: OK (bundled)
Auto-updates: enabled
Auto-update channel: latest
Last update attempt: success → 2.1.316 (2026-10-31)
...
No installation issues found.
For a full setup checkup that can also fix issues, run /doctor in a Claude Code session.
If doctor finds a problem, it shows it as a warning and suggests a fix. Inside a session, /doctor runs a broader check and /status shows which account you're logged in with.
Why it works
The native installer downloads a single executable, claude.exe, to %USERPROFILE%\.local\bin. On macOS, Linux and WSL it goes to ~/.local/bin/claude. It doesn't use Node.js or npm, and it updates itself in the background. The installer doesn't change your PATH: if the folder isn't on it, the installer says so under Setup notes: and shows the fix. That causes almost every 'claude' is not recognized. Details in Advanced setup and Troubleshoot installation.
Common mistakes
The fix for each error comes from the official documentation.
| Message you see | Cause | Fix |
|---|---|---|
'irm' is not recognized as an internal or external command | You're in CMD and pasted the PowerShell command | Use the CMD command or open PowerShell |
The token '&&' is not a valid statement separator | You're in PowerShell and pasted the CMD command | Use the PowerShell command |
A parameter cannot be found that matches parameter name 'fsSL' | You pasted the Linux curl command into PowerShell, where curl is a different command | Use the PowerShell command |
'bash' is not recognized as the name of a cmdlet | You pasted the macOS/Linux installer on Windows | Use the PowerShell command |
| The command prints the script text and installs nothing | You ran only irm ... without iex, or curl without -o in CMD | Paste the full command |
'claude' is not recognized | %USERPROFILE%\.local\bin isn't on your PATH | See "Fix your PATH" below |
Claude Code does not support 32-bit Windows | You opened "Windows PowerShell (x86)" | Open "Windows PowerShell" without (x86). If [Environment]::Is64BitOperatingSystem prints False, your Windows is 32-bit and isn't supported |
Failed to download binary: The process cannot access the file ... because it is being used by another process | Another installer is still open, or antivirus is scanning the download | Close the other windows, delete the downloads folder (see below) and retry |
Claude Code on Windows requires either Git for Windows (for bash) or PowerShell | It can't find PowerShell or Git Bash | Add C:\Windows\System32\WindowsPowerShell\v1.0\ to PATH, install PowerShell 7, or install Git for Windows with "Add to PATH" |
The term 'System.Xml.XmlDocument' is not recognized, < was unexpected at this time or curl: (22) The requested URL returned error: 403 | You downloaded a web page instead of the script. This can be caused by your region, a proxy or a temporary outage | Wait a few minutes and retry, or use winget install Anthropic.ClaudeCode |
npm.ps1 cannot be loaded because running scripts is disabled on this system | You installed with npm and PowerShell blocks .ps1 scripts | Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, or better, use the native installer |
cannot execute binary file: Exec format error (in WSL) | You're on WSL1 (issue #38788) | wsl --set-version <DistroName> 2 in PowerShell |
exec: node: not found (in WSL, npm install) | WSL is using the Windows Node.js (paths starting with /mnt/c/) | Install Node.js inside Linux or, better, use the native installer |
Typing claude opens the desktop app | An old version of Claude Desktop registered its own Claude.exe | Update Claude Desktop |
'claude' is not recognized right after an update | The update didn't finish putting claude.exe back in place | Restore the backup (see below) |
API Error: 403 Request not allowed after logging in | Your subscription isn't active, or your Console account lacks the right role | Check claude.ai/settings or ask for the "Claude Code" or "Developer" role |
OAuth error: Invalid code. Please make sure the full code was copied | The code expired or was copied incompletely | Log in again and press c to copy the full URL |
Fix your PATH (PowerShell)
First check that the executable exists:
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
If it prints True, add the folder to your user PATH. This change is permanent:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
Close the terminal, open a new one and run claude --version. If you use the terminal in VS Code or another editor, quit the editor completely and reopen it, because its terminal takes the PATH from the editor. In CMD, add %USERPROFILE%\.local\bin to your user PATH variable from Environment Variables. If Test-Path prints False, there's no native install: go back to step 3a.
Delete the downloads folder and reinstall
Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\downloads"
irm https://claude.ai/install.ps1 | iex
Restore claude.exe after a failed update
Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe
If there's no claude.exe.old.* file, reinstall with irm https://claude.ai/install.ps1 | iex.
FAQ
Is there Claude Code for Windows?
Yes. It runs on 64-bit Windows 10 (1809 or later) and Windows 11, natively from PowerShell or CMD, or inside WSL. If you'd rather not use the terminal, there's also the desktop app.
Should I install it in PowerShell or in WSL?
If your projects and tools are Windows-based, install it natively. If you work with Linux tools or want sandboxed commands, use WSL 2, which is the only Windows option with a sandbox.
Do I need Node.js or npm?
No. The native installer downloads its own executable. npm is still an option, but it causes more trouble on Windows, such as execution policy errors or the Windows Node.js leaking into WSL.
Do I need to be an administrator?
No. The native installer installs into your user folder and doesn't ask for administrator rights.
Can I use Claude Code on the free plan?
No. The free claude.ai plan doesn't include Claude Code. You need Pro, Max, Ultra, Team, Enterprise, a Console account or a provider like Amazon Bedrock.
How do I update it?
The native install updates itself. To update right away, run claude update. If you installed with WinGet, run winget upgrade Anthropic.ClaudeCode.