Claude Code setup guide

Install Claude Code on Windows with WSL

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 · Published

By CWYN · Published · Claude Code installation requirements and commands (as of ) · 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 walks you through that path.

Claude Code on Windows by environment
EnvironmentWhat you needCommand sandboxingWhen to choose it
Native WindowsNo extra software. Git for Windows is optional.UnsupportedYour project and tools run on Windows.
WSL 2WSL 2 enabledSupportedYou use a Linux toolchain or need sandboxed command execution.
WSL 1WSL 1 enabledUnsupportedOnly 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.
    wsl -l -v
    Microsoft’s WSL installation guide (as of ).
  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 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 (as of ).
  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.
    cd ~/projects/my-app
    claude
    Claude Code first-session quickstart (as of ).

After signing in, start with the Claude Code commands for a first session. If you also use Hermes in your terminal, you can continue a Hermes CLI chat in Telegram.

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 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 (as of ).

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 (as of ).

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 (as of ).

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 (as of ).

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 and how Claude Code usage limits work.

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

Set up your repository after installation

For a starter CLAUDE.md and project permission presets, see the Claude Code Complete Setup Pack ($12.95).
Catalog price as of Nov 20, 2026