Guide
How to install Claude Code on Windows: PowerShell, CMD, WinGet or WSL
Claude Code runs natively on Windows now. Which install to pick, what Git for Windows changes, and what each Windows error message means.
To install Claude Code on Windows, open PowerShell from the Start menu, without Administrator rights, and run irm https://claude.ai/install.ps1 | iex. When it finishes, open a new window and run claude --version; then run claude in your project folder and sign in with a Claude Pro, Max, Team or Enterprise account. In Command Prompt use curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd, or install with winget install Anthropic.ClaudeCode. Claude Code runs natively on Windows 10 1809 or later; Git for Windows is optional, and inside WSL 2 you install it with the Linux command and get sandboxing too.
Key takeaways
- PowerShell:
irm https://claude.ai/install.ps1 | iex. Your prompt starts withPS C:\in PowerShell. - Command Prompt: the
install.cmdcommand. The prompt isC:\without thePS. - WinGet:
winget install Anthropic.ClaudeCode, updated withwinget upgrade Anthropic.ClaudeCode. - WSL 2: the Linux installer inside your distribution, run and used from the WSL terminal.
- Git for Windows: optional. With it, Claude Code uses Git Bash; without it, PowerShell.
- No Administrator rights needed, and a 64-bit Windows is required.
| Option | How | Updates itself | Sandboxing |
|---|---|---|---|
| PowerShell installer | irm https://claude.ai/install.ps1 | iex | Yes | No |
| Command Prompt installer | curl … install.cmd -o install.cmd && install.cmd && del install.cmd | Yes | No |
| WinGet | winget install Anthropic.ClaudeCode | No; winget upgrade | No |
| npm | npm install -g @anthropic-ai/claude-code | Yes, if npm's folder is writable | No |
| WSL 2 | curl -fsSL https://claude.ai/install.sh | bash, inside WSL | Yes | Yes |
| WSL 1 | The same, inside WSL 1 | Yes | No |
Native Windows or WSL?
Anthropic's comparison (Anthropic):
- Native Windows needs nothing else and suits Windows projects and tools. Sandboxing isn't supported.
- WSL 2 suits Linux toolchains, and it's the only Windows option with Claude Code's sandboxing, which limits what commands can touch.
- WSL 1 works if WSL 2 isn't available, without sandboxing.
If your code and tools already live in WSL, install there. Otherwise native is simpler.
How do you install Claude Code in PowerShell?
- Press the Windows key, type PowerShell, and open Windows PowerShell, not the "(x86)" entry and not as Administrator.
- Run:
irm https://claude.ai/install.ps1 | iex
- The installer shows no progress while it downloads. When it's done, close the window, open a new one, and run
claude --version. It should print a version number. - Go to your project folder (
cd C:\Users\you\projects\my-app) and runclaude.
The installer puts claude.exe in %USERPROFILE%\.local\bin and keeps it up to date by itself. To install the stable channel, about a week behind the newest release, run & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable.
How do you install it from Command Prompt or WinGet?
Command Prompt:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
WinGet:
winget install Anthropic.ClaudeCode
A WinGet install doesn't update itself. Run winget upgrade Anthropic.ClaudeCode now and then, or set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 to have Claude Code run the upgrade for you. If the upgrade fails because Claude Code is open, Windows has the file locked; close it and run the upgrade again.
npm works too (npm install -g @anthropic-ai/claude-code, Node.js 22 or later), but the native installer avoids npm's PowerShell script problems below.
How do you install Claude Code in WSL?
Open your WSL distribution (Ubuntu, for example) and run the Linux installer there:
curl -fsSL https://claude.ai/install.sh | bash
Then run claude from the WSL terminal, not from PowerShell. If you installed with npm inside WSL and see exec: node: not found, WSL is using Windows' Node.js: check with which node, and install Node inside Linux, or switch to the native installer. On WSL 1, an Exec format error is a known problem with the native binary; WSL 2 avoids it.
Do you need Git for Windows?
No, but it helps. With Git for Windows installed, Claude Code runs commands through Git Bash, which most scripts and tutorials assume. Without it, Claude Code uses PowerShell for commands. If Git is installed somewhere unusual and Claude Code can't find Git Bash, point it there in settings.json:
{
"env": {
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
}
}
The error Claude Code on Windows requires either Git for Windows (for bash) or PowerShell means it found neither: add C:\Windows\System32\WindowsPowerShell\v1.0\ to your PATH or install Git for Windows with "Add to PATH" selected.
Why does Windows say 'claude' is not recognized?
The install worked but %USERPROFILE%\.local\bin isn't on your PATH. In PowerShell, check and fix it (Anthropic):
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
The first line should print True. Then close every terminal, and any editor whose terminal you use, and open a new one. In Command Prompt, add %USERPROFILE%\.local\bin to your user PATH through System Settings, Environment Variables. If claude stopped working right after an update, Anthropic's troubleshooting page explains restoring claude.exe from its backup.
Other Windows install errors
'irm' is not recognized: you're in Command Prompt. Open PowerShell, or use the CMD command.The token '&&' is not a valid statement separator: you're in PowerShell and ran the CMD command. Useirm https://claude.ai/install.ps1 | iex.A parameter cannot be found that matches parameter name 'fsSL'or'bash' is not recognized: you ran the Mac and Linux command in PowerShell. Use the PowerShell one.- The command prints script text and installs nothing: you ran
irmwithout| iex. Run the whole line. Claude Code does not support 32-bit Windows: you opened "Windows PowerShell (x86)". Open the entry without "(x86)". If[Environment]::Is64BitOperatingSystemprintsFalse, your Windows is 32-bit and can't run it.running scripts is disabled on this system: an npm install's.ps1launcher is blocked. RunSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, useclaude.cmd, or use the PowerShell installer instead.The process cannot access the file: another install or an antivirus scan holds the download. Close other installer windows, delete%USERPROFILE%\.claude\downloads, and run the installer again.CRYPT_E_NO_REVOCATION_CHECKorSSL/TLS secure channel: a network or certificate problem, common on company networks; Anthropic's troubleshooting page covers the workarounds.- Running
claudeopens the desktop app: an older Claude desktop app registered its ownClaude.exe. Update the desktop app.
Signing in on Windows
Run claude and follow the browser prompt. If pasting the login code into the terminal does nothing, try right-click or Shift+Insert in Windows Terminal, or run claude auth login instead. You need a Pro, Max, Team or Enterprise plan or an Anthropic Console account; what each costs is in Claude Code pricing.
Prefer not to use a terminal?
The Claude desktop app for Windows runs Claude Code in a window, with its Code tab (Claude Code vs Claude desktop). Poly (usepoly.co) runs Claude Code and Codex in the browser, in a shared room where a team works with one agent, with nothing to install. Free to start. What is Poly?
Installing on a Mac or Linux instead: how to install Claude Code. Your first session after installing: how to use Claude Code.
Common questions
How do I install Claude Code on Windows?
Open PowerShell, not as Administrator, and run irm https://claude.ai/install.ps1 | iex. Open a new window, run claude --version to check, then run claude in your project folder and sign in.
Does Claude Code work on Windows without WSL?
Yes. Claude Code runs natively on Windows 10 1809 or later and Windows Server 2019. WSL 2 is optional, and it is the only Windows setup that supports Claude Code's sandboxing.
Do I need Git for Windows for Claude Code?
No. Without it Claude Code runs commands through PowerShell. With it, Claude Code uses Git Bash, which suits Bash-based scripts and tooling.
Why is claude not recognized after installing on Windows?
The install folder, %USERPROFILE%\.local\bin, isn't on your PATH. Add it to your user PATH, then close and reopen every terminal and editor.
Can I install Claude Code with WinGet?
Yes: winget install Anthropic.ClaudeCode. WinGet installs don't update themselves, so run winget upgrade Anthropic.ClaudeCode periodically.