Claude Code

Install Claude Code on Windows or macOS, manually configure the API address and Key, and start a conversation.

Follow the Windows or macOS steps to install, configure, and start using Claude Code.

Windows

1. Install

Find PowerShell in the Start menu, open it, paste the installation command, and press Enter:

winget install --id Anthropic.ClaudeCode --exact

After installation, close and reopen PowerShell and check the version:

claude --version

Continue when a version number appears. See the official installation guide for other installation methods.

2. Configure

Prepare an API Key.

The configuration file is %USERPROFILE%\.claude\settings.json:

  1. Press Win + E to open File Explorer.
  2. Enter %USERPROFILE%\.claude in the address bar and press Enter.
  3. Right-click settings.json and choose Open with → Notepad, or use VS Code.
  4. If the folder is missing, create .claude inside %USERPROFILE%. If the file is missing, create it in Notepad.

Enter the following configuration:

settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.get-apikey.com",
    "ANTHROPIC_AUTH_TOKEN": "your-api-key"
  }
}

Replace your-api-key with your API Key. Use the address shown, without a trailing /v1.

Press Ctrl + S to save. For a new file, use Save As, choose the .claude folder, name the file settings.json, and select All files and UTF-8. Show file extensions in File Explorer and check that the filename is not settings.json.txt.

For an existing file, make a backup and merge the fields into the same env object, keeping other settings. Use straight double quotes and no trailing comma after the last JSON entry.

3. Use

  1. Open your project folder in File Explorer.
  2. Type powershell in the address bar and press Enter to open a terminal in that folder.
  3. Run:
claude

Confirm the project prompts and send Reply only OK. Once you receive a reply, describe a coding task in the same input box. After editing the configuration, exit and restart Claude Code.

macOS

1. Install

Press Command + Space to find and open Terminal. Paste the installation command and press Enter:

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

After installation, close and reopen Terminal and check the version:

claude --version

Continue when a version number appears. See the official installation guide for other installation methods.

2. Configure

Prepare an API Key.

The configuration file is ~/.claude/settings.json:

  1. Open Finder and press Command + Shift + G.
  2. Enter ~/.claude and select Go.
  3. Open settings.json in TextEdit or VS Code. Press Command + Shift + . to show hidden files if needed.
  4. If the folder or file is missing, open VS Code, choose File → Open Folder, press Command + Shift + G, and enter ~ to open your home directory. In the Explorer sidebar, create a .claude folder and a settings.json file inside it.

Enter the following configuration:

settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.get-apikey.com",
    "ANTHROPIC_AUTH_TOKEN": "your-api-key"
  }
}

Replace your-api-key with your API Key. Use the address shown, without a trailing /v1.

Press Command + S to save. In TextEdit, choose Format → Make Plain Text and keep the filename settings.json.

For an existing file, make a backup and merge the fields into the same env object, keeping other settings. Use straight double quotes and no trailing comma after the last JSON entry.

3. Use

  1. Open Terminal and type cd with a trailing space.
  2. Drag your project folder from Finder into the terminal and press Enter to enter that project.
  3. Run:
claude

Confirm the project prompts and send Reply only OK. Once you receive a reply, describe a coding task in the same input box. After editing the configuration, exit and restart Claude Code.

On Linux, use the same installation command and configuration, with the file at ~/.claude/settings.json.

Use in VS Code

Install the official VS Code Claude Code extension to enter tasks in the sidebar. It shares configuration with the CLI under the same OS user.

The Claude Code sidebar in VS Code on Windows.

Common problems

SymptomCheck first
401 or repeated login promptsKey, address, and conflicting authentication variables
Command not foundReopen the terminal and run claude --version
Old sessions missingOriginal project, user, and CLAUDE_CONFIG_DIR; do not clear .claude

If CLAUDE_CONFIG_DIR is set, edit settings.json in that directory. This configuration uses ANTHROPIC_AUTH_TOKEN; if env also contains ANTHROPIC_API_KEY, back up the file and remove that field to avoid conflicting credentials.

On this page