# 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: 2026-11-01

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:

PowerShell:

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

Command Prompt:

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

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

| Way | Install | Updates |
| --- | --- | --- |
| Native installer | The PowerShell or CMD command above | Automatic, or run `claude update` |
| WinGet | `winget install Anthropic.ClaudeCode` | Manual: `winget upgrade Anthropic.ClaudeCode` |
| npm (Node.js 22 or later) | `npm install -g @anthropic-ai/claude-code` | Automatic, 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:

| Setup | Sandboxing | Install with |
| --- | --- | --- |
| Native Windows | Not supported | The PowerShell or CMD installer |
| WSL 2 | Supported | The Linux installer, inside the WSL terminal |
| WSL 1 | Not supported | The Linux installer, inside the WSL terminal |

Inside a WSL terminal, the Linux installer is:

```bash
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](https://5abeer.ai/en/docs/start/keys.md#create)), then add these settings:

`~/.claude/settings.json`

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

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:

| Format | Base URL | Key header |
| --- | --- | --- |
| OpenAI | `https://api.5abeer.ai/v1` | `Authorization: Bearer <KEY>` |
| Anthropic | `https://api.5abeer.ai` | `x-api-key: <KEY>` |
| Gemini | `https://api.5abeer.ai/v1beta` | `x-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.

```bash
curl --request POST "https://api.5abeer.ai/v1/messages" \
  --header "x-api-key: $KHABEER_API_KEY" \
  --header "Content-Type: application/json" \
  --header "anthropic-version: 2023-06-01" \
  --data '{"model":"claude-sonnet-5.5","max_tokens":512,"messages":[{"role":"user","content":"Write a product idea in one sentence."}]}'
```

```python
import os
import requests

response = requests.post(
    "https://api.5abeer.ai/v1/messages",
    headers={
        "x-api-key": os.environ['KHABEER_API_KEY'],
        "Content-Type": "application/json",
        "anthropic-version": "2023-06-01",
    },
    json={
    "model": "claude-sonnet-5.5",
    "max_tokens": 512,
    "messages": [
        {
            "role": "user",
            "content": "Write a product idea in one sentence."
        }
    ]
},
    stream=False,
    timeout=60,
)

response.raise_for_status()
print(response.json())
```

## 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`](https://5abeer.ai/en/docs/help/errors.md#INVALID_API_KEY) means the key is wrong or deleted, and [`INSUFFICIENT_BALANCE`](https://5abeer.ai/en/docs/help/errors.md#INSUFFICIENT_BALANCE) means your balance doesn't cover the request. Every code is in [Errors and fixes](https://5abeer.ai/en/docs/help/errors.md).

## 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](https://5abeer.ai/en/docs/start/keys.md#controls)). Claude prices are on the [Claude API page](https://5abeer.ai/en/api/claude).
- **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](https://5abeer.ai/en/docs/subscriptions/plan-apps.md#claude-code)). Plans are for the supported apps. To use the models from your own code, create an API key. See the [pricing page](https://5abeer.ai/en/pricing) and the [Claude Code app page](https://5abeer.ai/en/apps/claude-code).

Every setting is explained on the [Claude Code docs page](https://5abeer.ai/en/docs/apps/claude-code.md).

## 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](https://5abeer.ai/en/guides/claude-code-vscode).

### Which model should I pick?

Start with the default model, [`claude-sonnet-5.5`](https://5abeer.ai/en/models/claude-sonnet-5.5), which handles most coding tasks. Move to [`claude-opus-5.5`](https://5abeer.ai/en/models/claude-opus-5.5) or [`claude-fable-5.1`](https://5abeer.ai/en/models/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](https://5abeer.ai/en/models).

## Sources

Checked on 2026-11-01:

- Claude Code docs: [Advanced setup](https://code.claude.com/docs/en/setup)
- Claude Code docs: [Troubleshoot installation and login](https://code.claude.com/docs/en/troubleshoot-install)
- Claude Code docs: [Other LLM gateways](https://code.claude.com/docs/en/llm-gateway)
- Claude Code docs: [Connect Claude Code to an LLM gateway](https://code.claude.com/docs/en/llm-gateway-connect)

> 5abeer is an independent service, not affiliated with OpenAI, Anthropic or Google.

## Get started

Compare a Claude plan with an API key in [The cheapest way to use Claude Code](https://5abeer.ai/en/guides/claude-code-cheapest-way), learn the basics in [How to get an API key](https://5abeer.ai/en/guides/ai-api-key-guide), or set up [Codex CLI with an API key](https://5abeer.ai/en/guides/codex-cli-api-key).
