claude-code - 💡(How to fix) Fix Windows: Bash/PowerShell tool calls create visible console windows [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#54683Fetched 2026-04-30 06:38:55
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

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.

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.

Fix Action

Fix / Workaround

Workarounds Applied

Code Example

{
  "windowsHide": true
}
RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

Add windowsHide: true to child_process.spawn() or child_process.exec() calls in Claude Code to prevent visible console windows from appearing on Windows.

Guidance

  • Review the Claude Code source to identify all instances of child_process.spawn() and child_process.exec() and add the windowsHide: true option to prevent console windows from flashing.
  • Consider exposing a user setting to control this behavior, allowing users to opt-in or opt-out of hiding console windows.
  • Verify the fix by running Claude Code on Windows 11 and checking that no console windows appear when running Bash or PowerShell tools.
  • If modifying the source code is not feasible, explore alternative workarounds, such as wrapping commands through pythonw.exe with subprocess.Popen(creationflags=CREATE_NO_WINDOW), as done for hooks and MCP servers.

Example

const childProcess = require('child_process');

// Before
childProcess.spawn('powershell.exe', ['command']);

// After
childProcess.spawn('powershell.exe', ['command'], { windowsHide: true });

Notes

This fix assumes that Claude Code uses Node.js child_process module to spawn shell processes. If the code uses a different method, the fix may need to be adjusted accordingly.

Recommendation

Apply the workaround by adding windowsHide: true to child_process.spawn() and child_process.exec() calls, as this is a simple and effective solution to prevent console windows from flashing on Windows.

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