Skip to main content

How to Install Claude Code on Windows

I use Claude Code on Windows via WSL2 (Windows Subsystem for Linux). The setup requires a few specific steps, but once configured properly, the experience is seamless.

Prerequisites

Before installing Claude Code, you'll need:

  • Windows 10 version 2004 or higher (or Windows 11)
  • WSL2 installed and configured
  • Node.js 18.0+ in your WSL environment
  • Anthropic API key or Claude subscription

Step by Step Installation

1. Install WSL2

If you haven't already installed WSL2:

wsl --install

This installs WSL2 with Ubuntu by default. Restart your computer when prompted.

2. Set Up Your Linux Environment

Open your WSL terminal and update packages:

sudo apt update && sudo apt upgrade -y

3. Install Node.js

Install Node.js 18.0+ in your WSL environment:

# Download and run NodeSource setup script for LTS version
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

Verify the installation:

node --version
npm --version

4. Install Claude Code

Now install Claude Code globally:

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

5. Configure Authentication

Set up your authentication method:

For API users:

claude config

For subscription users: You'll authenticate through the browser when you first run claude.

VS Code Integration

Once Claude Code is installed, you can seamlessly integrate it with Visual Studio Code. I use this setup daily and find it incredibly productive.

1. Open VS Code on Windows 2. Install the WSL extension from Microsoft 3. Open your project folder in WSL using the WSL extension 4. Open the integrated terminal in VS Code (it will automatically use WSL) 5. Run claude in the integrated terminal

This gives you the best of both worlds: familiar VS Code interface with Claude Code's powerful terminal capabilities.

Testing Your Installation

Create a simple test to verify everything works:

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

If Claude Code starts successfully and can read your README.md file, you're all set!

Performance Observation

I notice Claude Code runs more efficiently on native Linux due to reduced virtualization overhead. WSL2 works well for development, but consider native Linux for intensive usage.