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-).
Setting Value
ANTHROPIC_BASE_URL https://api.calgine.com.cn/anthropic
ANTHROPIC_AUTH_TOKEN The API token you created in the console

Installation & Configuration

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

    node -v
  2. Install Claude Code:

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

        echo 'export ANTHROPIC_AUTH_TOKEN="sk-your-token"' >> ~/.zshrc
        echo 'export ANTHROPIC_BASE_URL="https://api.calgine.com.cn/anthropic"' >> ~/.zshrc
        source ~/.zshrc
        

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

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

    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

Command Description
claude Start interactive mode
claude "task description" Run a one-off task
claude commit Generate a Git commit message and commit
/help List all available commands
/clear Clear the current conversation history
/model Switch the model in use
Scenario Recommended Model
Everyday coding assistance claude-sonnet-4-5
Complex tasks & deep refactoring claude-opus-4-5-20251101

Next Steps

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