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 — 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 token
ModelChoose as needed (e.g. claude-sonnet-4-20250514)
  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, you can manually install Claude Code and configure environment variables.

Windows

Install Claude Code

Option 1: PowerShell Native Install (Recommended)

powershell
irm https://cli.anthropic.com/install.ps1 | iex

Option 2: npm Install (Backup)

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

Configure Environment Variables

Temporary (current terminal session):

powershell
$env:ANTHROPIC_AUTH_TOKEN = "your-tokenswitch-token"
$env:ANTHROPIC_BASE_URL = "https://tokenswitch.cc"

Permanent (system environment variables):

powershell
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your-tokenswitch-token", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://tokenswitch.cc", "User")

Restart your terminal window after setting permanent variables.

macOS

Install Claude Code

Option 1: Homebrew Install (Recommended)

bash
brew install claude-code

Option 2: curl Script Install

bash
curl -fsSL https://cli.anthropic.com/install.sh | sh

Option 3: npm Install (Backup)

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

Configure Environment Variables

Edit ~/.zshrc (or ~/.bashrc) and add the following:

bash
export ANTHROPIC_AUTH_TOKEN="your-tokenswitch-token"
export ANTHROPIC_BASE_URL="https://tokenswitch.cc"

Apply the changes:

bash
source ~/.zshrc

Linux

Install Claude Code

Option 1: curl Script Install (Recommended)

bash
curl -fsSL https://cli.anthropic.com/install.sh | sh

Option 2: npm Install (Backup)

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

Configure Environment Variables

Edit ~/.bashrc (or ~/.zshrc) and add the following:

bash
export ANTHROPIC_AUTH_TOKEN="your-tokenswitch-token"
export ANTHROPIC_BASE_URL="https://tokenswitch.cc"

Apply the changes:

bash
source ~/.bashrc

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 or run source ~/.zshrc

Connection Failed / Authentication Error

Possible CauseSolution
Incorrect API KeyCheck that the token is copied completely with no extra spaces
Wrong Base URLConfirm ANTHROPIC_BASE_URL is set to https://tokenswitch.cc
Token group mismatchConfirm you are using a Claude Code dedicated token group
Insufficient balanceLog in to the TokenSwitch console and check your balance
Onboarding not skippedRefer to the "Skip Onboarding" section above

Environment Variables Not Taking Effect

  • Windows: Restart the terminal window, or restart your computer
  • macOS/Linux: Run source ~/.zshrc or source ~/.bashrc
  • Use echo $ANTHROPIC_BASE_URL to verify the variable is set

Next Steps

✅ Claude Code deployment complete!

Harmony, Kindness, Mutual Help, Happiness