How to Successfully Set Up Claude Code on a Windows PC


Now that Anthropic allows Windows users to use claude-code without WSL (Windows Subsystem for Linux), let's dive into setting up your AI code companion with a step-by-step approach that anyone can follow.
What Changed Recently?
Previously, Windows users needed to:
Set up a Linux environment
Install and configure WSL
Navigate complex terminal commands
Now, you can install Claude Code directly on Windows using familiar tools. This guide will walk you through every step, assuming no prior technical knowledge.
What is Claude Code?
Key Benefits:
Real-time coding assistance
Code review and optimization
Debugging help
Documentation generation
Learning support for new technologies
Prerequisites: What You Need First
Before we begin, you'll need to install some foundational tools, namely : node.js (and npm) and Git.
1. Node.js and npm (The Basics)
What is Node.js? It's a platform that lets you run JavaScript programs on your computer. npm is its package manager (think of it as an app store for code).
Option A: Download from nodejs.org (choose LTS version - it's more stable)
Option B: If you have Chocolatey installed:
choco install nodejs
Step-by-step installation:
Go to nodejs.org
Click the LTS button (Long Term Support - more stable)
Run the downloaded installer
Important: Check "Add to PATH" during installation
Click "Next" through all prompts and "Install"
Verify it worked:
Press
Windows Key + R
Type
powershell
and press EnterType these commands one by one:
node --version
npm --version
v20.x.x
and 10.x.x
. If you see errors, restart your computer and try again.2. Git for Windows (Version Control)
What is Git? It's a tool that helps track changes in code. Claude Code uses it for various operations.
Go to git-scm.com/download/win
Download and run the installer
Important settings during installation:
Choose "Use Git from the Windows Command Prompt"
Keep all other default settings
Verify it worked:
git --version
3. A paid Anthropic account
You cannot use Claude Code on free accounts. I highly recommend you just take a pro account to see if this setup suits you.
Obviously, if you're really new to all of this, please take the time to familiarize yourself with AI Agents before spending money on something that wouldn't suit you.
Installation Process: Step by Step
Step 1: Open PowerShell as Administrator
Press
Windows Key
Type "PowerShell"
Right-click on "Windows PowerShell"
Select "Run as administrator"
Click "Yes" if prompted
Step 2: Install Claude Code
Copy and paste this command into PowerShell:
npm install -g @anthropic-ai/claude-code
What you'll see:
Download progress bars
Installation messages
"Success" message when complete
Step 3: Find Where Claude Code Was Installed
Run these commands to see where npm put Claude Code:
npm config get prefix
npm root -g
Typical locations:
C:\Users\[YourUsername]\.npm-global
C:\Users\[YourUsername]\AppData\Roaming\npm
Remember this location - we'll need it in the next step!
Step 4: Add Claude Code to Your PATH
Method 1: Using PowerShell (Recommended)
Replace [YourUsername]
with your actual username:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Users\[YourUsername]\.npm-global", [EnvironmentVariableTarget]::User)
Method 2: Using Windows Settings (Visual Method)
Press
Windows Key + X
Select "System"
Click "Advanced system settings"
Click "Environment Variables"
Under "User variables", find and select "Path"
Click "Edit"
Click "New"
Add:
C:\Users\[YourUsername]\.npm-global
Click "OK" on all windows
Step 5: Test Your Installation
Close and reopen PowerShell (this refreshes the PATH), then test:
claude --version
Solution A: Use the full path
& "C:\Users\[YourUsername]\.npm-global\claude.cmd" --version
Solution B: Create a shortcut script
Open Notepad
Type:
@echo off
"C:\Users\[YourUsername]\.npm-global\claude.cmd" %*
Save as
claude-helper.bat
in your Documents folderUse
claude-helper
instead ofclaude
Solution C: Restart your computer
Sometimes Windows needs a little help to recognize PATH changes.
First-Time Setup: Getting Started
Authentication with Anthropic
You need an Anthropic account to use Claude Code. If you don't have one:
- Go to claude.ai
- Sign up for a free account
- Upgrade to Pro or Max (this won't work on a free account)
Start Claude Code:
claude
What happens next:
- Claude Code will open in your browser
- You'll log in to your Anthropic account
- A authentication token will be saved locally
- You'll return to the terminal ready to use Claude
Basic Configuration
Check your current settings:
claude config
Recommended beginner settings:
# Set a dark theme (easier on the eyes)
claude config set theme dark
# Set default model to Sonnet (good balance of speed and capability)
claude config set model sonnet
# Enable helpful prompts
claude config set interactive true
And that’s it ! Hope your mileage won’t vary. This is what actually worked for me :)
Happy coding !
Subscribe to my newsletter
Read articles from TestBot Chronicles directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
