[BUG] /ide command crashes with "onInstall is not defined" when auto-installing extension
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?
Running /ide crashes with onInstall is not defined when no IDE has the Claude Code extension installed and exactly one running IDE is detected.
In the /ide command handler (IR4), when exactly one running IDE is found and onInstallIDEExtension is available, an inline React component is created with a useEffect that calls:
function mR4() { onInstall(ideToInstall) }
onInstall and ideToInstall are local variables in the parent IR4 async function scope, but they aren't captured by the anonymous inline component's closure.
What Should Happen?
/ide should detect the running IDE, install the Claude Code extension/plugin, and prompt the user to restart their IDE — without crashing.
Error Messages/Logs
ERROR onInstall is not defined
/$bunfs/root/src/entrypoints/cli.js:3934:2548
- mR4 (/$bunfs/root/src/entrypoints/cli.js:3934:2548)
- O9 (/$bunfs/root/src/entrypoints/cli.js:564:63001)
- bu (/$bunfs/root/src/entrypoints/cli.js:564:76032)
- Eh (/$bunfs/root/src/entrypoints/cli.js:564:75914)
- bu (/$bunfs/root/src/entrypoints/cli.js:564:76819)
- Eh (/$bunfs/root/src/entrypoints/cli.js:564:75914)
- bu (/$bunfs/root/src/entrypoints/cli.js:564:76011)
- Eh (/$bunfs/root/src/entrypoints/cli.js:564:75914)
- bu (/$bunfs/root/src/entrypoints/cli.js:564:76011)
- Eh (/$bunfs/root/src/entrypoints/cli.js:564:75914)
Steps to Reproduce
- Have an IDE running (e.g., VS Code) WITHOUT the Claude Code extension installed
- Launch
claude - Run
/ide - Only one running IDE is detected, triggering the auto-install path
- Crash: "onInstall is not defined"
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Unknown
Claude Code Version
2.1.70
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
AI Disclosure: I used Claude to help write this issue.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗