Windows: console window flashes on every Bash tool call
Description
On Windows 11, every Bash tool call opens a visible console window (~2s, steals focus) because claude.exe spawns bash.exe (Git Bash, console subsystem at C:\Program Files\Git\bin\bash.exe) without passing CREATE_NO_WINDOW creation flag.
Environment
- Claude Code 2.1.220
- Windows 11
- Shell: Git Bash (
C:\Program Files\Git\bin\bash.exe)
Steps to reproduce
- Start a Claude Code session on Windows
- Let the agent run any Bash tool call (e.g.
git status,npm test) - A black console window appears briefly for each command, stealing focus
Expected behavior
Bash tool calls should execute without opening a visible console window. The CREATE_NO_WINDOW flag (0x08000000) on CreateProcess suppresses the window while preserving stdio pipes and exit codes.
Context
We systematically eliminated all other sources of console flashes on our side (CLI spawns, hook commands, MCP servers, plugins) and traced the remaining window to claude.exe → bash.exe spawns via process tree inspection (Win32_Process WMI). The parent PID of the flashing bash.exe is claude.exe itself, not any hook or plugin.
Screenshot of the flashing window (title bar shows C:\Users\...\AppData\Loca...):
The fix is a one-line addition to wherever CreateProcess / child_process.spawn is called for Bash tool execution on Windows: pass CREATE_NO_WINDOW (or windowsHide: true in Node.js child_process options).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗