Back to Blog

Claude Code on Windows: native or WSL, and what to check

Alex Kim
7 min read
Claude Code on Windows: native or WSL, and what to check

Last updated: November 26, 2026

TL;DR

Claude Code runs natively on Windows 10 1809 or later and Windows Server 2019 or later, and it runs inside WSL. Pick by where your projects live and what you need. Native Windows fits Windows-native projects and tools, needs no WSL and no Administrator rights, and works without Git for Windows, but it can't sandbox commands. WSL 2 fits Linux toolchains and is the only Windows option where sandboxing is supported. WSL 1 is for when WSL 2 isn't available, and it has a known native-binary bug. On native Windows, installing Git for Windows decides which shell Claude Code uses: Git Bash if it's there, PowerShell if it isn't. Everything below comes from Anthropic's setup docs, tools reference and install troubleshooting page.

Native, WSL 2 or WSL 1

OptionNeedsSandboxingPick it when
Native WindowsNothing; Git for Windows is optionalNot supportedYour projects and tools are Windows-native
WSL 2WSL 2 enabledSupportedYou work with Linux toolchains, or want sandboxed command execution
WSL 1WSL 1 enabledNot supportedWSL 2 isn't available to you

The sandboxing column matters more than it looks. Anthropic's sandboxing docs describe the sandbox as a boundary the operating system enforces around the shell commands Claude runs, limiting which files and network hosts they can reach, and with auto-allow mode sandboxed commands can run without asking you. On native Windows, commands run unsandboxed, and WSL 1 isn't supported either, so on a Windows machine WSL 2 is the route. Our sandbox guide covers setting it up. Without it, your permission rules carry the whole load.

Whichever you pick, the hardware floor is the same: 4 GB of RAM or more and an x64 or ARM64 processor. Claude Code doesn't support 32-bit Windows.

Set up native Windows

  1. Install from PowerShell or CMD. You don't need to run as Administrator. In PowerShell:
irm https://claude.ai/install.ps1 | iex

In CMD:

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

Your prompt shows PS C:\ in PowerShell and C:\ without the PS in CMD. WinGet works too (winget install Anthropic.ClaudeCode), but a WinGet install doesn't update itself: run winget upgrade Anthropic.ClaudeCode now and then. The native installer updates in the background.

  1. Decide on Git for Windows. It's optional, and it changes the shell:

    • Without it, Claude Code runs shell commands through the PowerShell tool.
    • With it, Claude Code uses Git Bash for the Bash tool. The Monitor tool on Windows is only available with Git Bash installed.
  2. Point it at Git Bash if it can't find it. In the env block of your settings file, set CLAUDE_CODE_GIT_BASH_PATH to the full path of bash.exe in your Git for Windows install folder, under Git\bin.

  3. Open a new terminal and run claude in your project folder. If the shell says 'claude' is not recognized, the install folder, %USERPROFILE%\.local\bin, isn't on your PATH yet. The installer reports that under Setup notes: and prints the fix, but it doesn't change PATH for you. Run claude doctor for a read-only check of the install and your settings.

The PowerShell tool alongside Git Bash

With Git for Windows installed, the PowerShell tool is still there: on by default for claude.ai and Console accounts, and turned on with CLAUDE_CODE_USE_POWERSHELL_TOOL=1 for Amazon Bedrock, Google Cloud's Agent Platform and Microsoft Foundry sessions. Set it to 0 to turn it off. When it's on, Claude treats PowerShell as the primary shell and keeps Bash for POSIX scripts.

A few details from the docs worth knowing before you rely on it:

  • It uses PowerShell 7 (pwsh.exe) when it finds it and falls back to Windows PowerShell 5.1.
  • It runs with the execution policy bypassed for its own process only, so .ps1 scripts work on a default install; Group Policy still applies. Set CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY=1 to respect the machine's policy instead.
  • Your PowerShell profile isn't loaded, so aliases and functions defined there aren't available to Claude.
  • A scoped Bash deny rule turns the PowerShell tool off without a warning. Keep it on with CLAUDE_CODE_USE_POWERSHELL_TOOL=1 or a PowerShell(...) permission rule of its own.
  • Hooks that inspect shell commands should match Bash|PowerShell, not Bash alone; our hooks guide covers matchers.

Set up WSL

Open your WSL distribution and run the Linux installer there:

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

You install and launch claude inside the WSL terminal, not from PowerShell or CMD. WSL doesn't need Git for Windows. Three things trip people up:

  • WSL 1 and Exec format error. If claude prints cannot execute binary file: Exec format error, you're on WSL 1 and hitting a known native-binary regression. The cleanest fix is converting the distribution to WSL 2 from PowerShell; the troubleshooting page also gives a workaround for staying on WSL 1.
  • Windows Node inside WSL. This only applies to an npm install. If claude says exec: node: not found, WSL is likely using the Windows Node.js. Run which node: a path starting with /mnt/c/ is the Windows binary. Install Node inside the distribution, or use the native installer, which doesn't need Node at all.
  • Signing in when no browser opens. At the login prompt, press c to copy the login URL, open it in a browser on your machine, and paste the code it shows back at Paste code here. You can also set BROWSER to your Windows browser's path so WSL 2 opens it next time.

What differs once you're running

Native WindowsWSL 2
Shell Claude usesGit Bash, or PowerShell without Git for WindowsBash; the PowerShell tool is opt-in and needs pwsh
SandboxingNot supportedSupported
File searchGlob and Grep tools are part of the default setClaude searches with find and grep through the Bash tool
Memory cap on commandsDocumented for Linux and WSL onlyCLAUDE_CODE_TOOL_MEMORY_LIMIT, such as 4G
Install path%USERPROFILE%\.local\bin\claude.exe~/.local/bin/claude

If you mostly work in an editor, the shell question follows you there: our VS Code guide covers the extension and the integrated terminal.

Frequently asked questions

Does Claude Code work on Windows without WSL?

Yes. It runs natively on Windows 10 1809 or later and Windows Server 2019 or later. Install it from PowerShell or CMD with no Administrator rights. WSL is optional, and WSL 2 is the Windows option that supports sandboxing.

Do I need Git for Windows for Claude Code?

No. Without it, Claude Code runs commands through the PowerShell tool. With it, Claude Code uses Git Bash for the Bash tool, and the Monitor tool becomes available. WSL setups don't need Git for Windows.

Should I use WSL 2 or native Windows for Claude Code?

Use native Windows for Windows-native projects and tools. Use WSL 2 for Linux toolchains or when you want sandboxed command execution, which native Windows doesn't support. Use WSL 1 only if WSL 2 isn't available.

Why does Windows say claude is not recognized?

The install folder, %USERPROFILE%.local\bin, isn't on your PATH yet. The installer reports this under Setup notes and prints the fix without changing PATH itself. Add the folder, then open a new terminal and run claude again.

How do I fix Exec format error in WSL?

That error means you're on WSL 1 and hitting a known native-binary regression. The cleanest fix is converting your distribution to WSL 2 from PowerShell. Anthropic's troubleshooting page also gives a workaround if you need to stay on WSL 1.

Next: the commands you'll use every day

Once claude starts, the platform mostly stops mattering. Our Claude Code CLI guide covers the commands, flags and shortcuts, and the settings guide shows where your env block and other settings live.

#claude-code#Windows#WSL#PowerShell#CLI
Free assessment

Stop guessing. Score your first workflow.

Score one workflow in about five minutes. Nine questions, a grade, and the specific gap holding it back - no call required.