VS Code extension does not create IDE lock file when useTerminal is enabled
Resolved 💬 4 comments Opened Mar 2, 2026 by churnish Closed Mar 30, 2026
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?
When claudeCode.useTerminal is set to true in VS Code settings, the Claude Code extension activates successfully but never creates a lock file in ~/.claude/ide/. This causes:
- Auto-detection failure —
claudelaunched from the integrated terminal cannot detect VS Code /idefailure — running/ideinside a session reports "No available IDEs detected"
The extension host log confirms the extension activates:
ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
But ~/.claude/ide/ remains empty — no lock file is ever written.
Reproduction Steps
- Set
"claudeCode.useTerminal": truein VS Code settings - Restart VS Code
- Open integrated terminal and run
claude - Observe: no IDE connection,
~/.claude/ide/is empty - Run
/ideinside the session — reports no IDEs detected
Additional Observations
- When a lock file does exist from a previous session, it can become stale: the file retains the old PID in its filename while the JSON content inside references the new VS Code PID. For example,
26375.lockcontaining{"pid": 66765, ...}where PID 26375 is dead but 66765 is the active VS Code process. - This suggests the extension sometimes overwrites existing lock files without renaming them, and in
useTerminalmode, skips lock file creation entirely.
Expected Behavior
The extension should create a lock file in ~/.claude/ide/ regardless of useTerminal mode, since users may also run claude from external terminals that need to discover the IDE.
Environment
- Claude Code CLI: 2.1.62
- VS Code extension: 2.1.63
- VS Code: 1.109.5 (arm64)
- macOS: 26.3 (Darwin 25.3.0, Apple Silicon)
Related
This is a specific sub-issue of the broader IDE connectivity instability tracked in #26285.
🤖 Generated with Claude Code
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗