Claw field notebook
last updated 2026-05-14 edit on GitHub colophon
Anthropic / Claude Code / CC.3 · 3 min read

Install Claude Code on Windows

Three install paths for Windows — winget (recommended), PowerShell installer, and WSL2 + native Linux script. Plus the Git for Windows requirement and PowerShell-vs-CMD trap.

What you’ll have at the end#

A claude binary you can run from PowerShell, CMD, or a WSL2 shell, signed in and ready. About 15 minutes including the Git for Windows side-quest if you don’t already have it.

Before you start#

  • Windows 10 build 1809 or later, Windows 11, or Windows Server 2019+ (x64 or ARM64).
  • A Claude subscription, API key, or Bedrock/Vertex access.
  • Git for Windows — strongly recommended on native Windows so Claude Code can use the Bash tool. Without it, Claude falls back to PowerShell as the shell, which works for simple commands but breaks scripts written for bash. Download from git-scm.com/downloads/win. WSL2 setups don’t need it (you’ve got bash already).

PowerShell or CMD, run:

winget install Anthropic.ClaudeCode

This installs the latest stable build and registers claude.exe on your PATH. Open a fresh PowerShell window (PATH refresh) and:

claude --version

You should see a version number. If claude is not recognised, restart PowerShell or sign out and in again.

Option B — PowerShell installer script#

For machines where winget isn’t available (corporate-managed boxes, older Windows builds):

irm https://claude.ai/install.ps1 | iex

⚠️ The PowerShell vs CMD trap. This command only works in PowerShell. If you paste it into CMD, you’ll get “‘irm’ is not recognized as an internal or external command.” Look at your prompt — PS C:\ is PowerShell, plain C:\ is CMD.

The CMD equivalent uses a different command:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

If you see “The token ’&&’ is not a valid statement separator,” you ran the CMD line in PowerShell. Switch to a CMD window and retry.

If you already use WSL2 for development, install Claude Code inside WSL — the experience is closer to macOS/Linux because the shell is bash, not PowerShell.

In a WSL2 Ubuntu/Debian shell:

curl -fsSL https://claude.ai/install.sh | bash

The CLI is now installed inside the WSL distro. Run claude from any WSL directory. Note that the binary is WSL-local — you can’t run it from PowerShell. If you want both, install both (winget on the Windows side + script in WSL).

Why WSL2 if both work? Anthropic’s docs note that the native Windows path “has more rough edges.” Some tools Claude calls (grep, sed, awk, git in interactive mode) work better in bash. If your day-to-day shell is already WSL2, stick with it.

First run#

Same as macOS. From any project directory:

cd C:\code\your-project
claude

You’ll be prompted to log in. Three auth paths — covered in §CC.4 Auth + API key.

Where files land#

File / dirLocation (native Windows)Location (WSL2)
Binary%USERPROFILE%\.local\bin\claude.exe~/.local/bin/claude
Personal config%USERPROFILE%\.claude\settings.json~/.claude/settings.json
OAuth + user-scope MCP%USERPROFILE%\.claude.json~/.claude.json
Credentials%USERPROFILE%\.claude\.credentials.json (note the leading dot on the filename)~/.claude/.credentials.json (Linux uses the same path)
Project config<project>\CLAUDE.md + <project>\.claude\ + <project>\.mcp.json<project>/CLAUDE.md + <project>/.claude/ + <project>/.mcp.json

The native-Windows and WSL2 installs maintain separate config directories. Settings, credentials, MCP server lists — none of it crosses between them. If you log in once in WSL and once on the Windows side, you’re authenticating twice.

Upgrading later#

# winget
winget upgrade Anthropic.ClaudeCode

# Native installer / PowerShell script
claude update
# WSL2
claude update

Common pitfalls#

SymptomLikely causeFix
'irm' is not recognizedRan the PowerShell line in CMDSwitch to PowerShell, retry
The token '&&' is not a valid statement separatorRan the CMD line in PowerShellSwitch to CMD, retry
Bash tool not availableGit for Windows not installedInstall Git for Windows, restart Claude
claude only sees half your filesPath with non-ASCII chars in project directoryMove project to ASCII-only path, OR use WSL2
Long commands time outWindows Defender real-time scan on the repoAdd .git/ and node_modules/ to Defender exclusions
Permission denied on %USERPROFILE%\.claude\credentials.jsonOneDrive Known Folder Move is syncing your profileMove the credentials path with claude config set credentialsPath ... OR pause OneDrive

What to do next#

Sources