claude-code - 💡(How to fix) Fix [BUG] Windows: every tool call flashes a visible console window (child_process.spawn missing windowsHide: true)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

No error messages — this is a UX/performance bug, not a crash. Including environment + workaround context here:

Root Cause

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.

Fix Action

Fix / Workaround

No error messages — this is a UX/performance bug, not a crash. Including environment + workaround context here:

**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.

Code Example

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.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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.exe spawns
  • 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.exe spawns
  • MCP server launches (cmd.exe/npx wrappers)
  • Session-sidebar gh.exe pr view / pr checks polling

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

  1. Open Claude Code on Windows (version 2.1.142 confirmed; earlier versions likely affected too).
  2. Start any conversation that triggers tool calls — e.g. ask Claude to read a file or run a Bash command.
  3. 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING