[BUG] Windows: every tool call flashes a visible console window (child_process.spawn missing windowsHide: true)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
On Windows, Claude Code spawns visible console-subsystem child processes for tool calls and some internal operations. Each spawn briefly flashes a black cmd.exe-style window on screen.
In an active conversation with frequent tool calls, this produces several popups per second, causing UI distraction and measurable typing/scroll lag in the renderer.
Root cause: child_process.spawn is being called without windowsHide: true (or equivalently the CREATE_NO_WINDOW Win32 creation flag) on a subset of spawn sites. Windows allocates a console window for each child and only hides it once the process attaches — producing the flash.
Evidence — partial-coverage bug, not a platform issue:
Live process snapshot during interaction shows claude.exe (the Code stream-json process) directly spawning child claude.exe processes with NON-headless conhost.exe attached:
PID 15652 conhost.exe ← parent 33676 claude.exe (no --headless flag)
PID 34268 conhost.exe ← parent 26940 claude.exe (no --headless flag)
Compare to other spawn sites in the same session that DO pass the headless flag — these do not flash:
PID 14360 conhost.exe ← parent 21380 claude.exe (--headless --width 80 --height 24)
So the flag IS being passed in some spawn sites and not others — this is a partial-coverage bug.
Other offending spawn sites observed:
- Tool execution (Bash, PowerShell, Read of large files, etc.)
- Internal subagent
claude.exespawns - MCP server launches via
cmd.exe /d /s /c "npx <server>"wrappers gh.exe pr view <branch>calls from the session sidebar
What Should Happen?
No console windows should ever flash when Claude Code spawns internal subprocesses.
Fix: pass windowsHide: true on all Node child_process.spawn / fork / execFile calls. For sites using the Win32 CreateProcess API directly, set CREATE_NO_WINDOW (0x08000000) in creationFlags.
Sites needing the fix based on the trace above:
- Tool execution (Bash, PowerShell, gh, etc.)
- Internal subagent
claude.exespawns - MCP server launches (
cmd.exe/npxwrappers) - Session-sidebar
gh.exe pr view/pr checkspolling
Error Messages/Logs
No error messages — this is a UX/performance bug, not a crash. Including environment + workaround context here:
**Environment**
- Claude Code: 2.1.142
- OS: Windows 11 (arm64)
- Host: Claude Desktop 1.8089.1.0 (Microsoft Store install, `Claude_pzs8sxrjxfjjc`)
- Repro consistency: 100% on every tool call
**Workarounds attempted (none fully resolve):**
- Disabling project-level `playwright` MCP from `~/.claude.json` → reduced one spawn source, did not fix per-tool-call flashes.
- Disabling 9 Claude Code plugins in `~/.claude/settings.json` → reduced background MCP keepalive, did not fix per-tool-call flashes.
- Archiving old Claude Desktop sessions to reduce sidebar polling → reduced `gh.exe` background spawn rate but is orthogonal to the per-tool-call issue.
The only effective workaround appears to be running Claude Code in WSL, which is undesirable for users developing against Windows-native filesystems.
Steps to Reproduce
- Open Claude Code on Windows (version 2.1.142 confirmed; earlier versions likely affected too).
- Start any conversation that triggers tool calls — e.g. ask Claude to read a file or run a Bash command.
- Observe: each tool call produces a brief (<1s) flash of a black console window. Sometimes multiple flashes per call. Position is random (default Windows console placement).
Reproduces 100% of the time on every tool call. Severity scales with conversation length and tool-call frequency.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.142 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗