Windows: 3 extra VS Code windows open when starting claude from integrated terminal

Resolved 💬 2 comments Opened Mar 5, 2026 by MNUSSCarvana Closed May 11, 2026

Bug Description

When running claude from VS Code's integrated terminal (PowerShell) on Windows, 3 extra VS Code windows open sequentially with ~3 second delays. Each window shows the default "Welcome to VS Code" tab, indicating fresh VS Code instances are being launched.

Root Cause

Claude Code detects it's running inside VS Code via the TERM_PROGRAM=vscode environment variable and triggers IDE integration logic. Something in that code path on Windows is launching code.exe 3 times.

Confirmed by: clearing the env var before launch stops the issue:

$env:TERM_PROGRAM=""; $env:TERM_PROGRAM_VERSION=""; claude

Steps to Reproduce

  1. Open VS Code on Windows 11
  2. Open the integrated terminal (PowerShell)
  3. Run claude
  4. Observe 3 new VS Code windows open with "Welcome to VS Code" screens, each ~3 seconds apart

Environment

  • OS: Windows 11 Enterprise (10.0.22631)
  • Claude Code version: 2.1.69
  • VS Code terminal: PowerShell
  • Claude Code VS Code extension: installed but issue persists even with it disabled

What was ruled out

  • Claude Code hooks and statusLine (disableAllHooks: true — still happened)
  • MCP servers (completely removed all 5 — still happened)
  • VS Code extensions including claude-code, roo-cline, claude-dev (all disabled — still happened)
  • Shell profile scripts (.bashrc, .bash_profile — clean)
  • Only happens in VS Code integrated terminal, NOT in external terminals

Workaround

Wrap claude in a PowerShell function that clears the VS Code detection env vars:

# In $PROFILE (Microsoft.PowerShell_profile.ps1)
function claude {
    $env:TERM_PROGRAM = ""
    $env:TERM_PROGRAM_VERSION = ""
    & "C:\Users\$env:USERNAME\AppData\Roaming\npm\claude.cmd" @args
}

View original on GitHub ↗

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