[BUG] Windows: claude.exe calls `code --list-extensions` on startup, opening empty VS Code windows

Resolved 💬 4 comments Opened Mar 5, 2026 by alperbalkayaipe Closed Mar 6, 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 running claude from the VS Code integrated terminal (PowerShell or Git Bash) on Windows, multiple empty VS Code windows open on every startup. This started with the update to v2.1.66/v2.1.68 (March 4, 2026).

Root Cause (verified with process monitoring)

Using a PowerShell process monitor, we traced the exact cause:

NEW Code.exe PID=36816
  CMD: code --list-extensions
  PARENT PID=12264 CMD="C:\Users\...\claude.exe"

NEW Code.exe PID=30432
  CMD: code --list-extensions --show-versions
  PARENT PID=12264 CMD="C:\Users\...\claude.exe"

claude.exe directly spawns code --list-extensions during startup to detect VS Code extensions. On Windows, this has the side effect of opening new empty VS Code windows. Each call spawns a new renderer process (= new window) with associated extension hosts, language servers, etc.

This appears related to the v2.1.69 feature: "Added a one-time startup prompt suggesting Claude Code Desktop on macOS and Windows" — the IDE detection runs code --list-extensions which triggers the empty windows.

Environment

  • OS: Windows 11 Enterprise 10.0.22631
  • VS Code: 1.110.0 (system install at C:\Program Files\Microsoft VS Code\)
  • Claude Code: 2.1.69 (native binary)
  • Terminal: PowerShell and Git Bash (both affected)
  • Shell: Running claude from VS Code integrated terminal

Steps to Reproduce

  1. Open VS Code on Windows
  2. Open integrated terminal (PowerShell or Git Bash)
  3. Run claude
  4. 2-3 empty VS Code windows appear

What Should Happen?

Claude Code should not open empty VS Code windows. The code --list-extensions call should either:

  1. Be skipped entirely when running inside VS Code terminal (the extension can be detected via env vars or the VS Code extension API)
  2. Use ELECTRON_RUN_AS_NODE=1 with the CLI.js directly to avoid opening windows
  3. Be run with flags that prevent window creation (e.g., --disable-gpu won't help, but running via the Node.js CLI path would)
  4. At minimum, respect a config flag to disable IDE detection (see #15787)

Workaround

Strip VS Code from PATH before launching Claude:

# Add to PowerShell profile
function claude-clean {
    $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -notmatch 'VS Code' }) -join ';'
    claude @args
}

Related Issues (all closed without fix)

  • #7680 — VSCode opens multiple new windows (Sep 2025, closed as duplicate)
  • #10584 — Executing claude from vscode terminal opens new window (Oct 2025, closed as not planned)
  • #15787 — IDE detection runs on startup even when disabled (Dec 2025, closed as not planned)
  • #23743 — Claude Code spawns 3 blank windows on Windows (Feb 2026, closed as duplicate)

Claude Code Version

2.1.69

Platform

Anthropic API (claude.ai Max subscription)

Operating System

Windows

Terminal/Shell

PowerShell / Git Bash (both affected)

View original on GitHub ↗

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