# Install Claude Code on Windows with WSL

Canonical: https://cwyn.com/pages/claude-code-guide-wsl-setup.html
Last updated: 2026-11-27T07:43:26-05:00

Claude Code setup guide

To install Claude Code on Windows with WSL 2, run `wsl --install` in PowerShell as administrator and restart Windows. In Ubuntu, run the Linux installer with `curl -fsSL https://claude.ai/install.sh | bash`. Verify with `claude --version`, then start `claude` from your project under `/home/` to sign in. Choose native Windows if you build with Windows tools.

Last updated November 27, 2026 · Published November 23, 2026

By CWYN · Published Nov 23, 2026 · [Claude Code installation requirements and commands](https://code.claude.com/docs/en/setup) (as of Nov 27, 2026) · Checked against docs, not run

## 1. Native Windows or WSL?

If you build and test in Ubuntu, install Claude Code inside WSL 2 alongside your Linux tools. If you build in PowerShell and keep your repository on the Windows drive, run `irm https://claude.ai/install.ps1 | iex` in PowerShell. The [native Windows PowerShell install guide](https://cwyn.com/pages/claude-code-guide-windows-powershell-install.html) walks you through that path.

Claude Code on Windows by environment

| Environment | What you need | Command sandboxing | When to choose it |
| --- | --- | --- | --- |
| Native Windows | No extra software. Git for Windows is optional. | Unsupported | Your project and tools run on Windows. |
| WSL 2 | WSL 2 enabled | Supported | You use a Linux toolchain or need sandboxed command execution. |
| WSL 1 | WSL 1 enabled | Unsupported | Only if WSL 2 is unavailable. |

## 2. Install WSL, then install Claude Code in Ubuntu

Microsoft’s one-command WSL setup requires Windows 11 or Windows 10 version 2004 or later (build 19041 or higher). Claude Code supports Ubuntu 20.04 or later on x64 or ARM64 with at least 4 GB of RAM.

1. Install WSL from Windows PowerShell. On a fresh Windows setup, open PowerShell with “Run as administrator” and run the command below. It enables WSL and installs Ubuntu by default. Restart Windows when installation finishes. If you already have a distribution, go straight to the version check.

```
wsl --install
```
2. Check the distribution in PowerShell. Run the command below and look for your distribution’s name and a `2` in the VERSION column. If you see `1`, follow the [WSL 2 conversion steps](https://cwyn.com/pages/claude-code-guide-wsl-setup.html#wsl-version).

```
wsl -l -v
```

 [Microsoft’s WSL installation guide](https://learn.microsoft.com/en-us/windows/wsl/install) (as of Nov 27, 2026).
3. Open your WSL distribution. Launch Ubuntu from the Windows Start menu. On first launch, let it unpack and create your Linux username and password when prompted. Use this Linux terminal for the remaining steps.
4. Run the Linux installer. This installs the native Claude Code binary inside your distribution. To use the stable channel, use the [stable install command](https://cwyn.com/pages/claude-code-guide-wsl-setup.html#stable) instead.

```
curl -fsSL https://claude.ai/install.sh | bash
```
5. Verify the installation. Open a fresh Ubuntu terminal. The first command prints the installed version. The second prints read-only diagnostics for your installation and settings.

```
claude --version
claude doctor
```
6. Open your project on the Linux filesystem. Keep the working copy in your Linux home folder, for example `~/projects/my-app`. A path starting with `/mnt/c/` crosses onto the Windows drive and can slow down searches. To see the Linux copy in Windows File Explorer, run `explorer.exe .` from that folder. [Microsoft’s WSL file storage guidance](https://learn.microsoft.com/en-us/windows/wsl/filesystems) (as of Nov 27, 2026).
7. Start Claude Code and sign in. Replace the example path below with your project’s directory in WSL. Once you’re in that folder, run `claude` and follow the browser prompts. Back in the terminal, check that the working directory above the Claude prompt is your project. Type `/help` to see the available commands. If the browser stalls, see the [WSL login fix](https://cwyn.com/pages/claude-code-guide-wsl-setup.html#login).

```
cd ~/projects/my-app
claude
```

 [Claude Code first-session quickstart](https://code.claude.com/docs/en/quickstart) (as of Nov 27, 2026).

After signing in, start with the [Claude Code commands for a first session](https://cwyn.com/pages/claude-code-guide-commands-cheat-sheet.html). If you also use Hermes in your terminal, you can [continue a Hermes CLI chat in Telegram](https://cwyn.com/pages/hermes-guide-cli-telegram-handoff.html).

To give Claude your project’s build and test commands on future runs, record them in a `CLAUDE.md` at the root of your WSL repository. The [Claude Code Complete Setup Pack](https://cwyn.com/pages/pack-claude-code-complete-setup-pack.html) includes a starter file you can adapt.

## 3. Troubleshooting Claude Code on WSL

### PowerShell prints WSL help or the Ubuntu download stalls at 0.0%

If `wsl --install` prints help, WSL may already be enabled. In administrator PowerShell, run `wsl --list --online` to see available distributions, then `wsl --install -d Ubuntu` to install Ubuntu. If the download stays at 0.0%, run `wsl --install --web-download -d Ubuntu`. Once it finishes, restart if prompted and check that Ubuntu appears in `wsl -l -v`. [Microsoft’s fixes for WSL install and download issues](https://learn.microsoft.com/en-us/windows/wsl/install) (as of Nov 27, 2026).

### Ubuntu reports “claude: command not found” after installation

Open a new Ubuntu terminal and try `claude --version`. If it still fails, run `ls -la ~/.local/bin/claude`. If the file is missing after a fresh install, rerun the Linux installer inside Ubuntu. If the file exists and `~/.local/bin` is missing from your PATH, add `export PATH="$HOME/.local/bin:$PATH"` to `~/.bashrc` for Bash, run `source ~/.bashrc`, then retry the version check.

### WSL 1 reports an exec format error

On WSL 1, `cannot execute binary file: Exec format error` is a known native-binary regression (issue #38788). To convert the distribution to WSL 2, run this command in Windows PowerShell. Replace `<DistroName>` with your distribution’s name.

```
wsl --set-version <DistroName> 2
```

After conversion, reopen the distribution and run `claude --version` in its Linux terminal.

### WSL 2 opens no browser or reports a localhost error

At the Claude Code login prompt, press c to copy the login URL. Open that URL in your Windows browser, sign in and paste the code the browser gives you into the WSL terminal at the `Paste code here` prompt.

If you use Chrome at the Windows path below, you can tell Claude Code which browser to open. Run these commands in the same WSL terminal.

```
export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
claude
```

### File searches are slow or miss results

A repository under `/mnt/c/` makes WSL read across the Windows and Linux filesystems. Searches can be slow or incomplete even when `claude doctor` shows Search as OK. Keep the working copy under `/home/` and start Claude Code there. If the files must stay on the Windows drive, narrow the search to a specific directory or file, or run Claude Code natively on Windows.

[Anthropic’s WSL search troubleshooting](https://code.claude.com/docs/en/troubleshooting) (as of Nov 27, 2026).

### An npm install picks up Windows Node

Use the Linux installer for a new installation. If you installed through npm and WSL reports `exec: node: not found`, check which executables your Linux shell finds.

```
which npm
which node
```

A path under `/mnt/c/` points to a Windows executable. Install Linux Node through your distribution’s package manager or nvm. If you use nvm, load it in `~/.bashrc` for Bash or `~/.zshrc` for Zsh. Open a fresh shell and check both paths again. Avoid setting `appendWindowsPath = false` because it breaks access to Windows executables from WSL.

If npm reports a platform mismatch, run the following commands from WSL with Linux Node active. Run them as your own user, without `sudo`.

```
npm config set os linux
npm install -g @anthropic-ai/claude-code@latest --force
```

[Anthropic’s fixes for installation, PATH and login errors](https://code.claude.com/docs/en/troubleshoot-install) (as of Nov 27, 2026).

### Update Claude Code or remove its WSL configuration

The native installer updates Claude Code in the background. Updates apply the next time you start it. Run `claude --version` in WSL to see which version you are using.

When uninstalling, you can also remove your personal Claude Code configuration from WSL. These commands delete your settings, allowed tools, MCP configurations and session history. Back up anything you want to keep before running them in your distribution.

```
rm -rf ~/.claude
rm ~/.claude.json
```

To remove the executable itself, follow the Linux uninstall steps in [Anthropic’s setup documentation](https://code.claude.com/docs/en/setup) (as of Nov 27, 2026).

## 4. Claude Code WSL FAQ

### Do I need Git for Windows in WSL?

No. You can install and launch Claude Code inside your Linux distribution without Git for Windows. Git for Windows is optional for a native Windows installation.

### Which accounts can sign in to Claude Code?

Use a Pro, Max, Ultra, Team, Enterprise or Console account. The free claude.ai plan does not include Claude Code. See how [a subscription compares with API access](https://cwyn.com/pages/claude-code-guide-subscription-vs-api.html) and how [Claude Code usage limits work](https://cwyn.com/pages/claude-code-guide-usage-limits.html).

### How do I install the stable channel in WSL?

Choose the stable channel by passing `stable` to the Linux installer. Run this version of the install command inside your WSL terminal.

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

### Do I need Node.js for the Linux installer?

No. The Linux installer installs the native Claude Code binary. The Node path checks apply to installations made through npm.

## Next steps

- [All 34 Claude Code guides](https://cwyn.com/guides/claude-code/)
- [Claude Code setup walkthrough](https://cwyn.com/setup/claude-code/)
- [Check your CLAUDE.md](https://cwyn.com/score/setup-file-checker/?profile=claude)
- [Claude Code Complete Setup Pack ($12.95)](https://cwyn.com/pages/pack-claude-code-complete-setup-pack.html)

## Email me the CLAUDE.md + settings starter

Get the editable CLAUDE.md template and a project setting you can merge into .claude/settings.json.

Email address

Email me this file. Also send up to 4 short follow-up emails with tips and one related CWYN product. Unsubscribe any time. [Privacy policy](https://cwyn.com/pages/privacy.html)

### Set up your repository after installation

For a starter `CLAUDE.md` and project permission presets, see the [Claude Code Complete Setup Pack ($12.95)](https://cwyn.com/pages/pack-claude-code-complete-setup-pack.html).
Catalog price as of Nov 20, 2026

Claude Code Complete Setup Pack $12.95

Set up project instructions, permission rules, hooks, a reviewer skill and subagent, and MCP connections for Claude Code.
