Home

Install Claude Code on Windows

Claude Code is an AI assistant that lives in your terminal and helps you write, debug, and understand code. This guide gets you running natively on Windows in just a few minutes. WSL2 is also available at the end as an optional, more advanced setup.

Key Concepts

What You’ll Need

Git for Windows is recommended but optional. It adds Git Bash, the shell Claude Code uses to run commands. If you skip this step, Claude Code falls back to PowerShell instead — so you can move straight to Step 2 and install Git later if you prefer.

That’s it — Claude Code will detect Git Bash automatically when it starts.

Step 2: Install Claude Code

Step 3: Open Claude Code in VS Code

Now that Claude Code is installed, you can use it inside VS Code instead of only in the terminal. This is often the easiest way to work because you can read files, edit code, and ask for help without leaving your editor.

Think of the Claude Code sidebar as a chat window inside VS Code. It lets you ask questions, explain code, and get help while you work in the same screen.

How to open the Claude Code sidebar

  1. Open VS Code
  2. Look at the far left side of the window
  3. Click the Extensions icon if you do not already see the Claude Code panel
  4. Search for Claude Code in the Extensions marketplace
  5. Click Install if it is not already installed
  6. After installation, look for the Claude Code icon in the left sidebar

If you do not see the Claude Code icon, try this:

  1. Press Ctrl + Shift + P
  2. Type: Claude Code: Open Sidebar
  3. Click the matching option in the list

If it still does not appear, close VS Code and reopen it. Sometimes the extension needs a fresh start before the sidebar shows up.

What the sidebar is for

The Claude Code sidebar is where you can:

This is useful because you can keep your code open in the editor and ask Claude for help in the same window.

Quick test

After the sidebar opens:

If Claude responds, you are ready to use it.

Tip: If the sidebar is still missing, make sure the Claude Code extension is installed and that VS Code has been restarted.

Step 4: Connect to Your Anthropic Account

Option A. Use your Claude Pro or Max subscription

The API-based options below stay in PowerShell and use the setx command, which saves a setting permanently. After running setx, close and reopen PowerShell so the change takes effect, then start claude.

Option B. Use Anthropic API key

If you have an Anthropic API key instead of a Claude subscription:

Option C. Use OpenRouter API (starts for free!)

OpenRouter is a unified API gateway that provides access to 500+ large language models through a single API key. This can be an economical way to use Claude Code, as you pay only for usage and can choose from models at various price points.

Notes:

Option D. Use Anthropic API via Azure Foundry

In PowerShell, paste this code to define the environment variables:

# Enable Microsoft Foundry integration
setx CLAUDE_CODE_USE_FOUNDRY 1
# Azure resource name
setx ANTHROPIC_FOUNDRY_RESOURCE "xxxx-eastus2"
# Set models to your resource's deployment names
setx ANTHROPIC_DEFAULT_OPUS_MODEL "claude-opus-4-5"
setx ANTHROPIC_DEFAULT_SONNET_MODEL "claude-sonnet-4-5"
setx ANTHROPIC_DEFAULT_HAIKU_MODEL "claude-haiku-4-5"
setx ANTHROPIC_FOUNDRY_API_KEY "your_api_key"

Note: Replace xxxx-eastus2 with your Foundry Resource name (do not use the entire base URL). Replace your_api_key with your complete API key from your Azure portal.

Then close and reopen PowerShell, and start Claude Code:

claude

You should now be able to use Claude Code with Azure-deployed Claude models.

Step 5: Test Claude Code

You’re all set! Type claude in PowerShell and ask a general question such as “Explain quantum computing.”

Step 6: Access Your Projects

Note: Claude operates inside a project folder. It saves settings in that folder. It’s Claude’s workspace.

Step 7: (Optional) Install WSL2 for the Full Linux Experience

The native setup above is almost all that most people need. But Claude Code performs better under Linux. WSL2 runs a real Linux system inside Windows and adds Bash tool sandboxing (a security feature) plus better compatibility with Linux toolchains. It takes longer to set up and requires a restart, so only do this if you want the full Linux experience.

a) Check virtualization and install WSL

First, check if virtualization is enabled:

If it says “Disabled”: You need to enable virtualization in your computer’s BIOS settings:

Now install WSL:

Note: wsl --install requires Windows 10 version 2004 or higher, or Windows 11. If the command is not recognized, your Windows version may be too old.

b) Set up Ubuntu

After your computer restarts, a terminal window with “Ubuntu” in the title should open automatically within 2-5 minutes. If it doesn’t, click the Windows Start button, type Ubuntu, and click the Ubuntu app (orange circle icon).

Important: Remember this username and password — you’ll need them later.

c) Install Claude Code in WSL

Next Steps

Troubleshooting

First step: Run Claude Doctor

If something isn’t working, try running this command first:

claude doctor

This built-in diagnostic tool checks your installation and reports common issues.

Claude command not found (native Windows)

“Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS”

This error means virtualization is not enabled:

“wsl –install” doesn’t work

Ubuntu window doesn’t open after restart

Need Help?


Created by Steven Ge on December 11, 2025. Updated June 2026.