Installation
Install and configure Claude Code on Windows, macOS, and Linux
On This Page
⚡ Recommended: one-click setup — a single command does everything on this page (endpoint speed test, config, Node.js / Claude Code install, connectivity check; no sudo). Keep reading for manual installation.
# macOS / Linux
curl -fsSL https://qcode.cc/install/claude-code.sh | bash
# Windows PowerShell
irm https://qcode.cc/install/claude-code.ps1 | iex
See One-Click Setup Script for flags, troubleshooting and rollback.
📖 Wondering what to put in
ANTHROPIC_BASE_URL, or which of the four access domains to pick? See Endpoints & API Paths.
Follow this guide to easily install and use Claude Code on your computer. The entire process takes just 5 minutes.
Prerequisites¶
Claude Code requires Node.js to run. Please ensure you have Node.js 18.0 or above installed on your computer (22 LTS recommended).
Windows¶
Step 1: Install Node.js¶
Option A: Official Download (Recommended)¶
-
Open your browser and visit https://nodejs.org/
-
Click the "LTS" version download (recommended Long Term Support version)
-
Double-click the downloaded
.msifile -
Follow the installation wizard using default settings
Option B: Using Package Manager¶
If you have Chocolatey or Scoop installed:
# Using Chocolatey
choco install nodejs
# Or using Scoop
scoop install nodejs
Verify Installation¶
node --version
npm --version
Step 2: Install Claude Code¶
Open PowerShell or CMD:
npm install -g @anthropic-ai/claude-code
Verify installation:
claude --version
Step 3: Set Environment Variables¶
Temporary (Current Session)¶
$env:ANTHROPIC_BASE_URL = "https://api.qcode.cc/api"
$env:ANTHROPIC_AUTH_TOKEN = "your-api-key"
Permanent (Recommended)¶
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.qcode.cc/api", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your-api-key", [System.EnvironmentVariableTarget]::User)
Replace
your-api-keywith your actual key from QCode.cc Dashboard.
Verify the settings¶
echo $env:ANTHROPIC_BASE_URL
echo $env:ANTHROPIC_AUTH_TOKEN
Step 4: Start Using¶
# Go to your project directory
cd C:\path\to\your\project
# Start Claude Code
claude
Windows FAQ¶
Permission error?
-
Run PowerShell as Administrator
-
Or point npm at your user directory:
npm config set prefix %APPDATA%\npm
PowerShell execution policy error?
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Environment variables not taking effect?
-
After setting them permanently, restart PowerShell or CMD
-
Or sign out of Windows and back in
macOS¶
Step 1: Install Node.js¶
Option A: Using Homebrew (Recommended)¶
brew update
brew install node
Option B: Official Download¶
-
Visit https://nodejs.org/
-
Download the macOS LTS version
-
Open the downloaded
.pkgfile -
Follow the installation instructions
Verify Installation¶
node --version
npm --version
Step 2: Install Claude Code¶
Option A: Using npm¶
npm install -g @anthropic-ai/claude-code
If you encounter permission issues:
sudo npm install -g @anthropic-ai/claude-code
Option B: Using Homebrew¶
brew install --cask claude-code
Step 3: Set Environment Variables¶
Temporary (Current Session)¶
export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"
export ANTHROPIC_AUTH_TOKEN="your-api-key"
Permanent (Recommended)¶
Edit your shell configuration file:
# For zsh (macOS default)
echo 'export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="your-api-key"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"' >> ~/.bash_profile
echo 'export ANTHROPIC_AUTH_TOKEN="your-api-key"' >> ~/.bash_profile
source ~/.bash_profile
Replace
your-api-keywith your actual key from QCode.cc Dashboard.
Step 4: Start Using¶
# Go to your project directory
cd /path/to/your/project
# Start Claude Code
claude
macOS FAQ¶
Permission error?
-
Install with sudo:
sudo npm install -g @anthropic-ai/claude-code -
Or point npm at your user directory:
npm config set prefix ~/.npm-global
macOS blocks the binary?
-
Open "System Settings" → "Privacy & Security"
-
Click "Open Anyway" or "Allow"
Linux / WSL2¶
Step 1: Install Node.js¶
Option A: Using NodeSource (Recommended)¶
# Add the NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
# Install Node.js
sudo apt-get install -y nodejs
Option B: Using System Package Manager¶
# Ubuntu/Debian
sudo apt update
sudo apt install nodejs npm
# CentOS/RHEL/Fedora
sudo dnf install nodejs npm
Verify Installation¶
node --version
npm --version
Step 2: Install Claude Code¶
npm install -g @anthropic-ai/claude-code
If you hit a permission problem:
sudo npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
Step 3: Set Environment Variables¶
Temporary¶
export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"
export ANTHROPIC_AUTH_TOKEN="your-api-key"
Permanent¶
# For bash (default)
echo 'export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="your-api-key"' >> ~/.bashrc
source ~/.bashrc
# For zsh
echo 'export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="your-api-key"' >> ~/.zshrc
source ~/.zshrc
Step 4: Start Using¶
cd /path/to/your/project
claude
Linux FAQ¶
Missing build dependencies?
# Ubuntu/Debian
sudo apt install build-essential
# CentOS/RHEL
sudo dnf groupinstall "Development Tools"
Advanced Configuration (Optional Environment Variables)¶
Beyond the two required variables, you can customize further with these optional variables:
ANTHROPIC_MODEL¶
Specify the default model. We recommend setting Sonnet 5 explicitly. If unset, Claude Code uses its own built-in default for that CLI version — do not rely on a historical default name from this page. 4.x IDs such as claude-sonnet-4-6 and claude-opus-4-8 remain on sale.
# Daily recommendation (Sonnet 5)
export ANTHROPIC_MODEL=claude-sonnet-5
# Heavy work (Opus 5, higher cost)
export ANTHROPIC_MODEL=claude-opus-5
MAX_THINKING_TOKENS¶
Control the maximum tokens for the model's thinking process (set to 0 to disable):
export MAX_THINKING_TOKENS=16000
CLAUDE_CODE_EFFORT_LEVEL¶
Adjust Claude's effort level:
# Options: low / medium / high
export CLAUDE_CODE_EFFORT_LEVEL=high
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC¶
Disable non-essential network requests (e.g., telemetry):
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
Next Steps¶
Congratulations! You've successfully installed Claude Code. Next:
-
Check out Quick Start to learn basic usage
-
Explore CLI Tips to boost efficiency