OmniscioGuidesCould not locate the Claude CLI on PATH
Could not locate the Claude CLI on PATH in VS Code
Last checked against Anthropic's documentation on November 18, 2026. By the Omniscio team. Updated .
What is the exact message?
Failed to run Claude Code: Error: Could not locate the Claude CLI on PATH. Launching by name in a PowerShell terminal would run a 'claude' from the open folder instead of the installed CLI, so the launch was blocked. Make sure the Claude CLI's install directory is on your system PATH (not only your PowerShell profile), then restart VS Code and try again. VS Code reads PATH when it starts, so PATH changes take effect only after a restart.That is the whole message, from Anthropic's error reference. It appears on Windows, when you open Claude Code in the integrated terminal, the terminal's shell is PowerShell, and the extension cannot find the installed claude.
What does it mean?
The extension starts Claude Code by name. On Windows in a PowerShell terminal, that name resolves only through PATH, and a file called claude in the folder you have open would win over the one you installed.
So the extension checks first and refuses to launch rather than run the wrong program. The CLI itself may be installed and working; this is about where the extension looks.
One case looks the same and is different: if you only ever installed the extension, there is no CLI on PATH to find. The extension bundles a private copy for its own chat panel and does not add it to PATH, so the standalone install is the step that gives it one.
How do I fix it?
- Check whether the CLI exists at all. In PowerShell, run
Test-Path "$env:USERPROFILE\.local\bin\claude.exe". AFalseanswer means no standalone install, and the extension does not add its bundled copy to PATH, so install the CLI itself first. - Check whether that folder is on PATH. Run
$env:PATH -split ';' | Select-String '\.local\\bin'. A line withC:\Users\you\.local\binmeans it is already there. - Add it to your User PATH. If the check printed nothing, run these two lines, which Anthropic gives for exactly this case:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User') [Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User') - Set it there, not in your PowerShell profile. The extension does not run your profile, so a PATH edit that lives only there never reaches it.
- Restart VS Code, then try again. The extension checks the PATH VS Code captured at startup, so the change is invisible until the editor starts once more.
How do I know it worked?
- Claude Code opens in the extension instead of showing the message.
where.exe claudeprints the path you added, in a window opened after the change.- A terminal in VS Code runs
claude --versionand prints a version, which means the same PATH the extension reads now finds it.
Where these answers come from
- The message, word for word, and the
where.exe claudecheck: Anthropic's error reference, read November 18, 2026. - The Windows and PowerShell conditions, and the VS Code row that links this message: Claude Code in VS Code, read November 18, 2026.
- Where the install directory goes and how to verify PATH: Anthropic's installation troubleshooting, read November 18, 2026.
Common questions
Is Claude Code uninstalled?
Not necessarily. The message says the extension could not locate the CLI on PATH, which is a lookup failure. An install that worked in a terminal can still be missing from the PATH the extension inherits.
Why not launch it by name anyway?
Because a file called claude in the open folder would run instead of the installed one. The message states that reason, and that is why the launch is blocked rather than attempted.
Does this affect macOS or Linux?
The entry names Windows with a PowerShell terminal. Other platforms reach the missing-command case through the command not found guide.
I added PATH and it still fails. What now?
Confirm you set it as an environment variable rather than in your profile, and that VS Code was fully restarted afterwards. Those are the two conditions the message itself names.