Claude Code on Windows: Install, Git Bash and WSL
Claude Code on Windows: the PowerShell, CMD and WinGet install commands, whether you need Git Bash or WSL, PATH fixes and the errors Windows users hit.
Josh Pocock7 min read
AI Coding
Claude Code Windows
Stride AI Academy
Claude Code runs natively on Windows 10 1809 or later. To install it, open PowerShell and run irm https://claude.ai/install.ps1 | iex, then open a new window and run claude. You don't need Administrator rights or WSL, and Git for Windows is optional: with it, Claude Code uses Git Bash for shell commands, and without it, Claude Code uses PowerShell.
This guide covers the Windows install options, when to pick WSL instead, the Git Bash setting, PATH fixes and the Windows errors in Anthropic's troubleshooting docs. Everything here was checked against Claude Code's advanced setup, installation troubleshooting and troubleshooting docs on November 22, 2026. For the Mac and Linux steps, see our full guide on how to install Claude Code.
Claude Code Windows requirements
The setup docs list these for Windows:
- Windows 10 1809+ or Windows Server 2019+, 64-bit
- 4 GB+ RAM and an x64 or ARM64 processor
- An internet connection and a supported country
- A paid account. Claude Code needs a Pro, Max, Ultra, Team, Enterprise or Console account. The free claude.ai plan doesn't include it. Our Claude Code cost guide compares the options.
You can run it from PowerShell or CMD. Your prompt shows PS C:\ in PowerShell and C:\ without the PS in CMD.
Native Windows, WSL 2 or WSL 1?
The docs give you three ways to run it:
| Option | Needs | Sandboxing | Use it for |
|---|---|---|---|
| Native Windows | Nothing; Git for Windows optional | Not supported | Windows projects and tools |
| WSL 2 | WSL 2 enabled | Supported | Linux toolchains or sandboxed commands |
| WSL 1 | WSL 1 enabled | Not supported | Only if WSL 2 is unavailable |
Pick native Windows unless your project needs Linux tools or you want sandboxed commands. The troubleshooting docs also note that working across file systems in WSL is slower, so keep WSL projects on the Linux side.
How to install Claude Code on Windows
Pick one method. The native installer is the one Anthropic recommends.
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.ClaudeCodenpm, which needs Node.js 22 or later:
npm install -g @anthropic-ai/claude-code@latestThe native installer shows no progress while it downloads. When it finishes, open a new terminal window and check it worked:
claude --versionA working install prints a version number. Then run claude in your project folder and sign in through the browser.
How updates work
The native install updates itself in the background. WinGet doesn't, so run this now and then:
winget upgrade Anthropic.ClaudeCodeThe docs say a WinGet upgrade can fail while Claude Code is running, because Windows locks the executable. Close your sessions first.
Do you need Git Bash?
No. The setup docs call Git for Windows optional and recommended. Here's what changes:
- Without Git for Windows, Claude Code runs shell commands through its PowerShell tool.
- With Git for Windows, Claude Code uses Git Bash for its Bash tool, and the PowerShell tool is still available alongside it for claude.ai and Console accounts.
Git Bash is useful when your project's scripts are written for Bash. Install it from git-scm.com, select "Add to PATH" during setup, then restart your terminal.
Point Claude Code at Git Bash
If Git is installed but Claude Code can't find it, the docs say it looks in C:\Program Files\Git, then C:\Program Files (x86)\Git, then the git on your PATH. If yours is somewhere else, find it:
where.exe gitThen set the path to that installation's bin\bash.exe in your settings.json:
{
"env": {
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
}
}The file must be named bash.exe, sh.exe, bash or sh. The docs say Claude Code ignores the setting if you point it at git-bash.exe, the Git for Windows launcher.
How to install Claude Code in WSL
Open your WSL distribution and run the Linux installer there, not in PowerShell:
curl -fsSL https://claude.ai/install.sh | bashStart claude from the WSL terminal too. WSL setups don't need Git for Windows.
Claude Code WSL errors
cannot execute binary file: Exec format error. You're on WSL 1, which hits a known native-binary issue. The docs' cleanest fix is converting the distribution to WSL 2 from PowerShell:
wsl --set-version <DistroName> 2exec: node: not found after an npm install. WSL is probably using the Windows copy of Node.js. Check:
which npm
which nodePaths starting with /mnt/c/ are Windows binaries. Install Node inside Linux with your package manager or nvm, or switch to the native installer, which doesn't need Node.
Search finds fewer files than expected. The docs say this comes from reading across file systems. Move the project to /home/ rather than /mnt/c/, or run Claude Code natively on Windows.
Fix "claude is not recognized" on Windows
If PowerShell says The term 'claude' is not recognized, first open a new terminal window, because windows that were already open keep their old PATH. If it still fails, check the program is there:
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"If that prints True, add the folder to your user PATH:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')Restart the terminal and run claude --version again. If you use the terminal inside VS Code or another editor, quit and reopen the editor, since it passes its own PATH to the terminal.
If the error started right after an update, the docs describe a case where claude.exe was renamed to a backup and not restored. This PowerShell line renames the newest backup back:
Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exeIf there's no backup file, run the PowerShell installer again.
Other Windows errors and fixes
From the installation troubleshooting docs:
| What you see | Cause | Fix |
|---|---|---|
'irm' is not recognized |
You're in CMD | Use the CMD command, or open PowerShell |
The token '&&' is not a valid statement separator |
You're in PowerShell | Use the PowerShell command |
A parameter cannot be found that matches parameter name 'fsSL' |
You ran the Mac and Linux command in PowerShell | Use the PowerShell command |
running scripts is disabled on this system |
PowerShell's execution policy blocks npm's .ps1 launchers |
Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, or use the native installer |
Claude Code does not support 32-bit Windows |
You opened "Windows PowerShell (x86)" | Open the entry without x86 and retry |
The process cannot access the file ... |
An earlier install or antivirus is holding the download | Delete %USERPROFILE%\.claude\downloads and rerun the installer |
claude opens the desktop app |
An older Claude Desktop registered its own Claude.exe |
Update Claude Desktop |
For the download-folder case, the docs give this:
Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\downloads"
irm https://claude.ai/install.ps1 | iexIf search or @file mentions find nothing, the bundled ripgrep may not run on your system. Install it with winget install BurntSushi.ripgrep.MSVC and set USE_BUILTIN_RIPGREP to 0 in the env block of your settings.
When you're not sure what's wrong, run claude doctor from your shell for a read-only health check, or /doctor inside a session. If Claude Code runs but the VS Code extension shows a crash message, see our guide to Claude Code process exited with code 1, and for the editor setup itself, Claude Code in VS Code.
How to uninstall Claude Code on Windows
For a native install, in PowerShell:
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -ForceFor WinGet, run winget uninstall Anthropic.ClaudeCode. For npm, run npm uninstall -g @anthropic-ai/claude-code. Your settings stay in %USERPROFILE%\.claude and %USERPROFILE%\.claude.json until you delete them.
Learn to build with Claude Code
The Stride AI Coding course teaches Claude Code and Codex for building client tools, written for non-programmers, with weekly live calls to review your builds. Many of the free guides cover Claude Code setups, and the Claude Code community is where members compare theirs.
FAQ
Does Claude Code work on Windows?
Yes. It runs natively on Windows 10 1809 or later and Windows Server 2019 or later, from PowerShell or CMD. It also runs inside WSL 1 or WSL 2.
How do I install Claude Code on Windows?
Open PowerShell and run irm https://claude.ai/install.ps1 | iex. You can also use the CMD installer, winget install Anthropic.ClaudeCode or npm. Open a new window and run claude --version to confirm it worked.
Do I need WSL for Claude Code?
No. Native Windows works without WSL. Choose WSL 2 if your project needs Linux tools or you want sandboxed commands, since sandboxing isn't supported on native Windows.
Do I need Git Bash for Claude Code on Windows?
No. Git for Windows is optional. Without it, Claude Code runs commands through PowerShell. With it, Claude Code uses Git Bash for its Bash tool.
Why does Windows say claude is not recognized?
The install folder, %USERPROFILE%\.local\bin, isn't on your PATH yet. Open a new terminal first. If it still fails, add that folder to your user PATH and restart the terminal.
How do I update Claude Code on Windows?
The native install updates itself in the background, and claude update applies an update straight away. WinGet installs need winget upgrade Anthropic.ClaudeCode.