Skip to content

Install Claude Code on Windows: setup, API key and fixes

Install Claude Code on Windows 10 or 11 with PowerShell, CMD, WinGet or WSL, then sign in or add an API key, and fix the common install errors.

Updated November 1, 2026Markdown version

To install Claude Code on Windows, open PowerShell and run Anthropic's installer: irm https://claude.ai/install.ps1 | iex. Then open a new terminal and check it with claude --version. You need 64-bit Windows 10 or 11 and no administrator rights. Sign in with a Claude plan, or put an API key and base URL in Claude Code's settings file.

What do you need before installing?#

  • Windows version: Windows 10 version 1809 or later, Windows 11, or Windows Server 2019 or later.
  • Processor: 64-bit, either x64 or ARM64. Claude Code doesn't run on 32-bit Windows.
  • Memory: 4 GB of RAM or more, and an internet connection.
  • A terminal: PowerShell or Command Prompt. Git for Windows is optional but recommended.
  • A way to pay for the model: an Anthropic Claude plan that includes Claude Code (Pro, Max, Ultra, Team or Enterprise), an Anthropic Console account, or an API key from a compatible service such as 5abeer. The Free Claude plan doesn't include Claude Code.

How do I install Claude Code on Windows?#

Anthropic recommends its native installer. It installs into your user folder and updates itself in the background.

  1. Open PowerShell#

    Open the Start menu, type PowerShell and pick Windows PowerShell, not the entry marked (x86). You don't need "Run as administrator". PowerShell shows PS C:\ at the start of the line; Command Prompt shows only C:\.

  2. Run the installer#

    Paste the command for the window you opened and press Enter:

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

    The installer shows no progress while it downloads, so give it a minute or two.

  3. Open a new window and check#

    Close the terminal, open a new one, and run:

    PowerShell
    claude --version

    A version number means the install worked. For a fuller check, claude doctor reports on the install and your settings without changing anything. If Windows says claude is not recognized, see the PATH fix in the errors section below.

Other ways to install#

WayInstallUpdates
Native installerThe PowerShell or CMD command aboveAutomatic, or run claude update
WinGetwinget install Anthropic.ClaudeCodeManual: winget upgrade Anthropic.ClaudeCode
npm (Node.js 22 or later)npm install -g @anthropic-ai/claude-codeAutomatic, or rerun the command with @latest at the end

Close Claude Code before winget upgrade, because Windows locks a program file while it runs. With npm, avoid npm update -g, which may not move you to the newest release.

Native Windows or WSL?#

Claude Code runs directly on Windows and inside WSL, the Windows Subsystem for Linux. The main difference is sandboxing, which limits what the commands Claude runs can reach:

SetupSandboxingInstall with
Native WindowsNot supportedThe PowerShell or CMD installer
WSL 2SupportedThe Linux installer, inside the WSL terminal
WSL 1Not supportedThe Linux installer, inside the WSL terminal

Inside a WSL terminal, the Linux installer is:

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

Then run claude from the same WSL terminal, not from PowerShell.

On native Windows, Claude Code uses Git Bash when Git for Windows is installed, and PowerShell when it isn't. If it can't find Git Bash, set the path in your settings file:

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

Sign in with a Claude plan or use an API key?#

With a Claude plan: run claude. It opens your browser to sign in with your Claude or Anthropic Console account. If the browser doesn't open, press c to copy the sign-in link.

With an API key: when the settings file holds a key and a base URL, Claude Code skips the sign-in, sends every request to that address and bills the key's owner per token. Plan limits don't apply to these requests. Create a key in your dashboard (how to create a key), then add these settings:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.5abeer.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_5ABEER_API_KEY",
    "ANTHROPIC_MODEL": "claude-sonnet-5.5"
  }
}

~/.claude/settings.json

On Windows, ~/.claude/settings.json means %USERPROFILE%\.claude\settings.json. These commands create the folder if needed and open the file in Notepad:

PowerShell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude" | Out-Null
notepad "$env:USERPROFILE\.claude\settings.json"

If the file already has an env section, add the three lines to it. Keep the key in this personal file, never in a project's .claude\settings.json, which is usually committed to Git.

To try a key for one session, set the variables in PowerShell instead. They vanish when the window closes, and the settings file wins over them. Put the ANTHROPIC_BASE_URL value from the settings block above in place of BASE_URL:

PowerShell
$env:ANTHROPIC_BASE_URL = "BASE_URL"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_5ABEER_API_KEY"
claude

How do I check the first run?#

Open a terminal in your project folder, run claude, then type /status. With a key active, the Status tab shows an Anthropic base URL line with the 5abeer address and an Auth token line that names ANTHROPIC_AUTH_TOKEN. A Login method line that names claude.ai means Claude Code is still using a saved sign-in.

The base URLs for each API format:

OpenAI-compatiblehttps://api.5abeer.ai/v1Authorization: Bearer <KEY>
Anthropic-compatiblehttps://api.5abeer.aix-api-key: <KEY>
Geminihttps://api.5abeer.ai/v1betax-goog-api-key: <KEY>

To test the key outside Claude Code, run this request in PowerShell. If it answers but Claude Code fails, the problem is in the settings file, not the key.

PowerShell
$headers = @{
    "x-api-key" = $env:KHABEER_API_KEY
    "anthropic-version" = "2023-06-01"
}
$body = @'
{
  "model": "claude-sonnet-5.5",
  "max_tokens": 512,
  "messages": [
    {
      "role": "user",
      "content": "Write a product idea in one sentence."
    }
  ]
}
'@

$response = Invoke-RestMethod -Method Post -Uri "https://api.5abeer.ai/v1/messages" `
  -Headers $headers `
  -ContentType "application/json; charset=utf-8" `
  -Body ([System.Text.Encoding]::UTF8.GetBytes($body))

$response | ConvertTo-Json -Depth 20
Response
{
  "id": "msg_01Xh7",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-5.5",
  "content": [
    {
      "type": "text",
      "text": "Hello! How can I help you today?"
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 21,
    "output_tokens": 12
  }
}

The key is read from KHABEER_API_KEY, so it never appears in your code.

How do I fix common Windows errors?#

Most install errors come from running a command in the wrong window:

  • 'irm' is not recognized: you are in Command Prompt. Use the CMD command, or open PowerShell.
  • The token '&&' is not a valid statement separator: you are in PowerShell. Use the PowerShell command.
  • A parameter cannot be found that matches parameter name 'fsSL' or 'bash' is not recognized: you ran the macOS or Linux command. Use the Windows one, or run it inside WSL.
  • running scripts is disabled on this system: PowerShell blocked the script npm installed. Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, or use the native installer.
  • The process cannot access the file ... because it is being used by another process: close other installers or wait for your antivirus, delete %USERPROFILE%\.claude\downloads and run the installer again.
  • Claude Code does not support 32-bit Windows: run [Environment]::Is64BitOperatingSystem. True means you opened the (x86) PowerShell, so open the normal one. False means Windows itself is 32-bit.
  • Claude Code on Windows requires either Git for Windows (for bash) or PowerShell: install Git for Windows with "Add to PATH" selected, or install PowerShell 7.

'claude' is not recognized#

The installer puts claude.exe in %USERPROFILE%\.local\bin but doesn't add that folder to your PATH. Its setup notes then say Native installation exists but C:\Users\you\.local\bin is not in your PATH. Add the folder for your user, then open a new terminal:

PowerShell
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

If claude stopped working right after an update, restore the backup the updater keeps:

PowerShell
Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe

An old version of the Claude desktop app can also take over the claude command. where.exe claude lists every match; if the desktop app comes first, update it.

Claude Code still asks you to sign in#

Claude Code didn't find a key. Check that ANTHROPIC_AUTH_TOKEN sits inside the env section and that the file is valid JSON. To clear an old claude.ai sign-in, run /logout and start Claude Code again. A key in ANTHROPIC_API_KEY needs a one-time approval; if you declined it, turn it back on in /config.

If a request is refused with a code, INVALID_API_KEY means the key is wrong or deleted, and INSUFFICIENT_BALANCE means your balance doesn't cover the request. Every code is in Errors and fixes.

How do I run Claude Code on Windows with 5abeer?#

5abeer is an independent service compatible with the Anthropic Messages API, so Claude Code runs exactly as Anthropic ships it. Only the base URL and the key change. You have two routes:

  • An API key, paid as you go. Pay per token from your balance, and give every key a spend limit, an expiry date and an IP allow-list (key controls). Claude prices are on the Claude API page.
  • A 5abeer plan. The 5abeer AI app for Windows sets up Claude Code on your plan in one click, with no key and no files to edit (what each plan runs). Plans are for the supported apps. To use the models from your own code, create an API key. See the pricing page and the Claude Code app page.

Every setting is explained on the Claude Code docs page.

Questions#

Do I need administrator rights?#

No. The native installer puts Claude Code in your user folder, so a normal PowerShell or Command Prompt window is enough.

Do I need Git for Windows?#

No, but Anthropic recommends it. With it, Claude Code uses Git Bash for its Bash tool; without it, Claude Code runs shell commands through PowerShell. You don't need it inside WSL.

Does Claude Code run on 32-bit Windows?#

No. It needs 64-bit Windows on an x64 or ARM64 processor.

Do I need an Anthropic account?#

Only to sign in with a Claude plan or a Console account. With an API key and a base URL in the settings file, Claude Code doesn't ask you to sign in.

How do I update or uninstall it?#

The native install updates itself, and claude update updates it right away. A WinGet install updates with winget upgrade Anthropic.ClaudeCode and uninstalls with winget uninstall Anthropic.ClaudeCode. To remove a native install, run in PowerShell:

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

Your settings stay in %USERPROFILE%\.claude and %USERPROFILE%\.claude.json until you delete them.

Can I use Claude Code in VS Code on Windows?#

Yes. The VS Code extension ships its own copy of Claude Code, so it works without the terminal install, but it doesn't add claude to your PATH. To give the extension a key, add claudeCode.environmentVariables to your VS Code user settings, as shown in Claude Code in VS Code.

Which model should I pick?#

Start with the default model, claude-sonnet-5.5, which handles most coding tasks. Move to claude-opus-5.5 or claude-fable-5.1 for the hardest problems. Switch with the ANTHROPIC_MODEL setting, or inside Claude Code with /model. The full list with prices is on the models page.

Sources#

Checked on 2026-11-01:

Get started#

Compare a Claude plan with an API key in The cheapest way to use Claude Code, learn the basics in How to get an API key, or set up Codex CLI with an API key.