CLI started in VS Code integrated terminal opens 3 blank VS Code windows (Windows)
Description
When running claude (or claude --dangerously-skip-permissions) from VS Code's integrated terminal (PowerShell) on Windows, 3 blank VS Code windows open every time. This does not happen when running from a standalone terminal (Windows Terminal).
Environment
- OS: Windows 11 Pro 10.0.26200
- VS Code extension:
anthropic.claude-codev2.1.69 - CLI:
@anthropic-ai/claude-codev2.1.69 (global npm install) - VS Code setting:
claudeCode.preferredLocation: "panel"
Steps to Reproduce
- Open VS Code with the Claude Code extension installed
- Open the integrated terminal (PowerShell)
- Type
claudeand press Enter - 3 blank VS Code windows appear immediately
Root Cause (from log analysis)
When the CLI starts inside VS Code's integrated terminal, it connects to the extension's WebSocket MCP server. This triggers a burst of ~62 rapid WebSocket connections (visible in the extension log), each displacing the previous one:
Extension log (window1/exthost/Anthropic.claude-code/Claude VSCode.log):
2026-03-05 06:52:37.757 [info] New WS connection from: /
2026-03-05 06:52:37.757 [info] Disconnecting previous WebSocket client
2026-03-05 06:52:37.757 [info] MCP server connected to transport
2026-03-05 06:52:37.760 [info] New WS connection from: /
2026-03-05 06:52:37.760 [info] Disconnecting previous WebSocket client
2026-03-05 06:52:37.760 [info] MCP server connected to transport
2026-03-05 06:52:37.763 [info] New WS connection from: /
... (62 connections total within ~8 seconds)
This cascade results in 3 new blank renderer processes being spawned by the main VS Code process, each activating the Claude extension and starting its own MCP server on a random port:
window31: Claude code extension is now active? — MCP Server running on port 24700
window32: Claude code extension is now active? — MCP Server running on port 50340
window33: Claude code extension is now active? — MCP Server running on port 43636
The renderer log also shows errors during this period:
2026-03-05 06:52:38.272 [error] [Extension Host] Error sending selection change notification: Error: WebSocket is not open. Cannot send message.
Additional Evidence
- VS Code
main.logshows exactly 3updateWindowsJumpListentries at the same timestamps as the blank windows - The pattern repeats consistently — every CLI start creates a new batch of 3 workspace storage directories (with no
workspace.json, confirming they're blank/folderless windows) - Groups of 3 extension hosts exit when the blank windows are closed, then 3 new ones spawn on next CLI start
Workaround
Run claude from a standalone terminal (e.g., Windows Terminal) instead of VS Code's integrated terminal. The blank windows do not appear when the CLI is not running inside VS Code's terminal.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗