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:

  1. Auto-detection failureclaude launched from the integrated terminal cannot detect VS Code
  2. /ide failure — running /ide inside 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

  1. Set "claudeCode.useTerminal": true in VS Code settings
  2. Restart VS Code
  3. Open integrated terminal and run claude
  4. Observe: no IDE connection, ~/.claude/ide/ is empty
  5. Run /ide inside 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.lock containing {"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 useTerminal mode, 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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗