Claude Code on Windows: native install or WSL, step by step
Claude Code runs on Windows 10 version 1809 or later, either natively or inside WSL. For native Windows, open PowerShell and run irm https://claude.ai/install.ps1 | iex, then start claude in your project. Git for Windows is optional. Choose WSL 2 instead if you want Linux tools or sandboxed command execution, which native Windows does not support. You also need a paid Claude plan or a Console account.
Does Claude Code run on Windows, and which way should you install it?
Yes. According to the Claude Code setup page, Windows 10 version 1809 or later and Windows Server 2019 or later are supported, with 4 GB or more of RAM and a 64-bit processor. You can run it natively or inside WSL (Windows Subsystem for Linux). The docs list three options:
| Option | Needs | Sandboxing | Pick it when |
|---|---|---|---|
| Native Windows | Nothing required; Git for Windows is optional | Not supported | Your projects and tools are Windows-native |
| WSL 2 | WSL 2 enabled | Supported | You use Linux toolchains, or want sandboxed command execution |
| WSL 1 | WSL 1 enabled | Not supported | WSL 2 is not available on your machine |
If you are unsure, start native. It takes one command and no extra setup, and you can add WSL later. If your project is a Next.js, Node or Python app that you would normally run on Linux in production, WSL 2 gives you the same shell and paths as your server. Either way, the editing experience in VS Code or JetBrains works with both; see the VS Code and JetBrains guide.
How do you install Claude Code natively on Windows?
You do not need to run as Administrator. First check which terminal you have, because the command differs. PowerShell shows PS C:\Users\YourName> at the start of each line. CMD shows C:\Users\YourName> without the PS. If you have never used a terminal, press Win + X and pick Windows PowerShell or Terminal.
irm https://claude.ai/install.ps1 | iex
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
winget install Anthropic.ClaudeCode
The install command shows no progress while it downloads, so leave the window open. When it finishes, open a new terminal window and check the install:
claude --version claude doctor
A working install prints a version number. claude doctor prints read-only diagnostics about the install and your settings without starting a session. Then move to your project folder and start Claude Code:
cd C:\Users\YourName\projects\my-app claude
On first run, Claude Code opens your browser so you can sign in. Two update notes from the docs: native installs update themselves in the background, while WinGet installs do not. For WinGet, run winget upgrade Anthropic.ClaudeCode now and then. To update a native install right away, run claude update.
Prefer a graphical app? The Claude Code desktop app lets you use Claude Code without a terminal, and the docs link a Windows download from the terminal guide.
Do you need Git for Windows?
No, but it changes which shell Claude uses. Git for Windows provides Git Bash, which the Bash tool and the Monitor tool need. The docs describe two cases:
- Without Git for Windows, Claude Code runs shell commands through its PowerShell tool.
- With Git for Windows, Claude Code uses Git Bash for the Bash tool. The PowerShell tool is available alongside it, on by default for claude.ai and Console accounts.
If Git is installed but Claude Code cannot find Git Bash, point it at the file in your settings.json:
{
"env": {
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
}
}To find the right path, run where.exe git in PowerShell and use the bin\bash.exe from that Git installation. Claude Code accepts only a file named bash.exe, sh.exe, bash or sh. Git for Windows’ git-bash.exe launcher is ignored.
If you install Git for Windows, choose the “Add to PATH” option during setup and restart your terminal. You do not need to learn Git yourself to use it as the shell backend, though you will want it eventually to save your work; the Claude Code workflow guide shows the commit step.
How do you install Claude Code in WSL?
Open your WSL distribution and run the Linux installer inside it. You install and launch claude in the WSL terminal, not from PowerShell or CMD.
curl -fsSL https://claude.ai/install.sh | bash claude --version cd ~/projects/my-app claude
Git for Windows is not needed in WSL. Check your WSL version from PowerShell with wsl -l -v. Sandboxing needs WSL 2. If you see Sandboxing requires WSL2, your distribution is on WSL 1; convert it with wsl --set-version <DistroName> 2, or run Claude Code without sandboxing.
What are the WSL gotchas?
- Exec format error on WSL 1. If running
claudeprintscannot execute binary file: Exec format error, you are on WSL 1 and hitting a known issue described in the troubleshooting guide. The cleanest fix is converting the distribution to WSL 2. - Login in WSL2 when no browser opens. Press
cat the login prompt to copy the login URL, open it in a browser on Windows, sign in, then paste the code back into the terminal. You can also set theBROWSERenvironment variable to your Windows browser’s path, for exampleexport BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe". - npm installs pick up Windows Node. If you installed with npm inside WSL and see
exec: node: not found, WSL may be using the Windows Node.js. Paths starting with/mnt/c/are Windows binaries. Install Node through your Linux package manager or nvm. The native installer avoids this. - JetBrains IDEs and WSL2. If the JetBrains plugin shows “No available IDEs detected”, WSL2 networking or Windows Firewall is usually blocking the connection. The docs give a firewall rule and a mirrored-networking option (Windows 11 22H2 or later).
For a JetBrains IDE on Windows running Claude Code in WSL, the plugin docs suggest setting the Claude command to wsl -d Ubuntu -- bash -lic "claude", replacing Ubuntu with your distribution’s name.
How do you fix common Windows install errors?
These are the errors Anthropic’s terminal guide and installation troubleshooting page cover most often for Windows.
| What you see | Cause | Fix |
|---|---|---|
irm is not recognized, or The token '&&' is not a valid statement separator | Wrong shell for the command: irm is PowerShell, the && command is CMD | Open PowerShell for the irm command, or CMD for the curl command |
'claude' is not recognized | The install folder is not on your PATH | Add %USERPROFILE%\.local\bin to your user PATH, then open a new terminal |
Claude Code on Windows requires either Git for Windows (for bash) or PowerShell | Neither shell was found | Make sure powershell.exe is on PATH, install PowerShell 7, or install Git for Windows |
Claude Code does not support 32-bit Windows | You opened Windows PowerShell (x86) | Open the entry without “(x86)” and run the installer again |
Could not create SSL/TLS secure channel | Older Windows 10 defaults | Run [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 first, then the installer |
The process cannot access the file … because it is being used by another process | Another install or antivirus scan holds the downloads folder | Close other installers, delete %USERPROFILE%\.claude\downloads, retry |
claude opens the Desktop app instead | An older Claude Desktop registers a Claude.exe that wins on PATH | Update Claude Desktop |
running scripts is disabled on this system (npm installs) | PowerShell execution policy blocks npm’s .ps1 launchers | Use the PowerShell installer, or run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser |
For the PATH fix, the terminal guide gives these two PowerShell lines. Close PowerShell and open a new window afterward:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')If claude goes missing right after an update, check whether %USERPROFILE%\.local\bin still holds claude.exe. On Windows the updater renames the old file to a backup beginning claude.exe.old.; if the swap fails, the docs give a one-line PowerShell command to rename the newest backup back, or you can reinstall with the same irm command.
How does Claude Code run commands in PowerShell?
On Windows without Git Bash, the PowerShell tool is enabled automatically. With Git Bash installed, it is on by default for claude.ai and Console accounts, and you enable it for Amazon Bedrock, Google Cloud’s Agent Platform and Microsoft Foundry sessions with an environment variable. Set it to 0 to turn it off.
{
"env": {
"CLAUDE_CODE_USE_POWERSHELL_TOOL": "1"
}
}A few behaviors worth knowing, all from the tools reference:
- Claude Code starts PowerShell with
-ExecutionPolicy Bypassat process scope only, so.ps1scripts work on a default install without changing your machine’s policy. Group Policy still applies. - A search that finds nothing, or a
git diffthat finds differences, can showError: Exit code 1even though nothing failed. The docs say you do not need to do anything. - On a machine with Git Bash, a deny rule on the Bash tool also turns the PowerShell tool off for that session, because a Bash rule does not restrict PowerShell. Add a matching
PowerShell(...)rule if you want both controlled. - The tool is described as a preview, with limitations listed on the same page.
Is sandboxing available on Windows?
Not natively. The sandboxing page says the sandbox runs on macOS, Linux and WSL2, and that on native Windows Claude Code runs commands unsandboxed. To use the sandbox on a Windows machine, run Claude Code inside a WSL2 distribution. On WSL2 the sandbox needs bubblewrap and socat; /sandbox shows a Dependencies tab if something is missing.
If you let Claude Code run long tasks with few prompts, that matters. Auto mode adds a classifier that reviews risky actions, but it is a separate safeguard from the sandbox. For commands you do not fully trust, WSL2 gives you the extra layer.
Where does Claude Code keep its files on Windows?
- User settings and history:
~/.claudemeans%USERPROFILE%\.claude. To move the home-directory files elsewhere, setCLAUDE_CONFIG_DIR. - The program itself:
%USERPROFILE%\.local\bin\claude.exe. - Organization-wide instructions:
C:\Program Files\ClaudeCode\CLAUDE.mdis the managed-policy location on Windows. - Project instructions:
CLAUDE.mdat the project root, the same as other systems. See how to write a CLAUDE.md.
To remove Claude Code from a native install, delete claude.exe and the version folder under %USERPROFILE%\.local\share\claude. For WinGet, uninstall through WinGet. The docs warn that removing %USERPROFILE%\.claude and .claude.json also deletes your settings, allowed tools, MCP server configuration and session history.
What should you do in your first hour on Windows?
1. Install: irm https://claude.ai/install.ps1 | iex (PowerShell) 2. Open a NEW terminal, run: claude --version 3. cd into a small project that is a git repository 4. Run: claude, sign in through the browser 5. Ask: give me an overview of this codebase 6. Run /init to draft a CLAUDE.md, then trim it 7. Ask for one small change, then run: /diff 8. Run: claude doctor if anything looks off
Once that works, the next stops are the Claude Code tutorial and a first build. If you do not have a project yet, pick a small one from the board’s developer tool ideas; each has a generated build prompt that you can paste straight into your first session.
Frequently asked questions
Does Claude Code work on Windows?
Yes. Claude Code supports Windows 10 version 1809 or later and Windows Server 2019 or later, with 4 GB or more of RAM. You can run it natively from PowerShell or CMD, or inside WSL. Either way you need a paid Claude plan or a Console account, because the free plan does not include Claude Code.
Do I need WSL to run Claude Code on Windows?
No. Native Windows works without WSL, and you do not need Administrator rights. WSL 2 is worth choosing if you use Linux toolchains or want sandboxed command execution, because sandboxing is supported on WSL 2 but not on native Windows. WSL 1 runs Claude Code but does not support sandboxing.
Do I need Git for Windows to use Claude Code?
No, it is optional. Without it, Claude Code runs shell commands through its PowerShell tool. With it, Claude Code uses Git Bash for the Bash tool. If Claude Code cannot find Git Bash, set CLAUDE_CODE_GIT_BASH_PATH in settings.json to the path of bash.exe.
How do I fix “claude is not recognized” on Windows?
The install folder is probably missing from your PATH. Add %USERPROFILE%\.local\bin to your user PATH, using the two PowerShell lines in the official terminal guide, then open a new window. If it started right after an update, check whether claude.exe is missing and restore the newest backup.
Which command installs Claude Code on Windows?
In PowerShell, run irm https://claude.ai/install.ps1 | iex. In CMD, run curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. You can also run winget install Anthropic.ClaudeCode. Mixing them up is the most common error, because irm only works in PowerShell.
How do I update Claude Code on Windows?
Native installs update themselves in the background, and claude update applies an update at once. WinGet installs do not auto-update, so run winget upgrade Anthropic.ClaudeCode from time to time. After updating, claude --version shows the version you are on.
Created with AI assistance and edited for this site. Examples are illustrative and do not represent customer research. About the publisher.