# Claude Code on Windows: native or WSL?

> Claude Code runs natively on Windows now. When WSL 2 still wins, the pitfalls that bite on WSL (WSL 1, /mnt/c, sign-in), and how to choose.

Source: https://shuriken.sh/guides/claude-code-windows-vs-wsl

Claude Code runs natively on Windows now. When WSL 2 still wins, the pitfalls that bite on WSL (WSL 1, /mnt/c, sign-in), and how to choose.

By Shuriken Updated 27 October 2026 5 min read

**Contents**

Run Claude Code natively on Windows unless you have a reason not to. Anthropic's installer works from PowerShell or CMD on Windows 10 1809 and later, with no admin rights and no WSL. Pick WSL 2 when your project is built with Linux tools, or when you want Claude Code's sandbox, which native Windows doesn't support.

That's our answer to "Claude Code Windows vs WSL" as of 22 October 2026.

## Native Windows vs WSL 2 vs WSL 1 at a glance #

Anthropic's [setup page](https://code.claude.com/docs/en/setup) has a three-row table. Here it is, with what it means in practice:

| | Native Windows | WSL 2 | WSL 1 |
| --- | --- | --- | --- |
| Needs | Nothing; Git for Windows optional | WSL 2 turned on | WSL 1 |
| Claude Code's sandbox | Not supported | Supported | Not supported |
| Shell the agent uses | Git Bash if installed, otherwise PowerShell | bash or zsh in your distro | bash or zsh in your distro |
| Fastest for files on | C:\ | your Linux home ( /home/you ) | (avoid) |
| Anthropic's "when to use" | Windows-native projects and tools | Linux toolchains or sandboxed command execution | If WSL 2 is unavailable |

## Installing Claude Code natively on Windows #

In PowerShell:

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

In CMD:

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

Or with WinGet: winget install Anthropic.ClaudeCode (WinGet installs don't update themselves; run winget upgrade Anthropic.ClaudeCode now and then). Open a new terminal and run claude --version.

Then install Git for Windows. Anthropic calls it optional but recommends it: with it, Claude Code uses Git Bash for its Bash tool; without it, it runs commands through PowerShell. Most agent instructions, READMEs and scripts assume bash, so Git Bash saves a lot of small failures. If Claude Code can't find Git Bash, point at it in settings.json:

json
{ "env": { "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe" } }

### Native Windows errors you might meet #

These four come from Anthropic's [install troubleshooting](https://code.claude.com/docs/en/troubleshoot-install).

- irm is not recognized means you're in CMD, and The token '&&' is not a valid statement separator means you're in PowerShell. Use the other command.
- Claude Code does not support 32-bit Windows on a 64-bit PC means you opened "Windows PowerShell (x86)". Open the one without x86.
- 'claude' is not recognized means %USERPROFILE%\.local\bin isn't on your PATH yet. Open a new terminal, or add it.
- If claude opens the Claude desktop app, an older desktop app registered its own Claude.exe ahead of the CLI on your PATH.

One more, if you installed with npm: claude.ps1 cannot be loaded because running scripts is disabled on this system is PowerShell's execution policy refusing the script npm wrote for Claude Code. Our guide to [running scripts is disabled](https://shuriken.sh/guides/running-scripts-is-disabled-agent-cli) has the one-line fix.

## When WSL 2 is still the better choice #

- Your project is built with Linux tools. Makefiles full of GNU flags, shell scripts, Docker setups, native modules that only build on Linux. The agent runs the same commands your CI runs.
- You want the sandbox. Claude Code's sandbox isolates bash commands' file and network access so you can approve fewer prompts. Anthropic supports it on WSL 2, not on native Windows. If you plan to let an agent run with fewer prompts, that matters. Codex is different here: it has a sandbox of its own on native Windows, covered in [Codex CLI on Windows](https://shuriken.sh/guides/codex-cli-on-windows).
- Your team's docs assume Linux or macOS. Fewer "works on my machine" moments.

Install inside your distro with the Linux installer, and always run claude from the WSL terminal, not from PowerShell:

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

Shuriken runs your coding agents on your own computers and keeps them going when an account hits its limit.

[Download](https://shuriken.sh/download)

## The WSL pitfalls #

### Projects under /mnt/c #

This is the big one. Microsoft's own [WSL guide](https://learn.microsoft.com/en-us/windows/wsl/filesystems) says: "We recommend against working across operating systems with your files ... For the fastest performance speed, store your files in the WSL file system if you are working in a Linux command line." Anthropic adds that on /mnt/c, Claude Code's search "returns fewer results than on a native filesystem", while claude doctor still says search is OK.

Fix: clone the project into your Linux home (~/code/project), not /mnt/c/Users/you/code/project. Your Windows editor can still open it through \\wsl$.

### Still on WSL 1 #

On WSL 1, Anthropic documents cannot execute binary file: Exec format error from a regression in the native binary. Convert the distro from PowerShell:

powershell
wsl --set-version <DistroName> 2

### Windows Node.js leaking into WSL #

Only if you installed with npm: exec: node: not found, or npm reporting the wrong platform, means WSL is picking up the Windows node and npm (paths starting /mnt/c/). Install Node inside the distro, or switch to the native installer, which doesn't need Node at all.

### Sign-in that never comes back #

In WSL 2, the browser opens on Windows, and its redirect can't always reach Claude Code's local callback. Anthropic's fix: after signing in, the browser shows a code; paste it at the Paste code here if prompted prompt. If no browser opens at all, set BROWSER to your Windows browser's path, or press c to copy the sign-in link. If you're asked to sign in again and again, our guide on [why Claude Code keeps asking you to log in](https://shuriken.sh/guides/claude-code-keeps-asking-to-log-in) covers the other causes. The login inside WSL is its own, separate from Claude Code on Windows, which makes WSL the zero-setup way to keep [a second Claude Code account on one PC](https://shuriken.sh/guides/claude-code-multiple-accounts-windows).

### Two installs fighting #

Having Claude Code both in Windows and inside WSL is fine, but they're two installs with two sign-ins and two settings folders (C:\Users\you\.claude and ~/.claude in the distro). Pick one per project, or you'll wonder where your settings went.

## How Shuriken runs on Windows #

Shuriken is a desktop app for Windows 10 and 11 (x64), installer or .zip. It runs agents natively on Windows, the first of the two options above. When you set up the computer, it installs what's missing for you: Git, the GitHub CLI, ripgrep, Claude Code through Anthropic's own installer, and the CLI of each provider you add a source for. If Git for Windows was the step you'd have forgotten, it's done.

From there it's the same app as on a Mac: every chat on its own branch in its own git worktree, [source switching](https://shuriken.sh/features/source-switching) between your own accounts when one nears its limit, and the background service that keeps agents running with the window closed. We wrote about the Windows build, including the SmartScreen warning you'll see on first install, in [Shuriken on Windows](https://shuriken.sh/blog/shuriken-on-windows).

If your Linux toolchain lives elsewhere, there's a third option besides native and WSL: a Linux machine or VM added as a Shuriken server, which our guide on [running Claude Code over SSH](https://shuriken.sh/guides/claude-code-over-ssh) compares with doing it by hand. Either way, [download Shuriken for Windows](https://shuriken.sh/windows).

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-windows-vs-wsl&text=Claude%20Code%20on%20Windows%3A%20native%20or%20WSL%3F)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-windows-vs-wsl)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-windows-vs-wsl&t=Claude%20Code%20on%20Windows%3A%20native%20or%20WSL%3F)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-windows-vs-wsl&title=Claude%20Code%20on%20Windows%3A%20native%20or%20WSL%3F)[E-mail](mailto:?subject=Claude%20Code%20on%20Windows%3A%20native%20or%20WSL%3F&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-windows-vs-wsl)

## Sources

- [Advanced setup: Set up on Windows (Claude Code docs)](https://code.claude.com/docs/en/setup) (accessed 22 October 2026)
- [Troubleshoot installation and login (Claude Code docs)](https://code.claude.com/docs/en/troubleshoot-install) (accessed 22 October 2026)
- [Troubleshooting: slow or incomplete search results on WSL (Claude Code docs)](https://code.claude.com/docs/en/troubleshooting) (accessed 22 October 2026)
- [Working across file systems (Microsoft Learn, WSL)](https://learn.microsoft.com/en-us/windows/wsl/filesystems) (accessed 22 October 2026)

## Frequently asked questions

**Do I need WSL to run Claude Code on Windows?**

No. Anthropic's installer runs on Windows 10 1809 or later from PowerShell or CMD, without administrator rights. WSL is an option, not a requirement.

**Do I need Git for Windows for Claude Code?**

It's optional but recommended. With it, Claude Code uses Git Bash for its Bash tool. Without it, Claude Code runs shell commands through PowerShell instead.

**Why is Claude Code slow or missing files in WSL?**

Usually because the project sits on the Windows drive under /mnt/c. Reading across file systems is slow, and Anthropic says search can return fewer matches there. Move the project under your Linux home folder.

**Does Claude Code work on WSL 1?**

Anthropic documents an Exec format error on WSL 1 from a native-binary regression, and sandboxing needs WSL 2. Convert the distro with wsl --set-version <distro> 2.

**Can Claude Code's sandbox run on native Windows?**

Not as of 22 October 2026. Anthropic's setup table lists sandboxing as supported on WSL 2 only, not on native Windows or WSL 1.

Shuriken

The harness for your coding agents.

Run Claude Code, Codex and Gemini CLI on your own computers, move chats to your next account at a limit, and follow every chat from any device.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [How to change the model in Claude Code: Guide 27 Oct 2026 3 min read Change the model in Claude Code with /model, claude --model, an environment variable or settings.json. /model wins; Enter in its picker sets your default.](https://shuriken.sh/guides/change-model-in-claude-code)
- [Claude Code API Error 400 on tool_use: what to do: Guide 27 Oct 2026 4 min read A Claude Code API Error 400 about tool use means the saved history has a tool call out of step with its result. Update, then rewind past the broken turn.](https://shuriken.sh/guides/claude-code-api-error-400-tool-use)
- [Claude Code custom slash commands: make your own: Guide 27 Oct 2026 3 min read Make your own Claude Code slash commands: one Markdown file in .claude/commands or a skill, with arguments, shell output and allowed tools. With examples.](https://shuriken.sh/guides/claude-code-custom-slash-commands)
- [Claude Code thinking and effort levels, explained: Guide 27 Oct 2026 4 min read Claude Code's effort levels, low to max, set how much Claude thinks before it acts. What each level is for, the defaults, ultrathink, and how to set it.](https://shuriken.sh/guides/claude-code-effort-levels)
- [Claude Code chat history deleted? Set cleanupPeriodDays: Guide 27 Oct 2026 5 min read Claude Code deletes session transcripts after 30 days by default. Raise cleanupPeriodDays in settings.json to keep them, and back up what you can't lose.](https://shuriken.sh/guides/claude-code-history-deleted-after-30-days)
- [Claude Code hooks not working? Why they don't fire: Guide 27 Oct 2026 6 min read A Claude Code hook that never fires is either not loaded (missing from /hooks) or loaded with a matcher that matches nothing. The causes and their fixes.](https://shuriken.sh/guides/claude-code-hooks-not-working)
- [Claude Code keyboard shortcuts and commands cheat sheet: Guide 27 Oct 2026 5 min read Every Claude Code keyboard shortcut worth knowing, for Mac and Windows, plus the slash commands that matter. One page, checked against Anthropic's docs.](https://shuriken.sh/guides/claude-code-keyboard-shortcuts)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
