[BUG] IDE detection fails on subsequent runs, requires restart to work again
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Claude Code CLI
- Claude CLI version: 1.0.58
- Operating System: macOS 15.5
- Terminal: VS Code integrated terminal
Bug Description
Claude Code fails to detect VS Code IDE after the first successful session, despite being run from the correct project directory. The issue persists until a full system restart.
Steps to Reproduce
- Open VS Code in a project directory (e.g., /Users/[username]/Code/[project-name])
- Navigate to the same directory in terminal and run Claude Code - works correctly on first run
- Exit Claude Code
- Attempt to run Claude Code again from the same directory
- Receive error: "Found 1 other running IDE(s). However, their workspace/project directories do not match the current cwd."
Expected Behavior
Claude Code should consistently detect VS Code when run from the matching project directory, regardless of how many times it has been started and stopped.
Actual Behavior
Claude Code only detects VS Code correctly after a system restart. All subsequent attempts fail with a directory mismatch error, even though the working directory is correct.
Additional Context
VS Code Version: 1.102.1
Confirmed running from correct directory using pwd
VS Code is open and active in the same directory
Background Claude process remains running after exit (visible in ps aux | grep claude)
Process shows file monitoring flags: --exclude-dir=.git --exclude-dir=.venv etc.
Attempts to kill the background process (kill [PID]) report "no such process" but process persists
Only workaround is full system restart
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗