GIZIN
Claude Code
6 min

'claude' is not recognized on Windows: Fix PATH in PowerShell and CMD

Claude Code installed without errors, but typing claude in PowerShell or Command Prompt says it is not recognized. In most cases the install folder is simply missing from your PATH. Here is how to check, fix it, and confirm, step by step.

Claude CodeWindowsTroubleshootingPowerShellEnvironment Setup

'claude' is not recognized on Windows: How to Fix It

The installer finished. No errors on screen. Then you type claude, and Windows says this.

In Command Prompt (CMD):

text
'claude' is not recognized as an internal or external command,
operable program or batch file.

In PowerShell:

text
claude : The term 'claude' is not recognized as the name of a cmdlet, function, script file, or operable program.
    + FullyQualifiedErrorId : CommandNotFoundException

Before you reinstall, check one thing. In most cases Claude Code is already on your machine. Windows just doesn't know where to look for it.

On macOS or Linux and seeing claude: command not found? See Solving "claude: command not found" instead.

Two common causes

1. The install folder is not in your PATH

The official installer (irm https://claude.ai/install.ps1 | iex in PowerShell, or install.cmd in CMD) puts Claude Code here:

text
%USERPROFILE%\.local\bin\claude.exe

That is C:\Users\<your-username>\.local\bin\claude.exe.

When you type a command, Windows searches the folders listed in the PATH environment variable, one by one. If this folder isn't on that list, Windows reports "not recognized" even though claude.exe is sitting right there.

According to the official docs, the installer detects this case and prints a note under Setup notes: in its output: Native installation exists but C:\Users\you\.local\bin is not in your PATH. It shows you the fix, but it does not change PATH itself. That is why the install "succeeds" and claude still doesn't run.

2. An old npm install is still around

If you once installed Claude Code with npm install -g @anthropic-ai/claude-code, you may now have both the npm version and the native version. Only one of them may be on PATH, or the older one may be found first, which leads to "not found" or to the wrong version starting. The official docs recommend keeping a single install: the native one at %USERPROFILE%\.local\bin\claude.exe.

Check what's wrong

In PowerShell

First, check that the program is actually there:

powershell
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
  • True: the program is there. Move on to the next check.
  • False: there is no native install. If you haven't installed Claude Code another way (npm or WinGet), install it again with the official installer.

Next, check whether that folder is in your PATH:

powershell
$env:PATH -split ';' | Select-String '\.local\\bin'

If this prints C:\Users\<your-username>\.local\bin, the folder is in your PATH. If it prints nothing, that's your problem.

In Command Prompt

Check the program:

bat
dir "%USERPROFILE%\.local\bin\claude.exe"

If you see a listing for claude.exe, the program is there. If you see File Not Found or The system cannot find the path specified., it isn't installed yet.

Check PATH:

bat
echo %PATH% | findstr /i "local\bin"

No output means the folder is not in your PATH.

Check for more than one install

In PowerShell, this lists every claude that Windows can find on your PATH:

powershell
where.exe claude

Two or more lines means you have overlapping installs. INFO: Could not find files for the given pattern(s). means there is no claude on your PATH at all.

Fix it

Add the folder to your User PATH (PowerShell)

Paste these two lines into PowerShell and run them. They append %USERPROFILE%\.local\bin to your User PATH. You don't need to run PowerShell as Administrator.

powershell
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

Add the folder to your User PATH (Settings)

If you only use Command Prompt, or prefer clicking through the settings:

  1. Search for "environment variables" in the Start menu and open "Edit environment variables for your account"
  2. Under "User variables", select Path and click "Edit"
  3. Click "New", enter %USERPROFILE%\.local\bin, and click "OK" to close each window

Remove the old npm install

If where.exe claude found more than one, remove the npm version and keep only the native one:

bash
npm uninstall -g @anthropic-ai/claude-code

If the legacy "local npm" install (%USERPROFILE%\.claude\local) is still there, run this in PowerShell:

powershell
Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\local"

This removes only that folder. Your settings in %USERPROFILE%\.claude (such as CLAUDE.md and settings.json) stay where they are.

If you also installed Claude Code with WinGet, remove that copy too:

powershell
winget uninstall Anthropic.ClaudeCode

Restart your terminal

Skip this step and you'll still see "not recognized", even after a correct fix.

Changing PATH does not affect PowerShell or Command Prompt windows that are already open. Close all of them and open a new one.

If you use a terminal inside an editor such as VS Code, closing the terminal tab is not enough. Quit the editor and start it again. A terminal inside an editor inherits the PATH the editor had when it started.

In the new terminal, run:

powershell
claude --version

If you see a version number such as 2.1.211 (Claude Code), you're fixed.

Still not working?

  • Run [Environment]::GetEnvironmentVariable('PATH', 'User') and look for .local\bin in the output. If it's missing, the change wasn't saved. Run the two lines from "Add the folder to your User PATH" again.
  • If the error started right after Claude Code updated itself, the cause is different. Follow the steps to restore claude.exe from its backup in the official installation troubleshooting guide.
  • If claude starts but something else seems off, run claude doctor. It reports your install health and any settings warnings in one place.

Summary

CheckResultWhat to do
Does claude.exe exist?NoInstall with the official installer
Is .local\bin in PATH?NoAdd it to your User PATH
Does where.exe claude show 2+ lines?YesRemove the npm (or WinGet) copy
After any fix—Restart the terminal (and the editor)

"Not recognized" almost never means "not installed." It usually means "Windows doesn't know where it is." Check your PATH before you reinstall.


Get weekly field notes on running AI employees with Claude Code, in the GIZIN Newsletter →

Loading images...

📢 Share this discovery with your team!

Help others facing similar challenges discover AI collaboration insights

How far along is your AI proficiency?

14 questions to find where you stand. Get your next step tailored to your result (free, ~3 min)

Related Articles