Your Missing Guide to Claude Code on Windows & VS Code

Last week, I decided to switch from Cursor to Claude Code after hitting some frustrating rate limits. I’ve been using Claude Code on WSL for a while, but with the recent native Windows support that just dropped, I figured it was time to try setting it up directly on Windows with the VS Code extension.

The installation itself is pretty straightforward, but I ran into a few issues that took some time to figure out. Keep in mind that native Windows support for Claude Code was just added in the last couple of days, so there might still be some rough edges. Once you get it running though, it works really well.

This guide focuses on the Windows and VS Code specific setup and tips. For general Claude Code usage and command line features, check out the official Claude Code documentation. What we’ll cover here are fixes, tricks and configurations to make Claude Code completely replace Cursor on Windows.

Prerequisites

Before we begin, make sure you have these installed:

  • Node.js, preferably v24 nodejs.org
  • Git for Windows from git-scm.com/download/win
  • VS Code
  • An Anthropic account with billing enabled

Installing Claude Code

The basic installation is simple. Open PowerShell and run:

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

For most people, this might be all you need. But if you’re like me, you’ll run into a few issues that need fixing.

Issue 1: Command Not Found

After installation, when you type claude, Windows might tell you:

'claude' is not recognized as an internal or external command

This happens because npm installs global packages to a folder that’s not in your system PATH. To fix this, we need to add the npm global directory to your PATH.

First, find where npm installs global packages:

npm config get prefix

It will show something like C:\Users\YourUsername\AppData\Roaming\npm. Now add this to your PATH by running PowerShell as Administrator:

$npmPath = npm config get prefix
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
$newPath = "$userPath;$npmPath"
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")

Close all terminals and VS Code, then open a new PowerShell window. The claude command should work now.

Issue 2: No Suitable Shell Found

When you navigate to a project and run claude, you might see this error:

Error: No suitable shell found. Claude CLI requires a Posix shell environment.

This happens because Claude Code needs a Unix-like shell to work with projects, even on Windows. The solution is to tell Claude Code where to find Git Bash.

Run this in PowerShell as Administrator:

[System.Environment]::SetEnvironmentVariable('CLAUDE_CODE_GIT_BASH_PATH', 'C:\Program Files\Git\bin\bash.exe', 'User')

Restart your terminal after setting this. Claude Code will now use Git Bash for its shell operations.

Testing Claude in PowerShell

Before moving to VS Code, let’s make sure Claude Code is working properly in PowerShell:

# Create a test project
mkdir test-claude
cd test-claude

# Run Claude Code
claude

You should see the trust dialog asking if you want to proceed with this project. If you get any errors at this point, make sure you’ve set both environment variables correctly and restarted your terminal.

Setting Up VS Code Integration

Once Claude Code is working in PowerShell, we can set up the VS Code integration:

  • Open VS Code
  • Go to Extensions (Ctrl+Shift+X)
  • Search for “Claude Code”
  • Install the official extension by Anthropic

The extension should detect your Claude Code installation automatically. When you first use it, it will open your browser for authentication.

Issue 3: File System Provider Error

When using Claude Code in VS Code, you might encounter this error when Claude tries to modify files:

Error: cannot open claude_fs_right:c%3A%5CUsers%5C[...]%5Cfile.js
Detail: Unable to resolve filesystem provider with relative file path

This error appears when Claude actually tries to make changes to your files. The initial setup and authentication work fine, but when Claude attempts to modify code, this error pops up.

In my case, this was caused by having Cursor installed. The Claude Code extension uses the code command internally, and Cursor was intercepting these calls. If you have a similar setup with multiple code editors, check your PATH configuration:

  • Open “Edit the system environment variables” from Windows settings
  • Click “Environment Variables…” and find the Path variable under “User variables”
  • Click “Edit” and look for entries for both VS Code and Cursor
  • Move the VS Code path (like %USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\bin) above Cursor’s path
  • Save the changes and restart VS Code

Testing Claude in VS Code

Now let’s test the VS Code integration. Open VS Code in your test project and run claude in the integrated terminal. The real test comes when you ask Claude to make changes to files:

# In VS Code integrated terminal
claude

# Once Claude starts, try a command that modifies files:
# "Create a simple index.html file with a hello world message"

If Claude successfully creates or modifies files without errors, your setup is complete. If you encounter the file system provider error at this point, check your PATH configuration as described above.

Essential VS Code & Windows Tips

Now that you have Claude Code running, let’s configure it for maximum productivity on Windows. These tips will help you get the most out of your setup.

Multi-line Input in VS Code Terminal

In VS Code’s integrated terminal, you can enter multi-line prompts using Tab+Enter. This is especially useful for complex instructions. Alternatively, use a backslash \ followed by Enter to continue on the next line.

Set Up Terminal Notifications

Never miss when Claude completes a task. In VS Code settings, search for “terminal bell” notifications and enable them so you get alerts when long-running tasks finish. This is particularly helpful when Claude is working on complex refactoring or test generation.

Managing Context Window

Claude Code has a context window that can fill up during long sessions. Watch the “context left” indicator (usually bottom right) to see when you’re approaching the limit. Use these commands to manage it:

  • /clear – Resets the context completely for a fresh start
  • /compact – Summarizes the conversation to free up space while keeping important context

I typically use /clear between major tasks and /compact when working on related features.

Create Custom Commands

One of Claude Code’s best features is custom commands. Create a .claude/commands/ directory in your project and add markdown files for reusable workflows. For example, create .claude/commands/finalize.md:

# Finalize Task

1. Run all tests
2. Fix any linting issues
3. Commit changes with conventional commit format
4. Create pull request
5. Update documentation if needed

Then use it by typing /finalize in Claude Code.

Quick Commands with Headless Mode

For quick tasks, use the -p flag to run Claude in headless mode:

# Quick analysis without entering interactive mode
claude -p "what does the getUserData function do?"

# Pipe other commands into Claude
dir | claude -p "which files are test files?"

Better Code Reviews with GitLens

Install the GitLens extension in VS Code for excellent visibility into code changes. It shows inline blame annotations, commit history, and file changes. This is particularly helpful when reviewing changes made by Claude Code, as you can see exactly what was modified and when.

Run Multiple Instances

You can run multiple Claude Code instances in different terminal tabs for parallel work.

Wrapping Up

That’s your complete setup for Claude Code on Windows with VS Code. We’ve covered the installation, fixed the common issues, and shared the productivity tips that make this setup a true Cursor replacement.

The key points to remember are: add npm to your PATH, set the Git Bash path for Claude Code, and make sure VS Code comes before other editors in your PATH. Once configured, use custom commands, manage your context window, and leverage VS Code’s powerful extensions to maximize your productivity.

With native Windows support being so new, you might encounter other issues. But in my experience, once you get past the initial setup, Claude Code works flawlessly.