KLINCH / Blog

· 2 min read

Claude Code on Windows: setup and common errors

Most Claude Code problems on Windows come from macOS commands that do not work in PowerShell or CMD. Here is a setup that works the first time, and fixes for the usual errors.

Install

  1. Install Node.js 18 or newer from nodejs.org (the LTS button), then close and reopen the terminal.
  2. Install Claude Code: npm install -g @anthropic-ai/claude-code.
  3. Open a terminal in your project folder. Check which one it is: blue PowerShell (the default in Windows 10/11 and VS Code) or black CMD.

Set the key in PowerShell

$env:ANTHROPIC_BASE_URL="https://api.klinch.cloud"
$env:ANTHROPIC_AUTH_TOKEN="kl_live_…"
claude

Set the key in CMD

set ANTHROPIC_BASE_URL=https://api.klinch.cloud
set ANTHROPIC_AUTH_TOKEN=kl_live_…
claude

These last until the window is closed. To keep them, create C:\Users\name\.claude\settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.klinch.cloud",
    "ANTHROPIC_AUTH_TOKEN": "kl_live_…",
    "ANTHROPIC_MODEL": "claude-sonnet-5-5"
  }
}

Common errors

What you seeWhat to do
It asks to sign in to Anthropic or pick a planThe variables did not reach it. export does not work on Windows: PowerShell needs $env:, CMD needs set. settings.json is the most reliable.
Auth conflict, the old account is usedRun /logout in Claude Code, close it and remove the ANTHROPIC_API_KEY variable.
404 Not foundANTHROPIC_BASE_URL has no /v1 and no trailing slash.
401 Invalid API keyA space or quote got into the key. Copy it with the copy button; the key starts with kl_live_.
Worked yesterday, asks to sign in today$env: and set last until the window closes. Use settings.json or setx.
«claude» is not recognizedThe terminal was opened before the install. Close every terminal window and open a new one.

A step by step guide with a key check is in the cabinet under Connect. More on running it without a subscription: Claude Code without a Max plan.

Try KLINCH

Claude, GPT, Gemini, DeepSeek and Grok on one key at a tenth of the official price.

More posts

All posts →