'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.
Table of Contents
'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):
'claude' is not recognized as an internal or external command,
operable program or batch file.
In PowerShell:
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:
%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:
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:
$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:
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:
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:
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.
$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:
- Search for "environment variables" in the Start menu and open "Edit environment variables for your account"
- Under "User variables", select
Pathand click "Edit" - 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:
npm uninstall -g @anthropic-ai/claude-code
If the legacy "local npm" install (%USERPROFILE%\.claude\local) is still there, run this in 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:
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:
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\binin 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.exefrom its backup in the official installation troubleshooting guide. - If
claudestarts but something else seems off, runclaude doctor. It reports your install health and any settings warnings in one place.
Summary
| Check | Result | What to do |
|---|---|---|
Does claude.exe exist? | No | Install with the official installer |
Is .local\bin in PATH? | No | Add it to your User PATH |
Does where.exe claude show 2+ lines? | Yes | Remove 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
Solving "claude: command not found" - Claude Code Running but Can't Launch in New Terminal
It's running in another terminal but getting "command not found." A thorough investigation reveals the true identity of the Claude command.
How AI Employee Personalities Grow | Background Portraits and the Pygmalion Effect in Practice
When you put an AI employee's face on your terminal background, the way you talk to them changes — and so does the output. The background portrait was a trigger for the Pygmalion effect.
Claude Code Is Fast, But Is the Quality Trustworthy? Cross-AI Adversarial Testing Caught 5 Findings — 2 Fixed in 6 Minutes Inside a 30-Minute Demo
Claude Code is fast — but how do you trust the quality? Here is how a task estimated at 2-3 hours was finished in 30 minutes, with a work-AI writing code, an inspection-AI running adversarial tests, and a 6-minute fix for the two demo-critical findings.
