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.
Before beginning installation, verify your Windows 10 system meets these requirements:
Windows 10 Version Requirements:
Hardware Requirements:
Check Your System:
Press Windows + R, type winver, and press Enter to verify your Windows version and build number.
WSL2 provides the Linux environment necessary for Claude Code to function properly.
Open PowerShell as Administrator:
Install WSL2:
wsl --installThis single command automatically:
Restart your computer when prompted. The installation will continue automatically after reboot.
If using older Windows 10 builds, follow these manual steps:
Step 1: Enable WSL
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartStep 2: Enable Virtual Machine Platform
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartStep 3: Restart your computer
Step 4: Download and install the WSL2 kernel update
Step 5: Set WSL2 as default
wsl --set-default-version 2Step 6: Install Ubuntu
wsl --install -d UbuntuError 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:
Set-ExecutionPolicy -Scope CurrentUser UnrestrictedVirtual Machine Platform Error: Ensure your CPU supports SLAT. Older processors like Intel Core 2 Duo cannot run WSL2.
After WSL2 installation completes, configure your Ubuntu environment.
Launch Ubuntu:
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:
Update Ubuntu Packages:
sudo apt update && sudo apt upgrade -yCheck WSL version from PowerShell:
wsl -l -vExpected output showing VERSION 2:
NAME STATE VERSION
* Ubuntu Running 2Test from within Ubuntu:
uname -rShould display a kernel ending with "-microsoft-standard-WSL2"
Claude Code requires Node.js 18+ and proper npm configuration to avoid permission issues.
Remove any existing Node.js installations:
sudo apt remove nodejs npmInstall required packages:
sudo apt update
sudo apt install curl build-essential -yDownload and install NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bashReload shell configuration:
source ~/.bashrcVerify NVM installation:
command -v nvmInstall latest LTS version (recommended for Claude Code):
nvm install --lts
nvm use --lts
nvm alias default lts/*Verify installation:
node --version # Should show v18.x.x or higher
npm --version # Should show npm version
which node # Should show Linux path, not Windows pathThis critical step prevents the need for sudo when installing global packages:
Create global package directory:
mkdir ~/.npm-globalConfigure npm prefix:
npm config set prefix '~/.npm-global'Add to PATH in shell profile:
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrcClaude Code requires an active Anthropic account with billing configured before installation.
Visit Anthropic Console:
Set up payment method:
Purchase initial credits:
Pay-as-you-go API rates:
For regular usage, subscription plans often provide better value than pay-per-use.
With Node.js configured and billing active, install Claude Code globally.
Install globally via npm (without sudo):
npm install -g @anthropic-ai/claude-codeVerify installation:
claude --version
which claudeCommand not found: Check PATH configuration:
echo $PATH # Should include ~/.npm-global/bin
source ~/.bashrcPermission errors: Ensure npm prefix is configured correctly:
npm config get prefix # Should show /home/username/.npm-globalWSL Node.js conflicts: Verify using Linux Node.js:
which node # Should show /home/username/.nvm/versions/node/vX.X.X/bin/nodeSet up Claude Code for first-time use and establish authentication with Anthropic services.
Navigate to project directory:
cd ~
mkdir claude-projects && cd claude-projectsLaunch Claude Code for first time:
claudeWhen starting Claude Code, you'll see authentication options:
Select default model:
# 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 capabilityCreate project configuration:
Create a CLAUDE.md file in your project root with:
# Project Guidelines
- Coding standards: [Your preferences]
- Testing requirements: [Test frameworks used]
- Deployment process: [CI/CD information]
- Code style: [Formatting preferences]Test Claude Code functionality to ensure proper installation and configuration.
Test command availability:
claude --help
claude --versionTest in project directory:
mkdir test-project && cd test-project
echo "# Test Project" > README.md
claudeIn Claude Code session, try:
> help
> explain what you can do
> summarize this project
> /helpTest code generation:
> create a simple hello world script in Python
> add error handling to the script
> create a test file for the scriptTest file operations:
> show me the project structure
> explain the README file
> create a .gitignore file for PythonTest Git integration:
> initialize git repository
> commit the current changes
> show git statusMonitor resource usage during testing:
# In separate terminal
htop
free -hTest session management:
> /compact # Summarize conversation
> /clear # Start fresh session
> /cost # Check usage costsOptimize your development environment for the best Claude Code experience.
Create .wslconfig file:
Create C:\Users\[YourUsername]\.wslconfig:
[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=falseApply configuration:
# Run from PowerShell to restart WSL2
wsl --shutdownInstall Windows Terminal (recommended):
Configure Ubuntu profile: Edit Windows Terminal settings (Ctrl+,):
{
"name": "Ubuntu WSL2",
"source": "Windows.Terminal.Wsl",
"startingDirectory": "//wsl$/Ubuntu/home/username/",
"fontFace": "Cascadia Code PL",
"fontSize": 11
}For optimal performance:
~/projects/Navigate efficiently:
# Linux filesystem (fast)
cd ~/projects/my-app
# Windows filesystem (when needed)
cd /mnt/c/Users/YourName/Documents/Claude Code won't start:
# 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 --ltsHigh memory usage:
# Free up memory
sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
wsl --shutdown # From PowerShellNetwork connectivity issues:
# Test connectivity
ping google.com
curl -I https://api.anthropic.com
# Check DNS resolution
nslookup api.anthropic.comPath conflicts:
# Fix WSL PATH issues
echo $PATH | grep -o '/mnt/c[^:]*' | head -5
# Remove problematic Windows paths if neededInstall usage monitoring:
npm install -g ccusage
ccusage daily # Daily usage report
ccusage --live # Real-time monitoringMonitor via Anthropic Console:
Cost optimization strategies:
/compact to summarize long conversationsWith installation complete, begin using Claude Code effectively for development workflows.
Navigation and help:
/help # Show all available commands
/config # Configure preferences
/clear # Start fresh conversation
/compact # Summarize current session
/quit # Exit Claude CodeDevelopment 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 documentationGit integration:
> review changes before committing
> commit with descriptive message
> create pull request
> resolve merge conflictsStart with exploration:
Be specific in requests:
Leverage context awareness:
Review before accepting:
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.