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 API key (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, 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:
{
"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 API key |
| Model | Choose as needed, for example claude-opus-4-7 |
- 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
npm install -g @anthropic-ai/claude-codeCreate Configuration File
Config path: %USERPROFILE%\.claude\settings.json
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:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
"ANTHROPIC_BASE_URL": "https://tokenswitch.cc",
"API_TIMEOUT_MS": "600000"
}
}macOS
Install Claude Code
npm install -g @anthropic-ai/claude-codeCreate Configuration File
Config path: ~/.claude/settings.json
mkdir -p ~/.claude
nano ~/.claude/settings.jsonPaste the following content and replace sk-xxxxxxxxxxxxxxxx with your API key:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
"ANTHROPIC_BASE_URL": "https://tokenswitch.cc",
"API_TIMEOUT_MS": "600000"
}
}Linux
Install Claude Code
sudo npm install -g @anthropic-ai/claude-codeCreate Configuration File
Config path: ~/.claude/settings.json
mkdir -p ~/.claude
cat > ~/.claude/settings.json << 'EOF'
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
"ANTHROPIC_BASE_URL": "https://tokenswitch.cc",
"API_TIMEOUT_MS": "600000"
}
}
EOFReplace sk-xxxxxxxxxxxxxxxx with your API key.
Configuration Reference
| Parameter | Description | Value |
|---|---|---|
ANTHROPIC_AUTH_TOKEN | Claude Code auth token | Your API key |
ANTHROPIC_BASE_URL | Anthropic-compatible endpoint | https://tokenswitch.cc |
API_TIMEOUT_MS | Request timeout for long-running tasks | 600000 |
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:
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 |
Connection Failed / Authentication Error
| Possible Cause | Solution |
|---|---|
| Incorrect API key | Check that the key is copied completely with no extra spaces |
| Wrong Base URL | Confirm ANTHROPIC_BASE_URL is set to https://tokenswitch.cc |
| Written to the wrong file | Confirm the config path is ~/.claude/settings.json or %USERPROFILE%\.claude\settings.json |
| Token group mismatch | Confirm you are using an API key that supports Claude Code |
| Insufficient balance | Log in to the TokenSwitch console and check your balance |
| Onboarding not skipped | Refer 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!
- CC-Switch Configuration Tool — Graphically manage multiple providers
- FAQ — More troubleshooting help