How to Install Claude Code on Windows (Native & WSL2)
Anthropic has deprecated npm install for Claude Code in favor of standalone native installers—yet native Windows lacks OS command sandboxing. Here is when to choose PowerShell vs. WSL2, exact setup commands, and fixes for PATH and Git Bash errors.

THE STORY IN THREE POINTS
- Skip npm install -g @anthropic-ai/claude-code: Anthropic officially deprecated the npm method and recommends standalone native installers—irm https://claude.ai/install.ps1 | iex in PowerShell or winget install Anthropic.ClaudeCode—with zero Node.js dependency.
- Choose Native Windows vs. WSL2 by sandboxing and toolchain needs: native Windows runs faster to start with Git for Windows (or PowerShell fallback) but does NOT support OS-level command sandboxing; WSL2 enables OS sandboxing via bubblewrap and socat for Linux-native workflows.
- Most Windows setup failures trace back to three traps: pasting CMD && commands into PowerShell, not opening a new shell after updating %USERPROFILE%\.local\bin in PATH, or missing CLAUDE_CODE_GIT_BASH_PATH—all surfaced immediately by running claude doctor.
Native PowerShell vs. WSL2: choose your Windows runtime first
Before installing anything, decide whether your repositories belong in native Windows or inside Windows Subsystem for Linux (WSL 2). According to Anthropic’s official Claude Code setup documentation and Gradually AI’s November 4 Windows guide, native Windows requires no Node.js runtime or Linux VM and suits Windows-native projects, using Git for Windows for Bash tooling (or falling back to PowerShell when Git is absent).
However, Claude Code’s sandboxing specification notes a decisive security distinction: OS-level command sandboxing is not supported on native Windows or WSL 1. Teams requiring filesystem and network isolation around autonomous shell commands—or repositories built around Linux Docker, Python, or Rust toolchains—should install Claude Code inside WSL 2 instead.
How to install Claude Code natively on Windows (no Node.js required)
Outdated tutorials still recommend installing Node.js 22+ and running npm install -g @anthropic-ai/claude-code, a path OpenAgents’ installation guide and Anthropic docs mark as deprecated because global npm trees trigger version clashes and permission errors. Instead, install Claude Code’s standalone native binary from an ordinary PowerShell prompt (no administrator elevation required) with irm https://claude.ai/install.ps1 | iex. If you use classic Command Prompt (C:\ without PS), run curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd.
Windows Package Manager users can alternatively run winget install Anthropic.ClaudeCode. Keep one maintenance difference in mind: the native install.ps1 and install.cmd installers automatically update Claude Code in the background, whereas WinGet installations require manual updates via winget upgrade Anthropic.ClaudeCode. Open a brand-new terminal window afterward, run claude --version, and launch claude to sign in with a Claude Pro, Max, Ultra, Team, Enterprise, or Console account.
How to install Claude Code in WSL2 with OS-level sandboxing
To run Claude Code inside an isolated Linux environment, enable WSL 2 from an elevated PowerShell prompt via wsl --install (reboot if prompted), open your Ubuntu distribution in Windows Terminal, and run the native Linux installer: curl -fsSL https://claude.ai/install.sh | bash. Placing repositories on the Linux filesystem (inside ~ rather than /mnt/c/) prevents slow cross-OS file watching.
On Debian and Ubuntu WSL 2 instances, install the sandbox runtime dependencies—sudo apt-get install bubblewrap socat—so Claude Code can enforce write and network boundaries cleanly. Verify binary placement at ~/.local/bin/claude, authenticate via claude, and tune project permissions and MCP hooks using our Claude Code settings.json checklist and MCP setup guide.
Top 3 Windows installation errors and how to verify with claude doctor
Whenever setup behaves unexpectedly, run claude doctor—a read-only diagnostic built directly into the CLI that audits installation health, validates settings.json syntax, and pinpoints shell or path mismatches without starting a billed session. First, if PowerShell throws a parser error on &&, verify whether your prompt begins with PS C:\ (PowerShell needs irm https://claude.ai/install.ps1 | iex) rather than C:\ (CMD).
Second, if Windows reports claude: command not found or not recognized, close and reopen your terminal so the updated user PATH loads, and confirm %USERPROFILE%\.local\bin is registered in Windows Environment Variables (or export PATH="$HOME/.local/bin:$PATH" inside WSL 2). Third, if native Claude Code cannot find Git Bash, install Git for Windows or set "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe" inside your settings.json env block, then verify everything passes before running workflows covered in our Claude Code v2.1.323 review, Aider vs Claude Code comparison, and Coding Agent Index.
Sources: Quickstart|Claude Code Docs ↗ Advanced setup|Claude Code Docs ↗ Sandboxing|Claude Code Docs ↗ How to Install Claude Code (2026): macOS, Windows and Linux|OpenAgents ↗ Install Claude Code on Windows (plus Claude Desktop)|Gradually AI ↗
THE BROADER CONTEXT · CLAUDE DOSSIER
Explore full product specifications, pricing analysis, and continuous coverage in the Claude Desk Hub. Independent benchmarks available on the AI Intelligence Index and Coding Agents Leaderboard.


