Windows: Bash/PowerShell tool calls spawn visible conhost console windows (missing windowsHide)
Summary
On Windows, the Claude Code CLI spawns a visible conhost.exe console window for every Bash and PowerShell tool call. During an agent session that runs many shell commands, the user sees constant black-flash popup windows on their desktop (one per tool call, ~100–300ms each). With rapid tool use this reads as "tons of popups."
Root cause
The CLI spawns bash.exe / powershell.exe (console-subsystem executables) via Node's child_process.spawn() without windowsHide: true (equivalently, without the CREATE_NO_WINDOW 0x08000000 process-creation flag). Windows therefore allocates and briefly shows a console window for each spawned shell.
Expected
Shell subprocesses for tool calls should be spawned windowless on Windows — no visible console flash — the same way pythonw.exe runs windowless.
Proposed fix
Add windowsHide: true to the child_process.spawn() options used by the Bash/PowerShell tool execution path on Windows:
spawn(shell, args, { windowsHide: true /* + existing opts */ });
This hides the console window without affecting stdout/stderr capture.
Impact
- Highly disruptive for long autonomous/agentic sessions on Windows (the flashing is constant).
- There is currently no user-side mitigation: no
settings.jsonkey, env var, or CLI flag controls this. The only workaround is "use fewer shell tool calls," which is impractical.
Environment
- OS: Windows 11
- Claude Code CLI (native Windows)
- Affects: every Bash tool call and every PowerShell tool call
Verification done
Confirmed empirically with a Win32_ProcessStartTrace capture: console spawns correlate 1:1 with agent shell-tool activity and stop entirely when the agent stops issuing shell commands. Scheduled tasks and third-party apps were ruled out as the cause.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗