Claude Code Setup

This section covers the complete installation process for Claude Code CLI on macOS and Windows, and how to connect to the DDShub relay node.

Mac Installation

Install Node.js via Brew

Claude Code requires Node.js. We recommend using Homebrew to manage Node.js versions.

1

Install Homebrew

bash
# Download and install Homebrew
curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash
2

Install Node.js

bash
# Download and install Node.js
brew install node

# Check Node.js version
node -v

# Check NPM version
npm -v

Install Claude Code

Claude Code is the official AI coding CLI tool from Anthropic, installed globally via npm.

1

Install Claude Code CLI globally

bash
npm install -g @anthropic-ai/claude-code
2

Verify installation

bash
claude --version
# Claude Code x.x.x

If you encounter permission errors, prefix the command with sudo, or configure the npm global directory to your user directory.

3

Run health check

bash
claude doctor

This command checks your environment configuration, including API connectivity.

Tip
If you encounter network issues during installation, temporarily set the npm registry: npm config set registry https://registry.npmmirror.com
Warning
Claude Code v2.1.68 or above is required.

Configure AUTH_TOKEN & BASE_URL

Configure the DDShub API relay so Claude Code connects to Anthropic services through our accelerated endpoint.

Note
Before this step, make sure you have registered on DDShub and created an API Token. If not, please read the "Token Creation & API Key" section first.

Method 1: Environment Variables (Recommended)

Add the following to your shell config (~/.zshrc or ~/.bashrc):

~/.zshrc
# DDShub - Claude Code relay config
export ANTHROPIC_AUTH_TOKEN="sk-xxxxxxxxxxxxxxxx"   # Replace with your API Key
export ANTHROPIC_BASE_URL="https://www.ddshub.cc"

After saving, reload the config:

bash
source ~/.zshrc

# Verify config
echo $ANTHROPIC_AUTH_TOKEN
echo $ANTHROPIC_BASE_URL

Method 2: Interactive Login

Run the claude command directly and the CLI will guide you through setup:

bash
claude

# You will be prompted to enter:
# > Enter your API key: sk-xxx
# > Enter API base URL (optional): https://www.ddshub.cc
Warning
Keep your API Token secure. Never commit it to Git or share it. If compromised, revoke it immediately in the DDShub dashboard.

Verify Connection

After configuration, run in any project directory:

bash
claude "Hello, introduce yourself in one sentence"

# Expected output:
# I am Claude, an AI assistant made by Anthropic.

Windows Installation

Warning
Requirements: Windows 10 (version 1809 / build 17763) or later

Install Node.js via PowerShell

We recommend installing Node.js via the Chocolatey package manager for easy version management.

1

Open PowerShell as Administrator

Right-click the Start menu → select "Windows PowerShell (Admin)" or "Terminal (Admin)".

2

Install Chocolatey and Node.js

powershell
# Download and install Chocolatey
powershell -c "irm https://community.chocolatey.org/install.ps1|iex"

# Install Node.js via Chocolatey
choco install nodejs --version="24.13.0"

# Check Node.js version
node -v

# Check NPM version
npm -v

Install Claude Code

Once Node.js is installed, install Claude Code CLI globally via npm.

1

Install Claude Code CLI globally

powershell
npm install -g @anthropic-ai/claude-code
2

Verify installation

powershell
claude --version
# Claude Code x.x.x

If you encounter permission errors, reopen PowerShell as Administrator.

Tip
If npm installation is slow, temporarily switch the registry: npm config set registry https://registry.npmmirror.com
Warning
Claude Code v2.1.68 or above is required.

Configure AUTH_TOKEN & BASE_URL

On Windows, we recommend persisting the config via System Environment Variables or a PowerShell Profile.

Note
Before this step, make sure you have registered on DDShub and created an API Token. If not, please read the "Token Creation & API Key" section first.

Method 1: PowerShell Profile (Recommended)

Run the following in PowerShell to open your Profile file:

$PROFILE
# Show Profile path
echo $PROFILE

# Edit Profile (creates it if it does not exist)
notepad $PROFILE

Add the following to the end of the file and save:

$PROFILE
# DDShub - Claude Code relay config
$env:ANTHROPIC_AUTH_TOKEN = "sk-xxxxxxxxxxxxxxxx"   # Replace with your API Key
$env:ANTHROPIC_BASE_URL   = "https://www.ddshub.cc"

Reopen PowerShell for the config to take effect, or run immediately:

powershell
. $PROFILE

Method 2: System Environment Variables (GUI)

Suitable for users who prefer a GUI:

1

Open System Environment Variables

Right-click "This PC" → "Properties" → "Advanced system settings" → "Environment Variables", or search for "environment variables" in the Start menu.

2

Create New User Variables

In the "User variables" section, click "New" and add:

VariableValue
ANTHROPIC_AUTH_TOKENsk-xxxxxxxx...
ANTHROPIC_BASE_URLhttps://www.ddshub.cc
3

Restart terminal and verify

powershell
echo $env:ANTHROPIC_AUTH_TOKEN
echo $env:ANTHROPIC_BASE_URL

Verify Connection

After configuration, run in any project directory:

powershell
claude "Hello, introduce yourself in one sentence"

# Expected output:
# I am Claude, an AI assistant made by Anthropic.
Warning
Keep your API Token secure. Never commit it to Git or share it. If compromised, revoke it immediately in the DDShub dashboard.