Claude Code Deployment Guide
Anthropic's official AI coding assistant with intelligent coding, code analysis, and project management right in your terminal.
💡 Prerequisites
- Node.js 18+ runtime (Windows Install | macOS Install | Linux Install)
- TokenSwitch account with a valid Claude Code token (Create Key)
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:
Method 1: CC-Switch Auto Configuration (Recommended)
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:
{
"hasCompletedOnboarding": true
}| OS | File Path |
|---|---|
| Windows | C:\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 Quick Config (Recommended)
CC-Switch provides a graphical interface for one-click configuration, suitable for most users.
Configuration Steps
- Download and install the CC-Switch configuration tool
- Open CC-Switch and go to the Claude Code tab
- Click Add Provider and fill in the following:
| Setting | Value |
|---|---|
| Name | TokenSwitch (or a custom name) |
| API Base URL | https://tokenswitch.cc |
| API Key | Your Claude Code token |
| Model | Choose as needed (e.g. claude-sonnet-4-20250514) |
- 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)
irm https://cli.anthropic.com/install.ps1 | iexOption 2: npm Install (Backup)
npm install -g @anthropic-ai/claude-codeConfigure Environment Variables
Temporary (current terminal session):
$env:ANTHROPIC_AUTH_TOKEN = "your-tokenswitch-token"
$env:ANTHROPIC_BASE_URL = "https://tokenswitch.cc"Permanent (system environment variables):
[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)
brew install claude-codeOption 2: curl Script Install
curl -fsSL https://cli.anthropic.com/install.sh | shOption 3: npm Install (Backup)
npm install -g @anthropic-ai/claude-codeConfigure Environment Variables
Edit ~/.zshrc (or ~/.bashrc) and add the following:
export ANTHROPIC_AUTH_TOKEN="your-tokenswitch-token"
export ANTHROPIC_BASE_URL="https://tokenswitch.cc"Apply the changes:
source ~/.zshrcLinux
Install Claude Code
Option 1: curl Script Install (Recommended)
curl -fsSL https://cli.anthropic.com/install.sh | shOption 2: npm Install (Backup)
npm install -g @anthropic-ai/claude-codeConfigure Environment Variables
Edit ~/.bashrc (or ~/.zshrc) and add the following:
export ANTHROPIC_AUTH_TOKEN="your-tokenswitch-token"
export ANTHROPIC_BASE_URL="https://tokenswitch.cc"Apply the changes:
source ~/.bashrcVerify Installation
Once configured, run the following in your terminal:
claudeIf the Claude Code interactive interface launches successfully, deployment is complete.
Troubleshooting
claude: command not found
| Possible Cause | Solution |
|---|---|
| Not installed correctly | Re-run the installation command |
| PATH not configured | Check that the Node.js global bin directory is in your PATH |
| Terminal not refreshed | Restart the terminal window or run source ~/.zshrc |
Connection Failed / Authentication Error
| Possible Cause | Solution |
|---|---|
| Incorrect API Key | Check that the token is copied completely with no extra spaces |
| Wrong Base URL | Confirm ANTHROPIC_BASE_URL is set to https://tokenswitch.cc |
| Token group mismatch | Confirm you are using a Claude Code dedicated token group |
| Insufficient balance | Log in to the TokenSwitch console and check your balance |
| Onboarding not skipped | Refer to the "Skip Onboarding" section above |
Environment Variables Not Taking Effect
- Windows: Restart the terminal window, or restart your computer
- macOS/Linux: Run
source ~/.zshrcorsource ~/.bashrc - Use
echo $ANTHROPIC_BASE_URLto verify the variable is set
Next Steps
✅ Claude Code deployment complete!
- CC-Switch Configuration Tool — Graphically manage multiple providers
- FAQ — More troubleshooting help