Last updated: · Applies to: Windows; Claude Code VS Code terminal mode using PowerShell
Could not locate the Claude CLI on PATH: Windows VS Code fix
Could not locate the Claude CLI on PATH. means the Windows PowerShell terminal-mode check could not find the standalone CLI in the PATH inherited by VS Code. The official error reference explains that this safety check prevents accidentally running a claude executable from the open project folder.
Why the panel and terminal can differ
The VS Code chat panel bundles its own CLI; installing the extension does not install the shell command needed by terminal mode. The extension inherits PATH when the editor launches. Changes made only in a PowerShell $PROFILE are not inherited by that check, even if an interactive shell finds Claude. Git Bash is not a mandatory remedy for this PowerShell PATH issue.
Verify installation and repair inherited PATH
Check from a new external PowerShell
Open a new PowerShell window outside VS Code, in a neutral directory outside your project, and run:
where.exe claudeInspect the returned location. A project-local executable is not a suitable installation. If nothing resolves, distinguish an absent installation from a missing PATH entry before editing settings.
Verify the actual standalone executable
For the native Windows installation, the official install troubleshooting page gives this check:
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"Trueconfirms a file exists at that native-install location. Other installation methods can use a different path; verify their actual executable directory instead of forcing this example. If the standalone CLI is absent, follow official setup. Do not copy the extension’s bundled binary into a shell directory.Add the verified directory to Windows User PATH
Open Edit environment variables for your account. Under User variables, select Path → Edit → New and add the actual executable directory. For the verified native installation, that is
%USERPROFILE%\.local\bin. Preserve all existing entries and save the dialogs. Add the directory, notclaude.exeitself. The official PATH instructions use persistent Windows environment settings; a profile-only change is insufficient. Avoid commands that replace the whole PATH, including a carelesssetxreplacement.Fully quit and reopen VS Code
Save work and close all your VS Code windows, then launch the editor again so it inherits the new environment. Opening another integrated terminal inside an editor that was already running does not refresh the editor process’s captured PATH.
Verify discovery, then terminal mode
In a new terminal in the reopened editor, run:
where.exe claude claude --versionConfirm the executable location and version, then retry Claude Code terminal mode with a small request. Do not add the project folder or
.to PATH, and do not disable the safety block. If discovery succeeds but Claude still exits, use the process-exited guide to read the underlying failure.
FAQ
Does installing the VS Code extension add claude to PATH?
No. The chat panel bundles a CLI, while terminal mode needs a separate standalone installation available on the editor’s inherited PATH.
Why does my PowerShell profile fix not reach the extension?
The extension does not run your PowerShell profile for this check. Add the actual executable directory to Windows User PATH and fully restart VS Code.
Should I add the project folder or disable the safety check?
No. Keep the safety check enabled and use the verified standalone installation directory. Do not add the project folder or . to PATH.
Sources
This is an independent, unofficial help site. It is not affiliated with or endorsed by Anthropic or OpenAI. Check the linked documentation and reports for your environment.