Skip to content

Claude Code Deployment Guide

Anthropic's official AI coding assistant with intelligent coding, code analysis, and project management right in your terminal.

Prerequisites

Skip Onboarding (Required for Proxy Channels)

When using Claude Code through proxy channels like TokenSwitch, the first launch will enter the official onboarding flow and attempt to connect to Anthropic's servers, preventing normal usage. Use one of the following methods to skip onboarding:

Using the CC-Switch configuration tool automatically handles onboarding skip, with no manual steps needed.

Method 2: Manually Edit Configuration File

Create or edit the ~/.claude.json file in your home directory with the following content:

json
{
  "hasCompletedOnboarding": true
}
OSFile Path
WindowsC:\Users\<username>\.claude.json
macOS/Users/<username>/.claude.json
Linux/home/<username>/.claude.json

Important

This must be done before running Claude Code for the first time, otherwise it will enter the official onboarding flow.

CC-Switch provides a graphical interface for one-click configuration, suitable for most users.

Configuration Steps

  1. Download and install the CC-Switch configuration tool
  2. Open CC-Switch and go to the Claude Code tab
  3. Click Add Provider and fill in the following:
SettingValue
NameTokenSwitch (or a custom name)
API Base URLhttps://tokenswitch.cc
API KeyYour Claude Code API key
ModelChoose as needed, for example claude-opus-4-7
  1. After saving, you can quickly switch between providers via the system tray icon

System Tray Quick Switch

After installation, CC-Switch stays in the system tray. Right-click the tray icon to switch between providers instantly without reopening the configuration window.

Manual Installation and Configuration

If you prefer not to use CC-Switch, install Claude Code manually and write the local Claude Code settings file.

Configuration File

Claude Code should store proxy settings in the env field of settings.json, rather than only setting temporary shell environment variables.

Windows

Install Claude Code

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

Create Configuration File

Config path: %USERPROFILE%\.claude\settings.json

powershell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude"
notepad "$env:USERPROFILE\.claude\settings.json"

Paste the following content and replace sk-xxxxxxxxxxxxxxxx with your API key:

json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
    "ANTHROPIC_BASE_URL": "https://tokenswitch.cc",
    "API_TIMEOUT_MS": "600000"
  }
}

macOS

Install Claude Code

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

Create Configuration File

Config path: ~/.claude/settings.json

bash
mkdir -p ~/.claude
nano ~/.claude/settings.json

Paste the following content and replace sk-xxxxxxxxxxxxxxxx with your API key:

json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
    "ANTHROPIC_BASE_URL": "https://tokenswitch.cc",
    "API_TIMEOUT_MS": "600000"
  }
}

Linux

Install Claude Code

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

Create Configuration File

Config path: ~/.claude/settings.json

bash
mkdir -p ~/.claude

cat > ~/.claude/settings.json << 'EOF'
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
    "ANTHROPIC_BASE_URL": "https://tokenswitch.cc",
    "API_TIMEOUT_MS": "600000"
  }
}
EOF

Replace sk-xxxxxxxxxxxxxxxx with your API key.

Configuration Reference

ParameterDescriptionValue
ANTHROPIC_AUTH_TOKENClaude Code auth tokenYour API key
ANTHROPIC_BASE_URLAnthropic-compatible endpointhttps://tokenswitch.cc
API_TIMEOUT_MSRequest timeout for long-running tasks600000

Note

Claude Code / Anthropic native base URLs usually do not include /v1. If a tool uses ANTHROPIC_API_KEY instead, enter the same sk- API key.

Verify Installation

Once configured, run the following in your terminal:

bash
claude

If the Claude Code interactive interface launches successfully, deployment is complete.

Troubleshooting

claude: command not found

Possible CauseSolution
Not installed correctlyRe-run the installation command
PATH not configuredCheck that the Node.js global bin directory is in your PATH
Terminal not refreshedRestart the terminal window

Connection Failed / Authentication Error

Possible CauseSolution
Incorrect API keyCheck that the key is copied completely with no extra spaces
Wrong Base URLConfirm ANTHROPIC_BASE_URL is set to https://tokenswitch.cc
Written to the wrong fileConfirm the config path is ~/.claude/settings.json or %USERPROFILE%\.claude\settings.json
Token group mismatchConfirm you are using an API key that supports Claude Code
Insufficient balanceLog in to the TokenSwitch console and check your balance
Onboarding not skippedRefer to the "Skip Onboarding" section above

Configuration File Not Taking Effect

  • Check that the JSON formatting is valid
  • Check that the file path is correct: ~/.claude/settings.json
  • Restart Claude Code and your terminal after changing settings

Next Steps

Claude Code deployment complete!

Harmony, Kindness, Mutual Help, Happiness