Claude Code Windows Environment Setup

Detailed guide on how to configure Claude Code development environment on Windows system, including Node.js installation, environment variables configuration, etc.

Windows System Requirements

  • Windows 10 or higher
  • Administrator privileges (for software installation)
  • At least 2GB available disk space

Install Node.js

Step 1: Download Node.js

Visit Node.js official website to download the LTS version Windows installer (.msi file)

Step 2: Run the installer

  1. Double-click the downloaded .msi file
  2. Click "Next" to continue installation
  3. Accept the license agreement
  4. Choose installation path (recommend using default path)
  5. Make sure "Add to PATH" option is checked
  6. Click "Install" to begin installation

Step 3: Verify installation

Open Command Prompt (cmd) or PowerShell and run:

cmd
node --version
npm --version

Method 2: Using Chocolatey

PowerShell (Administrator)
# Install Chocolatey (if not installed)
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# Install Node.js
choco install nodejs

Method 3: Using Winget

cmd
winget install OpenJS.NodeJS

Environment Variables Configuration

Temporary Configuration (Valid for current session)

set ANTHROPIC_BASE_URL=https://i7dc.com/api
set ANTHROPIC_AUTH_TOKEN=your-key
cd your-project-folder
claude

Method 1: Configure through System Properties

  1. Right-click "This PC" → "Properties"
  2. Click "Advanced system settings"
  3. Click "Environment Variables" in the "System Properties" window
  4. Click "New" in "User variables" or "System variables"
  5. Add the following variables:
    • Variable name: ANTHROPIC_BASE_URL, Variable value: https://i7dc.com/api
    • Variable name: ANTHROPIC_AUTH_TOKEN, Variable value: your-key
  6. Click "OK" to save

Method 2: Configure using PowerShell

PowerShell (Administrator)
# Set environment variables for current user
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://i7dc.com/api", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your-key", "User")

# Verify settings
[Environment]::GetEnvironmentVariable("ANTHROPIC_BASE_URL", "User")
[Environment]::GetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "User")

For better user experience, it's recommended to install Windows Terminal:

PowerShell
# Install via Microsoft Store
winget install Microsoft.WindowsTerminal

# Or install via package manager
choco install microsoft-windows-terminal

Configure Windows Terminal Startup Profile

  1. Open Windows Terminal
  2. Press Ctrl + , to open settings
  3. Select "Profiles" → "Add new profile" in the left menu
  4. Configure as follows:
    • Name: Claude Code
    • Command line: powershell.exe
    • Starting directory: your-project-directory
    • Add environment variables in Advanced settings

Common Problem Solutions

Problem 1: node command not recognized

Solution:

cmd
# Check PATH environment variable
echo %PATH%

# Manually add Node.js to PATH (temporary)
set PATH=%PATH%;C:\Program Files\nodejs

Problem 2: Slow npm installation

Solution:

cmd
# Use domestic mirror source
npm config set registry https://registry.npmmirror.com

Problem 3: PowerShell execution policy restrictions

Solution:

PowerShell (Administrator)
# Temporarily allow script execution
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

# Permanent setting (requires administrator privileges)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

Problem 4: Firewall blocking connection

Solution:

  1. Open Windows Firewall settings
  2. Click "Allow an app or feature through Windows Firewall"
  3. Find Node.js and check "Private" and "Public" networks

Verify Configuration

After configuration is complete, restart Command Prompt or PowerShell and run the following commands to verify:

cmd
echo %ANTHROPIC_BASE_URL%
echo %ANTHROPIC_AUTH_TOKEN%
claude --version

If the correct environment variable values and version information are output, the configuration is successful!

Next Steps

After environment configuration is complete, you can:

  1. Run claude in any project directory to start using
  2. Choose your favorite theme
  3. Confirm security notice and trust working directory
  4. Start collaborating with your AI programming partner! 🚀
Bring endless innovation and opportunities with AI
About
Features
Docs
Pricing
Contact us
Terms & Policies
Terms of Use
Privacy Policy
Specified Commercial Transactions Act