Windows: Console windows flash when running Bash commands (missing windowsHide option)
Resolved 💬 3 comments Opened Dec 28, 2025 by cmidds Closed Jan 1, 2026
Description
On Windows, every Bash tool call causes console windows (cmd.exe) to flash briefly on screen. This is disruptive to workflow and visually jarring.
Environment
- OS: Windows 10/11
- Claude Code version: v2.0.76
- Node.js: v22.19.0
Steps to Reproduce
- Run Claude Code on Windows
- Execute any Bash command (e.g.,
node --version) - Observe console window flashing
Root Cause
Claude Code's internal child_process.spawn() calls don't use windowsHide: true. This affects:
- The Bash/shell spawn for running commands
- Stop hook spawns (e.g.,
node stop-hook.js)
Attempted Workarounds (all failed)
- NODE_OPTIONS injection: Set
NODE_OPTIONS=--require suppress-spawns.jsto monkey-patch spawn - Claude Code appears to sanitize this environment variable - PATH shims: Creating wrapper scripts would flash windows themselves
- VBScript wrappers: Can't handle stdin for hooks
Suggested Fix
Add windowsHide: true to spawn options when running on Windows:
spawn(command, args, {
...options,
windowsHide: process.platform === 'win32'
});
This is a one-line fix that would eliminate the flashing entirely.
Additional Context
We successfully fixed window flashing in our own code (MCP server spawns) using windowsHide: true and the process.type = 'utility' trick to satisfy the Electron check in the MCP SDK. However, Claude Code's internal spawns remain unfixed and we have no way to patch them externally.
Impact
- Affects all Windows users
- Multiple windows flash per command (we counted ~5 per dev:start workflow)
- Significantly disrupts development workflow
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗