How to Install Claude Code on Windows
Choose native Windows or WSL, install Claude Code with PowerShell, CMD, or WinGet, and fix the first Windows setup issues.
Windows has two good paths: native Windows or WSL. Choose based on where your project actually runs. Do not install in PowerShell and then expect WSL projects to share the same claude binary automatically.
Last checked on May 24, 2026. Windows support changes quickly, especially around shell behavior and sandboxing. Verify the official setup page before rolling this out to a team.
Short Answer
- Use native Windows for Windows-native repositories, PowerShell workflows, or tools that already run on Windows.
- Use WSL 2 for Linux toolchains, shell-heavy projects, or sandboxed command execution.
- Git for Windows is optional but useful because it enables Git Bash for the Bash tool on native Windows.
Native Windows Install
PowerShell:
irm https://claude.ai/install.ps1 | iexCMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdWinGet:
winget install Anthropic.ClaudeCodeThen verify:
claude --version
claude doctorNative Windows vs WSL
| Option | Best for | Sandboxing | Notes |
|---|---|---|---|
| Native Windows | Windows projects, PowerShell, CMD, Git Bash, Windows toolchains. | Not supported in the same way as WSL 2. | Git for Windows is optional, but recommended for Bash-style commands. |
| WSL 2 | Linux projects, Node/Ruby/Python toolchains, sandboxed command execution. | Supported. | Install and launch claude inside WSL, not from Windows PowerShell. |
| WSL 1 | Older environments where WSL 2 is unavailable. | Not supported. | Prefer WSL 2 when possible. |
Common Windows Mistakes
| Symptom | Likely cause | Fix |
|---|---|---|
The token '&&' is not a valid statement separator | You pasted the CMD command into PowerShell. | Use the PowerShell irm command instead. |
'irm' is not recognized | You pasted the PowerShell command into CMD. | Use the CMD curl ... install.cmd command instead. |
claude works in Windows but not WSL | It was installed on the Windows side only. | Open WSL and run the Linux installer there. |
| Bash-related tools fail | Git Bash is missing or Claude cannot find it. | Install Git for Windows or set CLAUDE_CODE_GIT_BASH_PATH. |
| WinGet upgrade fails | Windows may lock the running executable. | Close Claude Code sessions, then run winget upgrade Anthropic.ClaudeCode. |
Recommended First Run
- Open the terminal that matches your project location.
- Run
claude --version. - Run
claude doctor. - Start in a small repository.
- Ask Claude to inspect only, then use Plan Mode before edits.