Skip to content

Integrating Claude Code ​

Anthropic's official CLI AI coding tool. It supports code generation, refactoring, debugging, and automated commits, and connects to Calgine Tokens via the Anthropic-compatible protocol.

Claude Code is a CLI AI coding assistant from Anthropic that lets you interact with your codebase in natural language and complete the full development workflow from requirements to commits.

Prerequisites ​

  1. Sign up at the Calgine Tokens Console.
  2. Go to Workspace → API Tokens, click "Add Token", and copy the API Key after creation (starts with sk-).
SettingValue
ANTHROPIC_BASE_URLhttps://api.calgine.com.cn/anthropic
ANTHROPIC_AUTH_TOKENThe API token you created in the console

Installation & Configuration ​

  1. Install Node.js: make sure Node.js 18+ is installed:

    bash
    node -v
  2. Install Claude Code:

    bash
    npm install -g @anthropic-ai/claude-code
  3. Set environment variables (choose one):

    bash
    echo 'export ANTHROPIC_AUTH_TOKEN="sk-your-token"' >> ~/.zshrc
    echo 'export ANTHROPIC_BASE_URL="https://api.calgine.com.cn/anthropic"' >> ~/.zshrc
    source ~/.zshrc
    bash
    echo 'export ANTHROPIC_AUTH_TOKEN="sk-your-token"' >> ~/.bashrc
    echo 'export ANTHROPIC_BASE_URL="https://api.calgine.com.cn/anthropic"' >> ~/.bashrc
    source ~/.bashrc
    powershell
    [Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-your-token", "User")
    [Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.calgine.com.cn/anthropic", "User")

    Alternatively, write them into Claude Code's config file ~/.claude/settings.json:

    json
    {
      "env": {
        "ANTHROPIC_AUTH_TOKEN": "sk-your-token",
        "ANTHROPIC_BASE_URL": "https://api.calgine.com.cn/anthropic"
      }
    }
  4. Enter your project directory and launch:

    bash
    cd your-project-folder
    claude

Verify the Setup ​

After launching claude, ask any question in the interactive prompt (e.g., "describe the current project structure"). A normal response means the integration works. You can also run /status to check the current Base URL and model.

Common Commands ​

CommandDescription
claudeStart interactive mode
claude "task description"Run a one-off task
claude commitGenerate a Git commit message and commit
/helpList all available commands
/clearClear the current conversation history
/modelSwitch the model in use
ScenarioRecommended Model
Everyday coding assistanceclaude-sonnet-4-5
Complex tasks & deep refactoringclaude-opus-4-5-20251101

Note

Claude Code's agent mode calls the model frequently and consumes far more tokens than regular chat. Keep an eye on your quota and rate limits — see Rate Limits.

Next Steps ​

  • Cline: Use the same Claude models inside VS Code
  • Prompt Caching: Reduce costs in long-context scenarios