CoreCodeDocs

Connect

Claude Code on Windows

There are two ways to use Claude Code on Windows: run it in PowerShell directly, or install it in WSL and use it as on Linux. This page covers installing, configuring and troubleshooting on native Windows; WSL is in the last section.

Install

Recommended: native install

Open PowerShell (no administrator needed) and run:

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

When it finishes, close that window and open a new PowerShell, then run claude --version; a version number means it worked. The installer adds the folder holding claude to your user PATH, which only new terminals see.

Or: npm install

With Node.js 22 or later installed, you can also run:

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

A mainland npm mirror helps when downloads are slow. Use one method, not both: with both installed, which claude runs is unpredictable.

Git for Windows (optional)

Git for Windows is optional on native Windows. Without it, Claude Code runs commands through PowerShell; with it, Claude Code uses Git Bash, and the Bash and Monitor tools need Git Bash (see the official setup guide). Install it if you already use Git.

If Git is installed but Claude Code cannot find Git Bash, point CLAUDE_CODE_GIT_BASH_PATH in the env block of settings.json at bash.exe, for example "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe" (backslashes are doubled in JSON).

Configure

Option 1: the settings file (recommended)

Type %USERPROFILE%\.claude in File Explorer's address bar (create a .claude folder if there is none), and create or edit settings.json in Notepad or VS Code:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://corecode.live",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-key"
  }
}

Save it as UTF-8. If the file already has content, merge only the env block and keep the commas and quotes balanced. PowerShell, Git Bash and the VS Code extension all read this file, so one edit covers them all.

Option 2: environment variables

To try it in the current window only:

$env:ANTHROPIC_BASE_URL = "https://corecode.live"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-key"
claude

To make it permanent, write user environment variables with setx, then open a new terminal (setx does not change windows already open):

setx ANTHROPIC_BASE_URL https://corecode.live
setx ANTHROPIC_AUTH_TOKEN sk-your-key

Do not also set ANTHROPIC_API_KEY, or you get an Auth conflict; see Errors.

Check it works

claude -p "reply ok"

An "ok" means you are connected. Type /status in Claude Code and the Base URL should be https://corecode.live.

Common problems

SymptomWhat to do
The term 'claude' is not recognized, or "not recognized as an internal or external command"Open a new terminal and try again. If it persists, check that the Claude Code install folder is in your user PATH; for an npm install, check that the folder shown by npm config get prefix is.
running scripts is disabled on this systemPowerShell's execution policy blocks the claude.ps1 that npm creates. Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned and open a new terminal, or use the native install.
First launch says Unable to connect to Anthropic servicesAdd "hasCompletedOnboarding": true at the top level of %USERPROFILE%\.claude.json; see Errors.
Still on the official service after the change, or asked to /loginCheck that settings.json is in %USERPROFILE%\.claude\ and Notepad did not append .txt to its name, then open a new terminal.
Garbled Chinese textRun Claude Code in Windows Terminal, and save the settings file as UTF-8.

VS Code and JetBrains

The Claude Code extension for VS Code shares %USERPROFILE%\.claude\settings.json with the command line. After option 1, quit VS Code completely and reopen it. If you signed in to the extension with a claude.ai account, sign out first. The JetBrains plugin runs the command-line version in the IDE terminal, so it is configured the same way.

With WSL

If you already develop in WSL, install Claude Code inside it and set it up as on Linux:

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

Its settings live in WSL's own ~/.claude/settings.json, separate from Windows' %USERPROFILE%\.claude. Keep projects on the WSL file system (such as ~/project); it is much faster than /mnt/c.

More settings and everyday commands are in Claude Code.