Home / AI / Claude AI / How to Install Claude Code on Windows (Step-by-Step Guide)

How to Install Claude Code on Windows (Step-by-Step Guide)

Claude Code runs in your terminal and works with your local files — getting it set up on Windows takes about ten minutes. Here’s the complete step-by-step guide.

What You Need Before Starting

  • Windows 10 or 11
  • Node.js 18 or higher — Claude Code is installed via npm
  • An Anthropic account — free to create at console.anthropic.com
  • An Anthropic API key — generated in the Anthropic console (requires adding a payment method, but you get free credits to start)

Step 1: Install Node.js

If you don’t already have Node.js installed:

  1. Go to nodejs.org and download the LTS version.
  2. Run the installer and follow the prompts — keep all default settings.
  3. Open a new Command Prompt or PowerShell window and verify the install:
node --version
npm --version

Both should return version numbers. If they do, Node.js is ready.

Step 2: Get Your Anthropic API Key

  1. Go to console.anthropic.com and sign in or create a free account.
  2. In the left menu, click API Keys.
  3. Click Create Key, give it a name (e.g. “Claude Code”), and copy the key.
  4. Save it somewhere safe — you won’t be able to see it again.

You’ll also need to add a payment method in the Billing section before the API key will work. Anthropic provides free credits for new accounts so you won’t be charged immediately.

Step 3: Install Claude Code

Open PowerShell or Command Prompt and run:

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

The -g flag installs it globally so you can run it from any directory. The install takes about a minute.

Step 4: Set Your API Key

Claude Code needs your API key to communicate with Anthropic. Set it as an environment variable:

$env:ANTHROPIC_API_KEY = "your-api-key-here"

This sets it for the current session only. To make it permanent so you don’t have to set it every time:

  1. Search for Environment Variables in the Start menu and open Edit the system environment variables.
  2. Click Environment Variables.
  3. Under User variables, click New.
  4. Set Variable name: ANTHROPIC_API_KEY and Variable value: your key.
  5. Click OK and restart your terminal.

Step 5: Start Claude Code

Navigate to a project folder in your terminal:

cd C:\Users\YourName\Projects\my-project

Then launch Claude Code:

claude

The first time you run it, Claude Code will ask you to accept the terms of service. After that, you’ll see a prompt where you can start giving it instructions.

Your First Task

Try something simple to confirm everything is working:

claude "list the files in this directory and tell me what this project does"

Claude Code will read your project structure and give you a summary. From there you can ask it to make changes, fix bugs, add features, or anything else.

Claude Code works best in Windows Terminal rather than the old Command Prompt — it renders the output more cleanly. If you don’t have it, install it free from the Microsoft Store.

Troubleshooting

  • “claude is not recognised” — close and reopen your terminal after installing, or restart your PC to refresh the PATH.
  • “API key invalid” — check the key was copied correctly with no extra spaces, and that you’ve added a payment method in the Anthropic console.
  • Permission errors during install — run PowerShell as Administrator and retry the npm install command.

Sign Up For Daily Newsletter

Stay updated with our weekly newsletter. Subscribe now to never miss an update!

[mc4wp_form]

Leave a Reply

Your email address will not be published. Required fields are marked *