1. Preparation#
1. Install Claude Code CLI#
Install the CLI globally with npm.
2. Install and start CCR#
Install Claude Code Router (CCR) and run ccr start. When the output shows a local address such as [redacted-ip]:3456, the local CCR service has started.
CCR is like a reverse proxy: you tell Claude Code to send requests through CCR, and CCR decides which backend model service receives them.
2. Set the CCR API key#
After CCR starts, configure an authentication key.
Config file paths:
- Windows:
%UserProfile%\.claude-code-router\config.json - macOS / Linux:
~/.claude-code-router/config.json
Find the "APIKEY": "" field and fill in a custom fake API key for local authentication, for example sk-ant-local-ccr-1234567890.
This is not the real large-model API key. It is a local access token used by CCR.
Then open the CCR UI with ccr ui, add the model service you want to use, and enter the real model API key in that provider configuration.
3. Redirect Claude Code to CCR with environment variables#
Claude Code supports gateway and auth configuration through environment variables. Set:
ANTHROPIC_BASE_URL→http://[redacted-ip]:3456ANTHROPIC_AUTH_TOKEN→ theAPIKEYconfigured above
On Windows, use administrator PowerShell and setx for permanent variables, plus $env: assignments for the current window. On macOS/Linux, add export lines to your shell profile such as ~/.zshrc, then source it.
Verify with echo $env:ANTHROPIC_BASE_URL and echo $env:ANTHROPIC_AUTH_TOKEN on PowerShell, or echo $ANTHROPIC_BASE_URL and echo $ANTHROPIC_AUTH_TOKEN on macOS/Linux.
4. Verify CCR#
- Make sure CCR is running with
ccr start. - Open a new VS Code terminal so it inherits the environment variables.
- Start Claude Code with
claude. - Run
/statusand/doctorto check the Anthropic Base URL and auth token source.
Expected status information includes the CCR base URL and ANTHROPIC_AUTH_TOKEN as the token source.
5. Integrate with VS Code#
Recommended use: start claude inside the VS Code integrated terminal. If the status bar shows an IDE marker, the IDE integration is mounted. If you start from an external terminal, use /ide in the TUI to mount VS Code manually.
Running
ccr codeonly starts the CLI. It does not automatically mount the VS Code extension. Start from the VS Code terminal for the best result.
Fix missing code command on Windows#
If /ide cannot find VS Code, add VS Code’s bin directory to PATH and restart VS Code. The preserved PowerShell script below locates common install paths, updates the user PATH without overwriting existing values, verifies where.exe code, and restarts VS Code.
Preserved command, configuration, and prompt blocks#
| |
| |
| |
| |
| |
| |
| |
| |
| |










