Content is user-generated and unverified.

Complete Claude Code Installation Guide for Windows 10

Claude Code transforms terminal-based development with AI-powered coding assistance, but getting it running on Windows 10 requires careful setup through WSL2. This comprehensive guide walks you through every step from scratch, ensuring a smooth installation regardless of your starting point.

Critical Note: Claude Code does not run natively on Windows. You must install Windows Subsystem for Linux 2 (WSL2) to create a Linux environment where Claude Code can operate effectively.

Prerequisites and system requirements

Before beginning installation, verify your Windows 10 system meets these requirements:

Windows 10 Version Requirements:

  • x64 systems: Windows 10 Version 1903 or later with Build 18362.1049+
  • ARM64 systems: Windows 10 Version 2004 or later with Build 19041+
  • Recommended: Windows 10 Version 2004 (Build 19041) or higher for simplified installation

Hardware Requirements:

  • CPU with virtualization support (Intel VT-x or AMD-V)
  • SLAT (Second Level Address Translation) capability
  • Minimum 4GB RAM (8GB+ recommended for optimal performance)
  • At least 10GB free disk space

Check Your System: Press Windows + R, type winver, and press Enter to verify your Windows version and build number.

Step 1: Enable WSL2 on Windows 10

WSL2 provides the Linux environment necessary for Claude Code to function properly.

For Windows 10 Build 2004+ (Simplified Method)

Open PowerShell as Administrator:

  1. Right-click the Start button
  2. Select "Windows PowerShell (Admin)"
  3. Click "Yes" if prompted by User Account Control

Install WSL2:

powershell
wsl --install

This single command automatically:

  • Enables Windows Subsystem for Linux feature
  • Enables Virtual Machine Platform feature
  • Downloads the WSL Linux kernel
  • Installs Ubuntu as the default distribution

Restart your computer when prompted. The installation will continue automatically after reboot.

For Windows 10 Build 1903-1909 (Manual Method)

If using older Windows 10 builds, follow these manual steps:

Step 1: Enable WSL

powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Step 2: Enable Virtual Machine Platform

powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Step 3: Restart your computer

Step 4: Download and install the WSL2 kernel update

Step 5: Set WSL2 as default

powershell
wsl --set-default-version 2

Step 6: Install Ubuntu

  • Open Microsoft Store
  • Search for "Ubuntu" and click "Get"
  • Or run: wsl --install -d Ubuntu

Troubleshooting WSL2 Installation

Error 0x80370102: Enable virtualization in your BIOS/UEFI settings. Look for Intel VT-x or AMD-V options and enable them.

Execution Policy Restricted: If you see red text about execution policy, run:

powershell
Set-ExecutionPolicy -Scope CurrentUser Unrestricted

Virtual Machine Platform Error: Ensure your CPU supports SLAT. Older processors like Intel Core 2 Duo cannot run WSL2.

Step 2: Set up Ubuntu in WSL2

After WSL2 installation completes, configure your Ubuntu environment.

Initial Ubuntu Setup

Launch Ubuntu:

  • Search "Ubuntu" in Start menu and click to open
  • Wait for initial installation (1-2 minutes)

Create User Account: When prompted, create your Linux user account:

Enter new UNIX username: [choose-username]
New password: [create-secure-password]
Retype new password: [confirm-password]

Important Guidelines:

  • Use lowercase letters, numbers, hyphens, or underscores only
  • Cannot start with a number
  • Choose a different username than your Windows account for security
  • This user gets sudo privileges automatically

Update Ubuntu Packages:

bash
sudo apt update && sudo apt upgrade -y

Verify WSL2 Installation

Check WSL version from PowerShell:

powershell
wsl -l -v

Expected output showing VERSION 2:

  NAME      STATE           VERSION
* Ubuntu    Running         2

Test from within Ubuntu:

bash
uname -r

Should display a kernel ending with "-microsoft-standard-WSL2"

Step 3: Install Node.js and npm using NVM

Claude Code requires Node.js 18+ and proper npm configuration to avoid permission issues.

Install Prerequisites

Remove any existing Node.js installations:

bash
sudo apt remove nodejs npm

Install required packages:

bash
sudo apt update
sudo apt install curl build-essential -y

Install NVM (Node Version Manager)

Download and install NVM:

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Reload shell configuration:

bash
source ~/.bashrc

Verify NVM installation:

bash
command -v nvm

Install Node.js with NVM

Install latest LTS version (recommended for Claude Code):

bash
nvm install --lts
nvm use --lts
nvm alias default lts/*

Verify installation:

bash
node --version  # Should show v18.x.x or higher
npm --version   # Should show npm version
which node      # Should show Linux path, not Windows path

Configure npm to Avoid Permission Issues

This critical step prevents the need for sudo when installing global packages:

Create global package directory:

bash
mkdir ~/.npm-global

Configure npm prefix:

bash
npm config set prefix '~/.npm-global'

Add to PATH in shell profile:

bash
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Step 4: Set up Anthropic Console and billing

Claude Code requires an active Anthropic account with billing configured before installation.

Create Anthropic Account

Visit Anthropic Console:

  1. Navigate to https://console.anthropic.com
  2. Click "Start Building"
  3. Sign up using your email address (passwordless authentication)
  4. Complete onboarding with full name and age verification
  5. Choose organization name (personal or company)

Configure Billing (Required)

Set up payment method:

  1. Navigate to Settings → Billing in the console
  2. Click "Complete Setup"
  3. Enter payment details (credit card required)
  4. Choose organization type (small business for personal use)
  5. Specify countries where you'll use the service
  6. Confirm compliance with usage policies

Purchase initial credits:

  • Minimum purchase: $5 (absolute minimum to activate billing)
  • Recommended: $20-30 for testing and initial projects
  • Alternative: Consider Claude Pro ($20/month) or Claude Max ($100/month) subscriptions for heavy usage

Understanding Pricing

Pay-as-you-go API rates:

  • Claude Opus 4: $15/$75 per million tokens (input/output)
  • Claude Sonnet 4: $3/$15 per million tokens (input/output)
  • Claude 3.5 Haiku: $1/$5 per million tokens (input/output)

For regular usage, subscription plans often provide better value than pay-per-use.

Step 5: Install Claude Code

With Node.js configured and billing active, install Claude Code globally.

Install Claude Code Package

Install globally via npm (without sudo):

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

Verify installation:

bash
claude --version
which claude

Handle Installation Issues

Command not found: Check PATH configuration:

bash
echo $PATH  # Should include ~/.npm-global/bin
source ~/.bashrc

Permission errors: Ensure npm prefix is configured correctly:

bash
npm config get prefix  # Should show /home/username/.npm-global

WSL Node.js conflicts: Verify using Linux Node.js:

bash
which node  # Should show /home/username/.nvm/versions/node/vX.X.X/bin/node

Step 6: Configure and authenticate Claude Code

Set up Claude Code for first-time use and establish authentication with Anthropic services.

Initial Authentication

Navigate to project directory:

bash
cd ~
mkdir claude-projects && cd claude-projects

Launch Claude Code for first time:

bash
claude

Complete OAuth Authentication

When starting Claude Code, you'll see authentication options:

  1. Choose authentication method:
    • Anthropic Console (recommended for pay-per-use)
    • Claude App (if you have Pro/Max subscription)
  2. Complete browser authentication:
    • Browser window opens automatically
    • Log in to your Anthropic account
    • Authorize Claude Code access
    • Copy authentication code if prompted
    • Return to terminal and paste code
  3. Configure terminal settings:
    • Choose preferred color scheme and interaction style
    • Configure keyboard shortcuts (Shift+Enter recommended)
  4. Set project trust level:
    • Select "Yes, proceed" for your own projects
    • This allows Claude Code to read and modify files

Configure Models and Preferences

Select default model:

bash
# Start with specific model
claude --model claude-sonnet-4-20250514  # Balanced performance
claude --model claude-3-5-haiku-20241022  # Cost-effective for simple tasks
claude --model claude-opus-4-20250514     # Maximum capability

Create project configuration: Create a CLAUDE.md file in your project root with:

markdown
# Project Guidelines
- Coding standards: [Your preferences]
- Testing requirements: [Test frameworks used]
- Deployment process: [CI/CD information]
- Code style: [Formatting preferences]

Step 7: Verify installation works

Test Claude Code functionality to ensure proper installation and configuration.

Basic Verification Tests

Test command availability:

bash
claude --help
claude --version

Test in project directory:

bash
mkdir test-project && cd test-project
echo "# Test Project" > README.md
claude

In Claude Code session, try:

> help
> explain what you can do
> summarize this project
> /help

Functional Testing

Test code generation:

> create a simple hello world script in Python
> add error handling to the script
> create a test file for the script

Test file operations:

> show me the project structure
> explain the README file
> create a .gitignore file for Python

Test Git integration:

> initialize git repository
> commit the current changes
> show git status

Performance Verification

Monitor resource usage during testing:

bash
# In separate terminal
htop
free -h

Test session management:

> /compact  # Summarize conversation
> /clear    # Start fresh session
> /cost     # Check usage costs

Step 8: Windows 10 optimization and troubleshooting

Optimize your development environment for the best Claude Code experience.

WSL2 Performance Optimization

Create .wslconfig file: Create C:\Users\[YourUsername]\.wslconfig:

ini
[wsl2]
# Adjust memory allocation (up to 50% of total RAM)
memory=8GB
# Set CPU cores (adjust based on your system)
processors=4
# Configure swap file
swap=2GB
# Enable localhost forwarding
localhostForwarding=true
# Optimize for development
pageReporting=false

Apply configuration:

powershell
# Run from PowerShell to restart WSL2
wsl --shutdown

Windows Terminal Setup

Install Windows Terminal (recommended):

  • Download from Microsoft Store or GitHub
  • Provides better WSL2 integration
  • Supports tabs and customizable profiles

Configure Ubuntu profile: Edit Windows Terminal settings (Ctrl+,):

json
{
  "name": "Ubuntu WSL2",
  "source": "Windows.Terminal.Wsl",
  "startingDirectory": "//wsl$/Ubuntu/home/username/",
  "fontFace": "Cascadia Code PL",
  "fontSize": 11
}

File System Best Practices

For optimal performance:

  • Store active projects in WSL2 filesystem: ~/projects/
  • Use Windows filesystem sparingly: Only for files accessed by Windows applications
  • Avoid frequent cross-OS file operations: 20x slower than native access

Navigate efficiently:

bash
# Linux filesystem (fast)
cd ~/projects/my-app

# Windows filesystem (when needed)
cd /mnt/c/Users/YourName/Documents/

Common Troubleshooting Issues

Claude Code won't start:

bash
# Check Node.js and npm paths
which node && which npm
# Should show WSL paths, not Windows paths

# Reinstall if using Windows Node.js
nvm install --lts && nvm use --lts

High memory usage:

bash
# Free up memory
sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
wsl --shutdown  # From PowerShell

Network connectivity issues:

bash
# Test connectivity
ping google.com
curl -I https://api.anthropic.com

# Check DNS resolution
nslookup api.anthropic.com

Path conflicts:

bash
# Fix WSL PATH issues
echo $PATH | grep -o '/mnt/c[^:]*' | head -5
# Remove problematic Windows paths if needed

Cost Monitoring and Management

Install usage monitoring:

bash
npm install -g ccusage
ccusage daily    # Daily usage report
ccusage --live   # Real-time monitoring

Monitor via Anthropic Console:

  • Visit console.anthropic.com → Usage
  • Set up spending alerts
  • Review token consumption patterns

Cost optimization strategies:

  • Use /compact to summarize long conversations
  • Choose appropriate models for task complexity
  • Start fresh sessions for unrelated tasks
  • Monitor context window usage

Getting started with Claude Code

With installation complete, begin using Claude Code effectively for development workflows.

Essential Commands

Navigation and help:

/help          # Show all available commands
/config        # Configure preferences
/clear         # Start fresh conversation
/compact       # Summarize current session
/quit          # Exit Claude Code

Development workflows:

> explain this codebase architecture
> fix the bug in authentication.py
> add comprehensive tests for the user service
> optimize database queries in models.py
> create deployment documentation

Git integration:

> review changes before committing
> commit with descriptive message
> create pull request
> resolve merge conflicts

Best Practices for New Users

Start with exploration:

  • Begin each project by asking Claude to explain the codebase
  • Request architecture summaries and component explanations
  • Use Claude to understand existing patterns and conventions

Be specific in requests:

  • Provide clear context about what you want to achieve
  • Reference specific files, functions, or requirements
  • Ask for explanations of reasoning behind suggested changes

Leverage context awareness:

  • Claude understands your entire project structure
  • Reference other files and their relationships
  • Build on previous conversation context

Review before accepting:

  • Always review generated code before accepting changes
  • Test functionality after implementing suggestions
  • Use version control to track all modifications

This comprehensive guide provides everything needed to successfully install and configure Claude Code on Windows 10. The WSL2 environment, combined with proper Node.js setup and authentication, creates a powerful AI-assisted development environment that transforms how you interact with codebases and development workflows.

Content is user-generated and unverified.
    Complete Claude Code Installation Guide for Windows 10 | Claude