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?

💡
Anthropic released a significant update allowing Windows users to bypass the Linux submachine (WSL) setup entirely. This makes Claude Code accessible to everyone, regardless of technical expertise!

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?

💡
Claude Code is an AI-powered coding assistant that works directly in your terminal or IDE. Think of it as having an expert programmer (or a junior one if you don't know/want to direct it properly) sitting next to you, ready to help with code, explanations, debugging, and more.

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:

  1. Go to nodejs.org

  2. Click the LTS button (Long Term Support - more stable)

  3. Run the downloaded installer

  4. Important: Check "Add to PATH" during installation

  5. Click "Next" through all prompts and "Install"

Verify it worked:

  1. Press Windows Key + R

  2. Type powershell and press Enter

  3. Type these commands one by one:

node --version
npm --version
💡
You should see version numbers like 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.

  1. Go to git-scm.com/download/win

  2. Download and run the installer

  3. Important settings during installation:

    • Choose "Use Git from the Windows Command Prompt"

    • Keep all other default settings

Verify it worked:

git --version
💡
If you see a version number, you're all set. If not, restart PowerShell (in admin mode) and try again.

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

💡
Why Administrator? Installing global packages requires elevated permissions.
  1. Press Windows Key

  2. Type "PowerShell"

  3. Right-click on "Windows PowerShell"

  4. Select "Run as administrator"

  5. 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)

  1. Press Windows Key + X

  2. Select "System"

  3. Click "Advanced system settings"

  4. Click "Environment Variables"

  5. Under "User variables", find and select "Path"

  6. Click "Edit"

  7. Click "New"

  8. Add: C:\Users\[YourUsername]\.npm-global

  9. 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

  1. Open Notepad

  2. Type:

@echo off
"C:\Users\[YourUsername]\.npm-global\claude.cmd" %*
  1. Save as claude-helper.bat in your Documents folder

  2. Use claude-helper instead of claude

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:

  • 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 !

0
Subscribe to my newsletter

Read articles from TestBot Chronicles directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

TestBot Chronicles
TestBot Chronicles