Coderefercoderefer
CoursesWebinarsBlogAbout
Coderefercoderefer

Discover. Learn. Automate. Grow.

Learn

  • Courses
  • Webinars
  • Blog
  • Search

Company

  • About
  • Contact
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Refund Policy
© 2026 Coderefer. All rights reserved.
HomeBlogHow to Install Claude Code on Windows in 2026: Native PowerShell vs WSL
ai-toolsNovember 27, 20268 min read

How to Install Claude Code on Windows in 2026: Native PowerShell vs WSL

Claude Code now installs natively on Windows via PowerShell, no WSL or Node.js needed. Here's the native vs WSL install, step by step, with real fixes for PATH and Defender errors.

V

Vamsi Tallapudi

Manager, Architect Technology at Cognizant

How to Install Claude Code on Windows in 2026: Native PowerShell vs WSL

Claude Code finally runs on Windows without WSL. You open PowerShell, run one line (irm https://claude.ai/install.ps1 | iex), and you're building in minutes: no Node.js, no Linux subsystem, no Git Bash detour unless you want one. WSL2 is still the better call if you need sandboxed command execution or a Linux toolchain, but for most Windows devs the native installer is now the right default.

I've installed Claude Code on three different Windows machines this month (a work laptop locked down by IT, a personal gaming rig, and a cheap ARM64 Surface) and the native path worked cleanly on all three. The WSL path only tripped me up once, and it was my own fault for running an old WSL1 distro.

Here's the full breakdown: what changed, how to install both ways, and the errors you'll actually hit.

Do you still need WSL for Claude Code on Windows?

No. Claude Code has run natively on Windows since mid-2025, and the native installer (no Node.js dependency at all) went generally available on October 31, 2025. You can install, run, and update Claude Code entirely from PowerShell or CMD today.

WSL still matters for one specific reason: sandboxing. Anthropic's official setup docs lay out the tradeoff in a table: native Windows doesn't support sandboxed command execution, WSL2 does, and WSL1 doesn't either. If you're running untrusted code, working with Linux-only toolchains, or just want the extra isolation layer, WSL2 is the right pick. If you're doing normal Windows-native development (.NET, a React app in a plain folder, PowerShell scripts), native install is simpler and faster.

What you need before you install

Pulled straight from the official system requirements:

  • OS: Windows 10 version 1809 or later, or Windows Server 2019 or later
  • Hardware: 4 GB+ RAM, x64 or ARM64 processor
  • Shell: PowerShell or CMD (Bash and Zsh also work if you're in WSL)
  • Account: Pro, Max, Ultra, Team, Enterprise, or Console (the free claude.ai plan doesn't include Claude Code access)
  • Git for Windows: optional, not required

That last one surprises people coming from six-month-old tutorials. Git for Windows used to be a near-requirement because Claude Code routed every shell command through Git Bash. That changed with the PowerShell tool.

How to install Claude Code natively on Windows (PowerShell)

  1. Open PowerShell. Your prompt should show PS C:\Users\YourName>. Note the PS prefix.
  2. Run the install command:
irm https://claude.ai/install.ps1 | iex
  1. Wait. The installer shows no progress bar while it downloads. That's normal: don't Ctrl+C it.
  2. Close the window and open a fresh PowerShell terminal (this matters: your current session doesn't pick up the new PATH).
  3. Verify it worked:
claude --version

You should see something like 2.1.211 (Claude Code). If you get an error instead, skip to the troubleshooting section below.

  1. cd into a project folder and run claude to start your first session. You'll be prompted to log in through your browser.

How to install Claude Code using CMD instead

Same installer, different syntax, because CMD doesn't understand irm or PowerShell's pipe-to-execute pattern:

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

If you accidentally paste the PowerShell command into CMD, you'll get 'irm' is not recognized as an internal or external command. If you paste the CMD command into PowerShell, you'll get The token '&&' is not a valid statement separator. Those two errors are the fastest way to tell which shell you're actually in.

You don't need Administrator rights for either method. That's a change from early guides: I still see tutorials from January telling people to right-click "Run as Administrator," and it's unnecessary now.

Alternative: WinGet, if you prefer a package manager

winget install Anthropic.ClaudeCode

One catch: WinGet installs don't auto-update. The native PowerShell/CMD installer does. It checks for updates on startup and patches itself in the background. If you go the WinGet route, you'll need to run winget upgrade Anthropic.ClaudeCode yourself every so often, or Claude Code will quietly fall behind on model support.

How to install Claude Code inside WSL

If you've decided you want sandboxing or a Linux-first workflow, install WSL2 first (wsl --install from an admin PowerShell, then reboot), then run the Linux installer inside your WSL distro's terminal, not from PowerShell or CMD:

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

That's it. You launch and use claude from inside the WSL terminal going forward. Mixing native Windows and WSL installs on the same machine works fine: they're separate installations with separate config, so don't expect your WSL settings or MCP servers to carry over to the Windows side.

Native Windows vs WSL: side-by-side

Native WindowsWSL2WSL1
RequiresNothing (Git for Windows optional)WSL2 enabledWSL1 enabled
Sandboxed command executionNot supportedSupportedNot supported
Node.js neededNo (native installer)NoNo
Best forWindows-native projects, .NET, PowerShell scriptsLinux toolchains, sandboxed executionOnly if WSL2 isn't available
Shell tool usedPowerShell tool (or Bash via Git for Windows)BashBash

My honest take: unless you specifically need sandboxing or you're already living in a Linux-based toolchain, skip WSL. It's one more layer between you and your files, and the native installer has caught up on features. I only reach for WSL2 now when a client project genuinely needs a Linux-only build step.

What is the PowerShell tool, and do you need Git for Windows?

This is the part that's actually new for 2026. Claude Code shipped a native PowerShell tool in v2.1.84 (March 26, 2026). Before that, every Windows shell command got translated through Git Bash, which was slow and occasionally mangled Windows-style paths. The PowerShell tool spawns pwsh.exe or powershell.exe directly and runs real cmdlets.

Today, the behavior splits like this:

  • Without Git for Windows: Claude Code runs all shell commands through the PowerShell tool. Simplest setup, nothing extra to install.
  • With Git for Windows: Claude Code uses Git Bash for the Bash tool, and the PowerShell tool runs alongside it (on by default for claude.ai and Console accounts).

If Claude Code can't find your Git Bash install, point it manually in settings.json:

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

My recommendation: install Git for Windows anyway. You'll want Git installed for version control regardless, and having both the Bash tool and PowerShell tool available means Claude Code can pick the right one for the job instead of forcing everything through PowerShell syntax.

Common Windows install errors and how to fix them

"claude is not recognized as a command": the install directory isn't on your PATH yet. Press Win+R, type sysdm.cpl, go to Advanced → Environment Variables, and under User Variables add %USERPROFILE%\.local\bin to Path. Restart every open terminal, not just the current one.

Long path errors during npm-based installs: old Windows versions cap paths at 260 characters, and deep node_modules trees plus a OneDrive-synced folder blow past that fast. Fix it as Administrator:

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
git config --system core.longpaths true

Reboot after. This mostly affects the npm install path, not the native installer.

Windows Defender flags or slows Claude Code down: Defender scans every file Claude reads, which adds up on large repos. Add your project folder to Defender's exclusion list: Settings → Privacy & security → Windows Security → Virus & threat protection → Manage settings → Exclusions.

npm install fails or warns on an old Node version: if you're using the npm method (npm install -g @anthropic-ai/claude-code@latest) instead of the native installer, you need Node.js 22 or later. Older versions print an EBADENGINE warning but usually still complete. Honestly, just use the native installer and skip this entire category of problem.

How to verify, update, and uninstall

Check your install and catch config issues before they bite you:

claude --version
claude doctor

claude doctor is read-only: it won't start a session, it just prints diagnostics on install health and settings-file errors.

Native installs update themselves in the background. To force one immediately:

claude update

To uninstall a native install completely:

Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

Add Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force if you want your settings and MCP config gone too, but that wipes allowed tools, session history, and everything else, so only do it if you're starting fresh.

Before you can do any of this, you need a Pro, Max, Ultra, Team, Enterprise, or Console account: worth checking what Claude Code actually costs before you commit to a plan. If you'd rather skip the terminal entirely, Anthropic also ships a Desktop app with session management for Windows now. And if you're running any AI coding agent on a work Windows machine, it's worth knowing what telemetry it's sending back before you point it at client code.

Watch

How to Install Claude Code on Windows 11 CORRECTLY (Updated 2026)

The native installer is the right default for almost everyone reading this. Save WSL for when you actually hit its specific use case (sandboxing or a Linux-only build chain) instead of installing it out of habit because an old tutorial told you to.

ai-tools claude-code windows powershell 2026

Comments

    Get AI tricks that save you hours every week

    New AI tools, automation workflows, and course drops — straight to your inbox. Join 2,400+ builders.

    Read Next

    Google Workspace MCP Servers: Connect Gmail MCP to Claude Code Before Feb 2027
    ai-tools

    Google Workspace MCP Servers: Connect Gmail MCP to Claude Code Before Feb 2027

    Google's Gmail and Drive MCP servers went GA on Nov 24, 2026. Here's how to wire Gmail MCP into Claude Code before the Feb 1, 2027 REST API throttling deadline.

    November 27, 20267 min read
    1Password Was Breached Through an Employee's GitHub Account: What Was Taken
    ai-tools

    1Password Was Breached Through an Employee's GitHub Account: What Was Taken

    1Password confirmed a breach after an employee's GitHub account was compromised. Here's exactly what data was taken, what wasn't, and what to actually do now.

    November 27, 20269 min read
    How to Use fast-anything with Claude Code to Port Only the Slow 5% to Rust
    ai-tools

    How to Use fast-anything with Claude Code to Port Only the Slow 5% to Rust

    fast-anything profiles your Python or Node app, has Claude Code port the slowest function to Rust, and verifies it against 500 real calls before swapping it in.

    November 26, 20267 min read
    View all posts →