How to Use Claude Code on Windows | 3 Installation Methods: Native / WinGet / npm and When to Use WSL

When installing Claude Code on Windows, it can be hard to know which installation method to use and whether WSL is necessary. There are 3 installation paths — native, WinGet, and npm — and separately, you choose your runtime environment: native or WSL. This guide cuts through the confusion and walks you through everything you need to get the claude command running as quickly as possible, based on official Anthropic documentation.

Article Summary by AIpowered by Claude
結論powered by Claude

As of 2026, Claude Code runs natively on Windows — WSL is not required. With the minimum setup of Windows 10 1809 or later, 4 GB RAM, and Git for Windows, you can install it with a single line from PowerShell. A Pro or higher subscription is required to use Claude Code; the Free plan will be rejected at the authentication step.

There are 3 installation paths — native PowerShell, WinGet, and npm — and Anthropic recommends the native method: irm https://claude.ai/install.ps1 | iex. This is the only method that supports automatic updates; with WinGet and npm, you need to manually run an upgrade command periodically.

The most common pitfall is confusing PowerShell with CMD, which causes errors like && being rejected or irm not being recognized. If the claude command is not found, the fastest fix is to add %USERPROFILE%\.local\bin to your PATH environment variable and then run claude doctor for diagnostics.

目次 (20)

Requirements for Running on Windows — Windows 10 1809 or Later, 4 GB RAM, and Git for Windows

The minimum requirements for Claude Code to run on Windows are Windows 10 version 1809 or later, or Windows Server 2019 or later. You need at least 4 GB of RAM and an x64 or ARM64 processor (source).

Claude Code can be launched from PowerShell, CMD, or Bash inside WSL. However, to allow Claude Code to use Bash tools on native Windows, installing Git for Windows is recommended. Git for Windows includes Git Bash, and Claude Code uses Git Bash internally to execute commands regardless of which shell you launched it from (source). If Git for Windows is not installed, PowerShell will be used as the shell, but some features may be limited.

A network connection is required, and usage is limited to countries supported by Anthropic. Japan is included in the supported countries, so no additional configuration is needed. ripgrep, used for search functionality, is bundled with Claude Code and does not need to be installed separately.

A Subscription Is Required — The Free Plan Will Not Work

Claude Code cannot be used with the Free plan (source). You need one of the following: Pro ($20/month USD, before tax), Max, Team, or Enterprise, or a Console account (API pay-as-you-go). The installation itself is free, but the Free plan will be rejected at the authentication step. It is recommended to upgrade your plan before starting the setup process. For pricing details, see the Complete Guide to Claude Pricing Plans.

There are three main installation methods on Windows. Anthropic recommends the native installer, which is the only option that supports automatic updates (source).

Open PowerShell and run the following single line. Administrator privileges are not required.

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

If you are using CMD, the command is different:

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

Running the wrong command for your shell will produce the following errors (source):

  • Running a CMD command in PowerShell: The token '&&' is not a valid statement separator
  • Running a PowerShell command in CMD: 'irm' is not recognized as an internal or external command

Identifying your shell is simple: if your prompt starts with PS C:\, you are in PowerShell; if it shows only C:\, you are in CMD.

Claude Code is installed to %USERPROFILE%\.local\bin\claude.exe and updates automatically in the background. To manually trigger an immediate update, run claude update.

Method 2: WinGet (Manual Updates — Windows Built-in Package Manager)

This method uses WinGet, which comes pre-installed on Windows 10 1809 and later.

winget install Anthropic.ClaudeCode

Automatic updates are not supported. Run the following command periodically to update (source):

winget upgrade Anthropic.ClaudeCode

Method 3: npm (For Users with a Node.js Environment)

If you have Node.js 18 or later installed, you can also install via npm.

npm install -g @anthropic-ai/claude-code

On Windows, the win32-x64 or win32-arm64 binary is automatically selected. Automatic updates are not supported; update manually with npm update -g @anthropic-ai/claude-code (source).

Method Auto Update Recommended For Notes
Native PowerShell (Recommended) Yes All Windows users Do not confuse PowerShell and CMD
WinGet No Users who prefer Windows built-in tools Run winget upgrade periodically
npm No Regular Node.js users Requires Node.js 18 or later

Native vs WSL — Choose Based on Whether You Need Sandboxed Command Execution

Claude Code works without WSL (Windows Subsystem for Linux). The key deciding factor is whether you need sandboxed command execution (source).

Runtime Environment Prerequisites Sandboxing Best For
Native Windows Git for Windows recommended Not supported Native Windows projects and tools
WSL 2 WSL 2 enabled Supported Linux toolchains, projects requiring sandboxed execution
WSL 1 WSL 1 enabled Not supported Fallback when WSL 2 is unavailable

The main advantage of WSL 2 is support for sandboxed command execution. Claude Code can run commands in an isolated environment, reducing the risk of unintended system changes. On the other hand, enabling WSL 2 requires changing settings through "Turn Windows features on or off," which takes some effort for initial setup.

Native installation is sufficient for most Windows users. Simply install Git for Windows first, then run the one-line command in PowerShell to get started. Only choose WSL 2 if your project requires a Linux development environment (such as gcc, make, or the Docker daemon).

When using WSL, run the Linux installer inside the WSL distribution. Run it inside the WSL terminal — not from PowerShell or CMD (source).

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

First Launch and Authentication — Browser Login via claude Command, Pro or Higher Required

After installation is complete, run the claude command in your project directory (source).

cd C:\Users\yourname\projects\my-app
claude

On the first run, a browser will open automatically and display the Anthropic account login screen. Log in with a Pro, Max, Team, or Enterprise account, or a Console account. Your credentials are saved in %USERPROFILE%\.claude\, so you will not need to log in again on subsequent runs. To switch accounts, run the /login command within a session.

To verify the installation, run claude --version. For detailed diagnostics, claude doctor performs a comprehensive check of PATH, dependencies, authentication status, and network connection all at once — it is a useful first command to run when something goes wrong.

Windows-Specific Troubleshooting — PATH Errors, PowerShell vs CMD Confusion, and Git Bash Path

PATH Not Set Error

If claude is not recognized after a native installation, the installation path %USERPROFILE%\.local\bin may not have been added to PATH (source).

Resolution steps:

  1. Win + R → type sysdm.cpl → press Enter
  2. Go to the "Advanced" tab → click "Environment Variables"
  3. Select Path under User variables → click "Edit"
  4. Click "New" and add %USERPROFILE%\.local\bin
  5. Close all terminals and reopen them

The installer attempts to set the PATH automatically, but it may occasionally fail to take effect. Follow the steps above to add it manually.

Manually Setting the Git Bash Path

If Claude Code cannot find Git Bash, add the following to %USERPROFILE%\.claude\settings.json (source):

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

If you installed Git for Windows to a non-default location, run where bash to find the actual path before configuring this setting.

Confusing PowerShell and CMD

Using the wrong shell will cause the installation command to fail. Check your prompt (PS C:\ means PowerShell, C:\ only means CMD) and use the correct command for your shell.

Frequently Asked Questions (FAQ)

Q. Does it work without WSL?

Yes, Claude Code officially supports native Windows (source). Install Git for Windows and you can use it without WSL. However, if your project requires sandboxed execution, choose WSL 2.

Q. I get an error saying irm is not recognized

This happens because you are running a PowerShell command in CMD (source). Press the Windows key, search for "powershell," open Windows PowerShell, and try again.

Q. Can I use Claude Code with the Free plan?

No. The free Claude.ai plan does not include Claude Code (source). You need Pro ($20/month) or higher, or a Console account (API pay-as-you-go).

Q. Will Claude Code update automatically after installing with WinGet?

No. Unlike the native installer, WinGet does not support automatic updates (source). Run winget upgrade Anthropic.ClaudeCode periodically.

Q. How do I uninstall Claude Code?

The native installer version does not have a dedicated claude uninstall subcommand. The official documentation lists the following manual file deletion as the standard uninstallation procedure (source). Run the following two lines in PowerShell to remove it completely:

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

To also remove settings and history, add the following:

Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force
Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force

If you installed via WinGet, use winget uninstall Anthropic.ClaudeCode. If you installed via npm, use npm uninstall -g @anthropic-ai/claude-code. If claude still launches after removal, there may be a duplicate installation from another method or a shell alias left behind by an old installer. The official documentation advises checking for conflicting installations in this case — use claude doctor or where claude to locate and remove the remaining instance (source).

Sources

参考になったら ♡
Clauder Navi 編集部
@clauder_navi

Anthropic の Claude / Claude Code を中心に、日本のエンジニア向けに最新動向と実務 を毎日発信。 運営方針 は メディアについて をご覧ください。