Windows: Bash/PowerShell tool calls create visible console windows
Description
On Windows 11, every Bash and PowerShell tool call spawns a visible console window (PowerShell terminal) that flashes on screen. When working on any non-trivial task, this creates dozens of flashing terminals — extremely disruptive to workflow.
Environment
- Claude Code 2.1.119
- Windows 11 Home 10.0.26200
- Running via Claude Code Desktop app
Root Cause
When Claude Code spawns shell processes (cmd.exe, powershell.exe, bash.exe, node.exe) on Windows, it appears to use child_process.spawn() or child_process.exec() without setting windowsHide: true in the options. On Windows, spawning a console-subsystem process from a GUI application (Electron) without this flag creates a new visible console window.
Workarounds Applied
I've been able to suppress windows for hooks, statusLine, and MCP servers by wrapping commands through pythonw.exe (GUI subsystem) with subprocess.Popen(creationflags=CREATE_NO_WINDOW). However, the core Bash and PowerShell tool calls are spawned internally by Claude Code and can't be wrapped from user settings.
Proposed Fix
Add windowsHide: true to all child_process.spawn() / child_process.exec() calls on Windows, or expose a setting like:
{
"windowsHide": true
}
This is a one-line fix in Node.js — the windowsHide option sets the CREATE_NO_WINDOW (0x08000000) creation flag, which prevents console windows from appearing while still allowing stdout/stderr capture through pipes.
Impact
Every single Bash/PowerShell tool invocation flashes a terminal window. On a typical session this means hundreds of window flashes. Hooks and MCP servers compound the issue since they also spawn processes, though those can be worked around (see above).
References
- Node.js docs:
windowsHideoption - Windows API:
CREATE_NO_WINDOWprocess creation flag
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗