[Bug] Windows: terminal/cmd windows flash on every subprocess spawn across multiple CCD sessions

Open 💬 2 comments Opened Jun 9, 2026 by AVIDS2

Description

On Windows, Claude Code spawns visible terminal windows (conhost.exe + cmd.exe / bash.exe) for every subprocess operation — MCP server startup, tool execution (Bash), subagent spawning, etc. These windows flash briefly but are extremely disruptive, especially when multiple Claude Code sessions run concurrently under Claude Desktop.

Environment

  • OS: Windows 11 (not WSL)
  • Claude Desktop version: 1.11187.4 (Electron 41.6.1)
  • Claude Code version: 2.1.165
  • Shell: Git Bash (default on Windows install)

Steps to Reproduce

  1. Open Claude Desktop on Windows
  2. Create a Claude Code session with MCP servers (e.g., codegraph, tavily)
  3. Use the session — every tool call that spawns a subprocess (Bash, MCP stdio, subagent) flashes a terminal window
  4. With 2+ concurrent CCD sessions, the flashing is near-constant

Expected Behavior

Subprocesses should be spawned with windowsHide: true (Node.js) or CREATE_NO_WINDOW / STARTF_USESHOWWINDOW flags so they run in the background without visible terminal windows.

Actual Behavior

Every child_process.spawn() / child_process.exec() call creates a visible conhost.exe + cmd.exe/bash.exe window that flashes on screen. In a multi-session scenario (Claude Desktop with 3-5 CCD project sessions, each with MCP servers), this produces a constant stream of black terminal windows popping up and closing.

Root Cause

Claude Code's subprocess spawning on Windows does not set the windowsHide: true option in Node.js child_process APIs, nor does it use CREATE_NO_WINDOW for the spawned processes. This is a standard Windows development practice to prevent terminal flashing.

Specific code paths that trigger this:

  • MCP stdio servers: Each MCP server (codegraph, tavily, etc.) spawns via cmd.exe
  • Bash tool execution: Every Bash tool call spawns a new bash.exe via cmd.exe
  • Subagent spawning: Agent tool spawns child processes
  • Codex plugin: Additional process spawning for the codex companion

Impact

With N concurrent CCD sessions, each with M MCP servers, every tool call creates M + 1 visible terminal windows. For a typical setup with 2 MCP servers and 3 active sessions, that's potentially dozens of window flashes per minute during active use.

Suggested Fix

In all Windows subprocess spawning code paths, add windowsHide: true:

child_process.spawn(command, args, {
  windowsHide: true,
  // ...other options
});

Or for exec/execSync:

child_process.exec(command, { windowsHide: true }, callback);

This is a one-line fix per spawn call site and has zero functional impact — it only prevents the terminal window from being shown.

Additional Context

  • This is not a Git Bash issue — replacing the shell with PowerShell produces the same behavior
  • This is not an MCP server issue — the servers themselves run fine; it's the spawning mechanism
  • The problem is amplified by the fact that Claude Desktop keeps old CCD sessions alive in the background even when the user is only interacting with one session

View original on GitHub ↗

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