Run Claude Code on Windows with WSL
Enable WSL with wsl --install, run the Linux installer for Claude Code inside Ubuntu, fix the PATH, and keep projects on the Linux filesystem.
On this page6 sections
Searching “ubuntu claude command not found” usually means you installed Claude Code inside WSL and the shell cannot see it yet. Claude Code’s native installer targets macOS, Linux, and WSL, so on Windows the Linux build runs under WSL. Native Windows is supported too; WSL 2 is the one Windows route that also gets sandboxing.
1. Decide: WSL or native Windows
Both are supported on Anthropic’s setup page. Pick WSL 2 for Linux toolchains or sandboxed command execution; pick native Windows if your projects and tools are Windows-native. For the native route, use Install Claude Code on Windows instead. WSL 1 runs Claude Code but has no sandboxing.
2. Install WSL and Ubuntu
wsl --install
Run this in an Administrator PowerShell, then restart: it enables WSL and installs Ubuntu on WSL 2 by default.
wsl --list --online
Lists other distributions; install a specific one with wsl --install -d <Distro>.
3. Run the Linux installer inside Ubuntu
Open the Ubuntu app from the Start menu, not PowerShell or CMD, then run the Linux installer:
curl -fsSL https://claude.ai/install.sh | bash
Downloads and installs the claude launcher to ~/.local/bin/claude inside WSL.
claude --version
Prints a version such as 2.1.211 (Claude Code) once the install directory is on your PATH.
4. Fix the PATH if claude is missing
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
Adds the install directory to your PATH for good, the usual cure for “command not found” right after installing. More fixes: claude: command not found.
5. Open a project the fast way
cd ~/projects/my-app && claude
Starts a session scoped to that folder; keep the project in your Linux home (~/), not under
/mnt/c/.
Reading the Windows filesystem across from WSL is slow, and Anthropic’s troubleshooting page warns
that search returns fewer results on /mnt/c/. Clone into /home/ for full-speed file reads, then
begin your first session.
Verify it worked
Run claude doctor in Ubuntu for read-only install diagnostics. If it reports no errors and
claude --version prints a number, WSL is ready.
If it fails:
wsl --installprints the WSL help text instead of installing — WSL is already present. Runwsl --list --online, thenwsl --install -d Ubuntu.claude: command not foundin Ubuntu — the install directory is not on your PATH yet; run theexport PATHline in step 4 and reopen the shell.- Search misses files or feels slow — the project sits on
/mnt/c/; move it to/home/on the Linux filesystem.