[BUG] CLI-style terminal does not use bundled CLI binary, causing "command not found" error
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
## Bug Description
When switching the Claude Code VS Code extension to "CLI-style" mode,
it opens a terminal and runs claude as a shell command. However, the
bundled CLI binary is not added to the terminal's PATH, so users who
have not separately installed the global CLI will see:
command not found: claude
## Current Behavior
GUI mode works fine (uses the bundled binary directly), but CLI mode
relies on claude being available in the shell PATH, which is
inconsistent and breaks for users who only installed the extension.
## Environment
- VS Code with Claude Code extension installed
- No global
@anthropic-ai/claude-codenpm package installed
What Should Happen?
## Expected Behavior
The extension should either:
- Use the bundled binary's absolute path when launching the terminal, OR
- Clearly prompt the user to install the global CLI if it cannot be found in PATH
Error Messages/Logs
command not found: claude
Steps to Reproduce
## Steps to Reproduce
- Install the Claude Code VS Code extension (do NOT install the global CLI via npm)
- In extension settings, switch UI style to "Terminal / CLI mode"
- The extension opens a terminal and attempts to run
claude command not founderror appears
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.97 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
This appears to be a straightforward vscode extension design issue that should be relatively easy to fix.
The extension already bundles its own CLI binary and uses it correctly in GUI mode.
The fix should be consistent: when launching a CLI-style terminal, the extension
should inject the bundled binary's directory into the terminal's PATH (via
Terminal.env in the VS Code API), so the claude command resolves correctly
without requiring users to separately install the global CLI or manually configure
their PATH.
The alternative — requiring users to install @anthropic-ai/claude-code globally
before the CLI-style mode works — is undocumented and inconsistent with the behavior
of GUI mode. Users who install only the extension have a reasonable expectation that
all its features work out of the box.
Preferred fix: have the extension register its bundled binary's path into the
spawned terminal's environment, eliminating the need for a redundant global
installation.
Note: I was unsure whether plugin-specific bugs should be reported in a separate
repository, so I'm filing this here. Please redirect if there is a more appropriate tracker.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗