👾 4.1 Claude Code Detailed Setup Guide
Claude Code is Anthropic’s official terminal‑native AI coding assistant. It can read entire projects, run system commands, and even fix bugs autonomously.
Because the official version is tightly coupled with Anthropic’s own authentication, we need a specific configuration to bypass those limits and connect directly to Old Dog AI’s fast, OpenAI‑compatible endpoint.
📥 Step 1: Install Claude Code
Run the following in your terminal (Terminal / CMD / PowerShell) based on your OS.
Option A: Install on the machine (officially recommended)
macOS / Linux / WSL:
bashcurl -fsSL [https://claude.ai/install.sh](https://claude.ai/install.sh)Windows PowerShell:
powershellirm [https://claude.ai/install.ps1](https://claude.ai/install.ps1)Windows CMD:
bashcurl -fsSL [https://claude.ai/install.cmd](https://claude.ai/install.cmd) -o install.cmd && install.cmd && del install.cmd
Option B: Install via NPM (for developers with Node already set up) ```bash npm install -g @anthropic-ai/claude-code
```
⚠️ Note: Do not use
sudo npm install -g, as it may cause permission issues and security risks.
⚙️ Step 2: Configure endpoint and key
To make Claude Code connect to our server, override ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. Choose one of the following:
🟢 Method A: Visual setup with CC Switch (recommended for beginners)
If you don’t want to manage environment variables manually, use CC Switch, a third‑party open‑source environment manager.
- Download: go to the CC‑Switch GitHub Releases page and download the installer for your OS (Windows users typically choose the
.msi). - Select group: open the app and select
Claudein the top group bar. - Add provider: in the provider panel, choose Custom config.
- Provider name:
Old Dog AI
Paste config: paste the following JSON (replace with your own API key):
json{ "env": { "ANTHROPIC_BASE_URL": "[https://api.olddog.shop](https://api.olddog.shop)", "ANTHROPIC_AUTH_TOKEN": "sk-您的专属API_KEY" } }Enable: go back to the main screen and click Enable next to
Old Dog AI. When it shows “In use”, the config is active.
🔴 Method B: Edit the config file manually (power users)
[cite_start]If you prefer not to install an extra manager, you can edit Claude Code’s underlying config file and set environment variables there.
- Locate the file: Claude Code stores configuration in the
.claudefolder under your home directory.- Windows:
C:\Users\您的用户名\.claude\settings.json - macOS / Linux:
~/.claude/settings.json
- Windows:
- Update content: open
settings.jsonand use the following structure (replacesk-xxxxwith your Old Dog AI key):json{ "env": { "ANTHROPIC_BASE_URL": "[https://api.olddog.shop](https://api.olddog.shop)", "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxx" } }
⚠️ Step 3: First‑run initialization (important)
This is where many users get stuck. Some people find that after editing settings.json, Claude Code still connects to the official server. That happens because the first run after installation requires a one‑time initialization using temporary environment variables; only then will it consistently load the config file.
Run the matching initialization command for your shell:
- Windows (PowerShell):powershell
$env:ANTHROPIC_BASE_URL="[https://api.olddog.shop](https://api.olddog.shop)" $env:ANTHROPIC_AUTH_TOKEN="sk-您的API_KEY" claude - Windows (CMD):cmd
set ANTHROPIC_BASE_URL=[https://api.olddog.shop](https://api.olddog.shop) set ANTHROPIC_AUTH_TOKEN=sk-您的API_KEY claude - macOS / Linux:bash
export ANTHROPIC_BASE_URL="[https://api.olddog.shop](https://api.olddog.shop)" export ANTHROPIC_AUTH_TOKEN="sk-您的API_KEY" claude
🚀 Step 4: Launch and verify
- Go to your project:
cdinto your project directory. - Start: run
claude. - Verify: if you see the familiar chat UI and a prompt like “hello” returns a correct reply, you’re successfully using Claude Code via Old Dog AI.
💡 Extra tip: Skip onboarding
If you want to go straight into the chat without onboarding prompts, create a .claude.json file in your home directory (note: this is not the file inside the .claude folder) and add:
- Path:
~/.claude.jsonorC:\Users\用户名\.claude.json
{
"hasCompletedOnboarding": true
}