Claude CLI opens empty VSCode windows when launched from VSCode integrated terminal
Description
When running claude CLI from VSCode's integrated terminal (Git Bash), 3 empty VSCode windows open automatically after a few seconds. This does not happen when running from an external terminal.
Environment
- OS: Windows 11 Pro 10.0.26100
- Claude CLI: 2.1.59
- VSCode Extension: Claude Code VSCode MCP v2.1.71
- Terminal: Git Bash (integrated in VSCode)
- VSCode: Latest stable
Steps to Reproduce
- Open VSCode with the Claude Code extension installed
- Open the integrated terminal (Git Bash)
- Run
claude - Wait ~5 seconds
- Result: 3 new empty VSCode windows open (no project/folder, just blank)
Expected Behavior
No additional VSCode windows should open when starting the CLI.
Investigation Results
We ran extensive testing to isolate the cause:
| Test | Result |
|------|--------|
| claude from VSCode terminal | 3 empty windows open |
| claude from external terminal (Git Bash outside VSCode) | No windows open |
| claude --strict-mcp-config ~/.claude/no-mcp.json (no user MCP servers) | Still opens windows |
| Deleted ~/.claude/ide/*.lock files | Still opens windows (recreated by extension) |
| Cleared githubRepoPaths in ~/.claude.json | Still opens windows |
| Renamed ~/.claude/ide/ directory | Still opens windows |
Debug log analysis
The CLI debug log shows only one IDE MCP server connection:
MCP server "ide": Starting connection with timeout of 30000ms
MCP server "ide": Successfully connected to ws-ide server in 13ms
MCP server "ide": Connection established with capabilities: {"hasTools":true,...,"serverVersion":{"name":"Claude Code VSCode MCP","version":"2.1.71"}}
The 3 empty windows appear to be opened by the VSCode extension side when it processes the CLI's WebSocket connection, not by the CLI itself.
Workaround
Use an external terminal (Git Bash, PowerShell, or cmd outside VSCode) instead of the VSCode integrated terminal.
Additional Context
- The number of windows (3) was consistent across all tests
- The
--ideflag exists to enable auto-connect, but there is no--no-ideflag to disable it - The windows are completely empty (no project, no folder, no file open)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗