Claude Code

Install and configure Claude Code.

Prerequisites

Claude Code CLI requires Node.js (npm is included).

1. Install

Install Claude Code CLI:

Windows PowerShell
npm install --global @anthropic-ai/claude-code
macOS / Linux
npm install --global @anthropic-ai/claude-code

2. Configure Claude Code

Write the following env object to settings.json. If the file exists, merge env and preserve permissions, hooks, and other settings.

settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.get-apikey.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxx-xxx",
    "ANTHROPIC_MODEL": "YOUR_MODEL",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "YOUR_MODEL",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "YOUR_MODEL",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "YOUR_MODEL"
  }
}

Replace sk-xxxxx-xxx and YOUR_MODEL with your actual values.

Windows

$claudeDir = Join-Path $HOME ".claude"
New-Item -ItemType Directory -Force -Path $claudeDir | Out-Null
notepad (Join-Path $claudeDir "settings.json")

macOS / Linux

mkdir -p "$HOME/.claude"
${EDITOR:-vi} "$HOME/.claude/settings.json"
chmod 600 "$HOME/.claude/settings.json"

3. Restart

Fully quit Claude Code and VS Code. Close and reopen the terminal, then start the client again.

4. Confirm a reply

Send one message:

claude -p --model "YOUR_MODEL" "Reply only with OK"

The setup is complete when Claude Code replies OK.

On this page