1. Open a new terminal first
A window that was already open keeps its old PATH. A terminal inside an editor (VS Code, for example) takes its PATH from the editor, so quit and reopen the editor too. Then try claude --version again.
2. Check Claude Code is there
The native installer puts the program at %USERPROFILE%\.local\bin\claude.exe. In PowerShell:
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
False means there is no native install: install it (or, if you used npm or WinGet, it lives elsewhere). True means it is installed: go to step 3.
Installed only the VS Code extension? It bundles its own private copy and does not add claude to PATH. Run the standalone install to use claude in a terminal.
3. Add the folder to your PATH
Check whether it is already there:
$env:PATH -split ';' | Select-String '\.local\\bin'
No output? Add it to your user PATH (permanent, run once):
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
Then open a new terminal. In CMD you can instead add %USERPROFILE%\.local\bin to the User PATH in System Settings → Environment Variables. The installer also tells you when this is needed: its output says Native installation exists but C:\Users\you\.local\bin is not in your PATH.
It worked before, and broke right after an update
To update on Windows, Claude Code renames claude.exe to a backup and moves the new version in. If that move fails, the folder keeps only the backup, named claude.exe.old. plus a timestamp. Restore the newest backup in PowerShell:
Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe
No backup file, or still broken? Reinstall with irm https://claude.ai/install.ps1 | iex.
'claude' opens the Claude desktop app instead
An older Claude Desktop can register a Claude.exe in the WindowsApps folder that comes first on PATH. Update Claude Desktop to the latest version.
Other Claude Code install errors on Windows
- Full guide: install Claude Code on Windows
- 'irm' is not recognized / The token '&&' is not a valid statement separator
- running scripts is disabled on this system (npm install)
- requires either Git for Windows (for bash) or PowerShell
- < was unexpected at this time, System.Xml.XmlDocument, or 403 during install
Source: Anthropic's Claude Code docs, Advanced setup and Troubleshoot installation and login, read 28 Nov 2026. Claude Code updates often: if a step here no longer matches, the official docs win.