Windows: Console window flashing when executing tools
Open 💬 41 comments Opened Dec 20, 2025 by guanknow
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?
## Description
When using Claude Code on Windows (Windows Terminal), a console window briefly flashes/appears every time a tool is executed (Bash, Grep, Glob, Read, etc.).
## Environment
- OS: Windows
- Terminal: Windows Terminal
- Platform: win32
## Steps to Reproduce
- Run Claude Code on Windows
- Execute any command or let Claude use any tool
- Observe brief window flash
## Expected Behavior
Tools should execute without visible window flashing.
## Possible Solution
When creating child processes on Windows, use CREATE_NO_WINDOW flag or STARTUPINFO.dwFlags = STARTF_USESHOWWINDOW with wShowWindow = SW_HIDE.
## Workaround
Currently using WSL as a workaround.
---
What Should Happen?
11
Error Messages/Logs
Steps to Reproduce
11
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.74
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
41 Comments
I'm also experiencing this issue, and it extends beyond just tool execution.
Additional Context
The console window flashing also occurs when plugin hooks execute. For example, the
claude-memplugin registers hooks forSessionStart,UserPromptSubmit,PostToolUse, andStopevents that runnodeandbuncommands. Each execution creates a visible console window.What I tried (unsuccessfully)
WScript.Shell.RunwithvbHideflag. Failed due to quote escaping issues withcmd /c.powershell -WindowStyle Hidden -Command "...". The PowerShell window was hidden, but the spawnednode.exe/bun.exeprocesses still created their own console windows.Root Cause
On Windows, console applications (like
node.exe,bun.exe) create console windows by default when spawned. The only reliable way to prevent this is to use theCREATE_NO_WINDOWflag when callingCreateProcess().Environment
Request
Please consider implementing
CREATE_NO_WINDOWfor all child process spawning on Windows, including:This would significantly improve the Windows user experience.
I've recently started to experience this on windows and it's a really bad user experience. You can't do anything else while claude is running or it'll get in the way
yes , it's very annoying
Hook execution also affected - critical UX impact for plugin users
User Experience Impact:
I'm experiencing this same issue with plugin hooks, not just tool execution. Every time a claude-mem plugin hook executes (
SessionStart,UserPromptSubmit,PostToolUse,Stop), a Node.js console window flashes on screen, often stealing keyboard focus mid-sentence. This happens dozens of times per session and significantly disrupts workflow.Root Cause:
The issue is in Claude Code's hook execution function (appears to be
GE1()in the bundled CLI). The spawn call is missing thewindowsHideoption:Current Code:
Required Fix:
Precedent:
This exact fix was already implemented in:
claude-agent-sdk-typescript(Issue anthropics/anthropic-sdk-typescript#103)Why Workarounds Don't Work:
All attempted workarounds fail because:
-WindowStyle Hidden→cmd.exespawns first before PowerShellstart /b→ Still creates initialcmd.exewindowThe ONLY solution is fixing the spawn call at the source.
Impact Scope:
This affects:
Business Impact:
For professional Windows users, this makes Claude Code nearly unusable. The constant window flashing:
Request:
Could this be prioritized for the next patch release? The fix is a one-line change that would immediately improve UX for all Windows users. I'm happy to test a beta build if that would help.
Environment:
Thank you for considering this!
Hi team — adding an update since my duplicate report (#16880) was closed.
I can still reproduce the same “console window flash” on Windows when tools run, now on the VS Code extension as well:
The worst part is that the flashing window steals foreground focus while it appears. During that moment I can’t interact with VS Code (keyboard input gets interrupted / clicks can be lost), so it effectively blocks other work. This is not just distracting — it actively breaks workflow.
Could you share the current status and when you expect a fix (e.g., a target version or timeframe)?
Thanks.
This is extraordinarily disruptive when using CC on Win11. One workaround is to use an admin terminal but doing so creates its own downstream issues and shouldn't be necessary. This is seriously impacting workflow - desperate for a fix.
Update: Another workaround for those finding this really annoying; commands run by agents don't appear to trigger the flashing cmd window issue (at least for me on win11, Terminal, CC CLI, non-admin account), so if you can delegate a task via agents I recommend doing so.
FYI I was plagued by this issue (it was immensely annoying) and finally today I got it fixed, this did the trick (note I have my git installed via scoop):
Omg, please fix this - its pretty much impossible to use Claude Code in a windows env with this popup.
I may need to try @DamianReeves workaround.
I also suffer from this issue, and it makes Claude Code nearly unusable. I may give up usage of it entirely, or always run it on a 2nd desktop.
I experience this through CMD line Claude, as well Claude through VSCode
I had no luck attempting @DamianReeves 's workaround
This is so annoying. Constantly having terminal windows flashing up when I'm working is a pain. Can we please have a fix for this?
Same issue here. Using Claude Desktop (not CLI) on Windows 11 with working directory on WSL (\\wsl.localhost\Ubuntu\home\...).
Every message triggers a visible /usr/bin/bash --login -i -c cygpath -u \\wsl.localhost\... window for git repo detection. The window flashes briefly and steals focus, making it very disruptive.
Attempted workarounds (none worked):
Setting SHELL to cmd.exe in ~/.claude/settings.json
Setting SHELL to powershell.exe
Removing SHELL env entirely
The windowsHide: true fix on child_process.spawn() would resolve this.
Environment:
Windows 11
Claude Desktop (latest)
Git for Windows installed (C:\Program Files\Git\cmd\git.exe)
Working directory: WSL Ubuntu via \\wsl.localhost\
Also experiencing the same issue here, rendering Claude Code incredibly tedious to use. Using Claude Code CLI (native installer) on Windows 11
Every Bash tool execution spawns a visible Git Bash window (/usr/bin/bash --login -i -c) that flashes open and closed.
The window steals focus mid-typing, making the experience very disruptive.
Attempted workarounds (none worked):
The windowsHide: true fix on child_process.spawn() would resolve this.
Environment:
Regression: not present in 2.1.42, confirmed in 2.1.47
This issue appears to be a regression introduced between v2.1.42 and v2.1.47. On v2.1.42, no CMD window flashing or focus stealing occurs during tool execution. On v2.1.47, every tool call spawns a visible console window that steals keyboard focus.
Timing aligns with the new "session environment" / shell snapshotting mechanism introduced in v2.1.45, which also caused other Windows regressions (#26481, #26610, #26746). The new shell mechanism likely changed how child processes are spawned, dropping the
windowsHideflag or spawning via a different code path that doesn't suppress console windows.Environment:
This issue appears to have been fixed, at least for me (Win 11, CC CLI, v2.1.50 but v2.1.47 also worked) - CC is saying it can see windowsHide: true" in the bash shell spawn and I'm not getting flashing cmd windows on tool usage on my non-admin user account. Can't see anything in the changelog, but great its addressed.
Edit: worth noting I'm still on the original npm version of CC CLI, not the new "native" install approach, in case that makes a difference.
Linking this here: https://github.com/anthropics/claude-code/issues/28138#issuecomment-3959696822
Is this going to get addressed? I am stuck on 2.1.42 which seems to be the last working version before this bug was introduced!
I dug into it and here is what I can tell based on the available info to the public:
Windows: Console window flashing regression introduced in v2.1.45
Since v2.1.45, every tool call, hook execution, and MCP server startup on Windows spawns a visible
cmd.exe/conhost.exewindow that flashes on screen and steals keyboard focus. v2.1.42 is the last version without this behavior.This has been reported independently by many users across 14+ issues over the past two months with no official response. Posting this as a consolidated comment with root cause analysis to hopefully get some traction.
What happens
When Claude Code executes any tool (Bash, Grep, Glob, Read, etc.), runs a hook, or starts an MCP server, a black console window briefly appears and steals keyboard focus. If you're typing in another application, keystrokes get swallowed. If you have hooks running on every prompt or tool call, the flashing is nearly continuous. It makes Claude Code effectively unusable on Windows without pinning to v2.1.42.
Root cause analysis
The regression aligns precisely with the introduction of the session environment / shell snapshotting mechanism in v2.1.45. Here's the evidence:
windowsHide: truetochild_process.spawn()callswindowsHide: truefix from v2.1.27"Session environment not yet supported on Windows"(#26610) confirms the feature shipped without full Windows supportonecmdleak in$SHELLOPTS(#26481) shows the snapshotting mechanism usesbash -o onecmdto capture environment, and this flag leaks into user sessionswindowsHide: trueIS set in 12 places in the binary, but the ConPTY/SEA binary context causesconhost.exeallocation anyway — the new spawn paths introduced by shell snapshotting likely bypass or override these settingsAdditional changes in v2.1.45 that may contribute:
v2.1.47 made things worse with "Fixed hooks silently failing on Windows by using Git Bash instead of cmd.exe" (#25981), which created yet another spawn path. That same version also introduced hook path mangling on Windows (#26746) where backslash separators get stripped.
Related issues
Primary reports:
Duplicate/related reports:
-iflag in cygpath call (closed as dup)Same-root-cause regressions from v2.1.45:
onecmdin SHELLOPTS)Workarounds
| Workaround | Effectiveness |
|------------|--------------|
| Pin to v2.1.42 +
DISABLE_AUTOUPDATER=1| Fully works, but stuck on old version || Custom COMSPEC wrapper (details in #19012) | Fully works, requires compiling a C++ GUI-subsystem exe |
| Set
CLAUDE_CODE_GIT_BASH_PATHtoC:\Program Files\Git\bin\bash.exe| Works for some users || Use WSL instead of native Windows | Works but changes the whole workflow |
| Disable plugin hooks (claude-mem, etc.) | Reduces frequency but doesn't eliminate |
What a fix probably looks like
Based on community investigation, the fix needs to ensure
windowsHide: true(or the Win32CREATE_NO_WINDOWflag) is set on allchild_process.spawn()andchild_process.exec()calls — including the ones introduced by the shell snapshotting mechanism in v2.1.45 and the hook execution path changed in v2.1.47. The MCP SDK also has a bug wherewindowsHideis conditional on"type" in processwhich only returnstruein Electron, so it's effectively alwaysfalsein Node.js (#24708).Environment
<img width="2286" height="1042" alt="cmd-exe-hydra.png — cut off one window, two more shall take its place" src="https://github.com/user-attachments/assets/fa5e4e9b-8c2b-4c9b-b5c8-5e0cfc5fd4aa" />
Tell me you don't use windows to develop claude code without saying you don't use windows!
Just try opening the start menu or typing while this is going on....
Update: Narrowed down the hook-specific flashing on v2.1.59 (npm). Internal tool calls do not flash with hooks disabled — the regression appears to be specifically on the hook execution spawn path where
windowsHide/CREATE_NO_WINDOWwas lost in v2.1.45+.Any hook command that spawns a separate Windows console-subsystem binary (like
uv.exeoruvw.exe) triggers a visibleconhost.exewindow. Commands that run inside the existing bash process (echo,python) do not flash. This is consistent with v2.1.42 working — the hooks calleduv runon both versions, but v2.1.42 suppressed the console allocation.Workaround: use bare
pythoninstead ofuv runin hook commands.Full testing details: #28138 comment.
A fix is available as a Claude Code plugin: powershell-default
Install:
Adds a native Pwsh tool (shows as
Pwsh(...)in the UI). Commands use PowerShell syntax directly. When enabled, Bash tool is blocked. Works on any OS with PowerShell 7+.PR: https://github.com/anthropics/claude-code/pull/35761
Additional data: Procmon analysis reveals burst spawns on session start
Environment: Windows 11 Enterprise 10.0.26200, Claude Code 2.1.78, Claude Desktop
Finding: The problem is not just the 10s polling — it's burst spawns
Using Process Monitor (Sysinternals), I captured all
Process Createevents fromClaude.exe. Two distinct patterns:1. Background polling (always present, minor annoyance)
Claude.exe(PID 29504) runsgit status --porcelainevery 10 seconds. Each spawnsgit.exe→conhost.exe(-ForceV1) →git.exe(mingw64). This is 3 processes × 6/min = ~18 console windows per minute.2. Session/dialog start burst (the real problem — ~20 windows at once)
When a new session or conversation starts, Claude fires a burst of 10-15 processes within ~500ms:
Then seconds later:
And from a child Claude.exe (PID 40412):
5×
python --versionchecks in 260ms!Summary
| Pattern | Frequency | Processes per burst | Visual impact |
|---------|-----------|-------------------|---------------|
|
git statuspolling | Every 10s | 3 (git→conhost→git) | 1 flash || Session start | On new dialog | ~15-20 | ~20 simultaneous flashes |
| Plugin checks | On session start | 5-7 | 5-7 flashes |
| Python version probe | On session start | 5 | 5 flashes |
Important: disabling all hooks does NOT fix this
I disabled all project hooks (SessionStart, PreToolUse, PostToolUse) and all plugin hooks (hookify, context-mode, security-guidance). The flashing persists — it's caused by Claude Code's own internal subprocess spawns, not by user hooks.
Suggested priorities
spawn()/execFile()calls for git, gh, python, and claude.exe subprocesses needwindowsHide: true(orCREATE_NO_WINDOW)python --versionprobe running 5 times is likely a bug — should be cached after first checkStill experiencing this on v2.1.87 (Windows 11, Git Bash shell).
Impact: Every hook execution (PreToolUse, PostToolUse, Stop, SessionStart) spawns
node.exeviachild_processwithoutwindowsHide: true, causing a visible terminal flash. MCP stdio servers usingnpxalso flash at session start.What we've done to mitigate (but can't fully fix):
Readfrom PreToolUse matcher (~50% fewer hook invocations)What's still flashing: Every remaining hook spawn (2 per Edit/Write/Bash, 1 per Stop, 1 per SessionStart) and MCP stdio server connections at boot.
The fix we need:
windowsHide: trueon allchild_process.spawn()calls for hooks and MCP stdio servers on Windows. This is a one-line fix per spawn call.Reproducing this on Windows 11 Pro (10.0.26200) with Claude Code in VS Code. Git Bash windows flash on every tool call (Bash, Grep, Glob, etc.). Using the VS Code extension, not standalone CLI. Very disruptive during normal use.
This is extremely frustrating, makes using claude so much more time consuming. More often than not the console windows close themselves, but if you have a custom statusline configured this one will stay open usually, and sometimes seems to prevent commands from finishing.
Hey want to crash my laptop? Why don't you introduce a bug that creates 150+ terminal windows? Great.
Is Anthropic going to fix it? No.
Can I use a non-claude application? No because the twerps running this gong show are worried about overuse.
They're going to keep vibe coding their lil dumb application. I hope this bubble pops.
This ended up being a issue with using git-bash.exe being used for SHELL, changed in
~/.claude/settings.jsonand now no issueSeeing a more severe variant of this on Claude Code 2.1.68 / Windows 11
Enterprise 10.0.26200 with Git for Windows bash (
$SHELL=/bin/bash.exe).The Git Bash (MINGW64) window does not just flash — it opens and
stays open with an empty interactive prompt, and Claude Code is blocked
from continuing until I manually close the window. It happens intermittently
during normal Bash tool calls; no specific command reliably triggers it.
No user-configured hooks in
settings.json. Confirmed these do not fix it:git config --global core.pager catgit config --global credential.helper managerHypothesis: on Windows the Bash tool is occasionally spawning
git-bash.exe/mintty.exewith a visible console attached instead ofhidden. Spawning child processes with
CREATE_NO_WINDOW(or equivalentdetached mode) should prevent any visible terminal from ever surfacing.
If I understand correctly, we have to wait until somebody from Anthropic vibe coding team started to use windows
Still seeing the flash after setting
SHELLandCLAUDE_CODE_GIT_BASH_PATHin~/.claude/settings.json. Running Git Bash (mintty) on Windows 11, Claude Code v2.1.x.Architectural framing + open-source workaround (5-month flash-source cascade analysis)
Confirming this is still active on 2.1.145 (Windows 11 26200). I've spent ~3 months reverse-engineering the spawn topology and shipping a complete workaround stack. Sharing the architecture in case it helps prioritize the upstream fix.
Root cause is broader than
windowsHide:trueThe hook dispatch pipeline wraps EVERY hook command in
bash -c "..."even when the target IS an.exe. Example from settings.json:This gets executed as
bash.exe -c "$HOME/.claude/hooks/bin/my-hook.exe --arg"→bash.exeis CUI subsystem →conhost.exeflash, even ifmy-hook.exeis itself GUI subsystem. The bash wrapper is the visible window source for hook commands, NOT the hook executable.Proposed fix (architectural, not
windowsHide:flag tweak):When the hook command's argv[0] resolves to an
.exedirectly (no shell metachars in argv), invoke it viachild_process.spawn(<exe>, [<args>], { windowsHide: true, ... })directly, bypassing the bash wrapper. This eliminates the bash.exe → conhost.exe flash entirely for native-binary hooks.For Bash tool calls themselves (genuine shell scripts),
windowsHide:trueon the bash spawn AND on all child spawns (taskkill cleanup, ps inspection) would address the residual flashes — see related closed dups #43844, #59040, and #19012.Open-source workaround stack we deployed
Working solution shipping CUI-flash from ~155/min to ~33/min:
bash.exetrampoline — wrapsbash.exeinvocations. Detects single-token shell-metachar-free commands and bypasses bash entirely viaexec.Command(target_exe, args...). Falls back to ConPTY for legitimate shell commands. Critical fix:HOME=""(empty string set by claude.exe in 163/164 invocations observed) requires fallback toUSERPROFILE— otherwise~/<path>tokens don't expand and bypass silently fails.syscall.SysProcAttr{HideWindow: true}on theexec.Command—STARTF_USESHOWWINDOW + SW_HIDEensuresconhost.exeis allocated but never shown. Output flows normally via inherited stdin/stdout/stderr handles.~/.claude/shims/: GUI-subsystem trampolines forgit.exe,cmd.exeetc., prepended to PATH for sub-processes spawned by hook handlers. Catches the cascading flash from sub-tools that internally invoke other CUI binaries.Result on a 6-repo VS Code workspace + active hook dispatch: 0 visible conhost windows observed under sustained Bash tool load + statusline polling.
Cofactors NOT addressed by user-side workarounds
Two
claude.exe(node) internal spawn patterns bypass any user-side trampoline because they invokecmd.exevia absoluteC:\WINDOWS\system32\cmd.exepath:cmd.exe /d /s /c "taskkill /pid <X> /T /F"— 14 flash/min (Bash tool subprocess cleanup)cmd.exe /d /s /c "ps -axo user,pid,stat,command"— 5.6 flash/min (process inspection, UNIX command on cmd.exe = always fails but flash happens first)Combined ~20 flash/min purely from
claude.exeinternal subprocess inspection/cleanup that no user-side shim can intercept. These would benefit from:taskkill: replace with native Win32TerminateJobObject(no cmd.exe)ps -axo: replace withNtQuerySystemInformationor NodeprocessAPIs (no cmd.exe needed; the cmd.exe call ALWAYS fails becausepsis UNIX-only — so the data isn't even being collected)Asks
.exe direct-invokearchitectural change has higher ROI thanwindowsHidebecause it eliminates the wrapper bash process entirely (lower latency too: ~10ms/hook saved per skippedbash -cstartup × hooks-per-turn = noticeable on long sessions).New reproduction path: clicking "New Session" in Claude Desktop triggers a ~50-spawn cascade with ~30 visible conhosts
Adding evidence for a different trigger than the statusline/hook scenarios already documented: the "New Session" button itself.
Repro
What's happening (process snipe, 60ms WMI polling)
Captured the full cascade from a single click. ~50 subprocesses spawn, parent = Claude Desktop main (Electron) process. Timeline of key events after click:
| Δt from click | Subprocess | conhost |
|---|---|---|
| t+0s |
git fetch --prune origin| VISIBLE || t+0s |
git credential-manager get+store| inherited || t+5s |
git index-pack --stdin --fix-thin| inherited || t+16s |
git maintenance run --auto(auto-triggered by fetch) | inherited || t+17–27s |
git repack -d -l --geometric=2 --write-midx,git pack-objects,git multi-pack-index write— multi-second console ops | inherited || t+18s |
gh pr view <branch>,gh pr checks <num>,gh pr view <num>(PR context lookup) | VISIBLE ×3 || t+30s |
git update-ref refs/heads/main(fast-forward local main) | VISIBLE || t+32s |
git worktree add --no-checkout -b claude/<auto-name> <user-path>\.claude\worktrees\<auto-name>| VISIBLE || t+32s |
git checkout HEAD -- . :(exclude).claude,git config extensions.worktreeConfig true| VISIBLE ×2 || t+36s | Same
gh pr view <branch>as t+18s (redundant query) | VISIBLE || t+40s | New
claude.exe(claude-code child) spawns for the session | VISIBLE || t+41s | Session init:
git --no-optional-locks status --short,log --oneline -n 5,config user.name,config user.email| VISIBLE ×4 || t+41s |
cmd.exe /d /s /c "git config --get user.email"(raw cmd.exe wrapper) | VISIBLE || t+41s |
cmd.exe /d /s /c "tasklist \| findstr /I \"Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe ...\""— IDE detection | VISIBLE || t+41s |
powershell.exe -NoProfile -Command "(Get-CimInstance Win32_Process -Filter ...).CreationDate.Ticks"| VISIBLE |Smoking gun: the spawn code knows how to do
--headless, just doesn't use it consistentlyOver the same 90-second window, the SAME parent (Claude Desktop main process) spawned ~30 subprocesses with auto-allocated console (no
--headlessflag — Windows wroteconhost.exe 0x4) and exactly 1 with properconhost.exe --headless --width 80 --height 24 --signal 0xNNNN --server 0xNNNN.So the bug isn't "Electron can't hide console windows on Windows" — it's that the spawn path for git/gh/cmd/powershell tool subprocesses is missing
windowsHide: true(orCREATE_NO_WINDOW), while the spawn path for some Electron-internal utility processes correctly sets it.Compounding factors observed in the same investigation
git maintenance run --autois the worst offender —git repack+git pack-objectsare seconds-long console processes. A typical click-spawn flash lasts ~50ms; these last seconds.gh pr view <branch>runs twice during a single new-session init (visible at t+18s and t+36s in the table). Halving these would halve the gh-related flashes.bash.exeprocesses (one alive 13 hours) that survived the originating claude-code session's death — generating ~8 gh.exe spawns/sec via a model-generateduntil ... do true; donebusy-wait loop. Each spawn flashed because of this issue (#14828). Without the visible-conhost bug, the orphan loop would silently waste CPU; with it, the loop becomes a focus-stealing keystroke killer.Environment
1.9255.2.0(Microsoft Store install)2.1.149Independent confirmation on Claude Code 2.1.142 / Windows 11 (build 26200).
@JustinCMR's diagnosis matches what I see — the tool-subprocess spawn path is missing
windowsHide: true/CREATE_NO_WINDOW, and the windowless path already exists in the codebase: a live process snapshot showsconhost.exe --headless --width 80 --height 24 --server 0x...being used for some child processes but not the shell/tool ones. So this is a one-flag inconsistency, not a platform limitation.One spawn path I haven't seen called out yet: MCP stdio servers. Each configured MCP server is launched as a child
node.exe/python.exeat session start/restore, and those spawns also lackwindowsHide— so they flash too. For anyone running several MCP servers, that's an extra burst of windows on every session start, on top of the per-tool-call flashes. Whatever fixes the tool-subprocess path should cover the MCP stdio launch path as well (samechild_process.spawnoptions).Mitigation for the portion that's user-owned (not the harness): if some of your flashes come from your own Windows automations (scheduled tasks, file watchers, helper scripts) rather than Claude Code itself, that part is fixable today:
-WindowStyle Hiddento apowershell.exeaction, or switch a consolepython.exeaction topythonw.exe.wscriptVBS shim —CreateObject("WScript.Shell").Run cmd, 0, False— which gives zero flash (window style 0), stronger than-WindowStyle Hidden(which can still flash briefly).I verified this silences recurring scheduled automations completely. It does not touch the Claude Code tool/MCP flashes (those still need the
windowsHidefix above), but it removed a meaningful chunk of the noise in my case.+1 for prioritizing the one-flag fix — this is a daily, focus-stealing problem on Windows.
Same root cause, confirming with an independent diagnostic method — also affects Windows PowerShell tool calls, not just Bash. Full write-up and a feature suggestion posted on #58606 (which has the closest match in scope), copying the key part here since this issue is older:
Environment: Windows 11 Home, build 10.0.26200,
anthropic.claude-codev2.1.181-win32-x64, Git Bash + Windows PowerShell 5.1.I confirmed the
bash.exe/powershell.exe→conhost.exe(noCREATE_NO_WINDOW) pattern via Windows native Process Creation auditing (Event ID 4688 in the Security log) while debugging an unrelated, separate console-flash issue on the same machine. That gave a reliable way to attribute flashes specifically to Claude Code's tool execution versus anything else running on the box.Suggestion: rather than only hiding the window, consider exposing it as a setting (
hidden/visible/visible-signedwith a distinguishing title) — some users may want the visibility as a "Claude is working" signal rather than have it fully suppressed. Details on #58606.This very annoying
claude code made an "visible-signed with a distinguishing title windows" for my powershell process -
so now there is no more flash on my computer - its very comfortable one ..
Can confirm - traced this with Windows Process Creation auditing (Event ID 4688): every Bash/PowerShell tool call from Claude Code spawns bash.exe/powershell.exe -> conhost.exe without CREATE_NO_WINDOW. Seems to be the extension host launching child processes without the no-window flag, not something fixable from the user side (settings.json hooks etc. don't touch this path). Hoping for an exposed window-style option on the tool execution side.
For anyone else dealing with console flashes from their own elevated PowerShell calls (separate from the tool-execution flash above) - a small trick that helped distinguish "my own elevated action" from "something else is flashing":
The problem
Start-Process ... -Verb RunAsopens a real console window for the elevated command. By default it opens and closes very fast (a flash) and gives no clue about who launched it.The fix: title + visible banner + wait
$host.UI.RawUI.WindowTitle = '...'renames the title bar - visible on Alt+Tab / taskbarWrite-Host '=== ... ===' -ForegroundColor Cyanprints a colored banner right when the console opens, readable even on a quick screenshot-Waitkeeps the window open for the whole duration of the action instead of a few-millisecond round tripResult: a flash with a UAC prompt + a clearly signed window is unambiguous (a deliberate elevated action), versus a flash without UAC and without a signature, which is worth investigating as coming from something else entirely (in my case, two unrelated background services that never trigger UAC turned out to be the real source of separate, unexplained flashes).
Still reproduces on v2.1.195 (Windows 11, Git Bash backend, VS Code integrated terminal).
Confirmed via process monitor — the flash is
claude.exespawning the hook/statusLine subprocess without a hidden-window flag, so Windows allocates aconhost.exeper spawn. Representative chain:Two distinct triggers on this build:
bash → jq → bunxre-spawned on every render (continuous flicker even at idle). Same as the older #51867.type:commandhook is wrapped in an un-hiddenbash -c, firing on every PreToolUse/PostToolUse/UserPromptSubmit. Plugin hooks that usebash/python3(e.g. PostToolUse-on-every-tool-call) flash on each tool use.windowsHide: truein hook config andCREATE_NO_WINDOWin the env block are both ignored — the flash isclaude.exe's own outer wrapper, before the hook command runs, so neither has any effect (matches #27115).Mitigations that actually reduce it (not eliminate): disabling hook-heavy plugins and clearing the custom statusLine. Only WSL gets it to zero. A
CREATE_NO_WINDOW/STARTF_USESHOWWINDOW+SW_HIDEflag on the internal spawn is the real fix.Install RTK (https://github.com/rtk-ai/rtk) has solved this annoying shit!! At least for Bash tool, Search still flash that cmd window
Same issue here, and it makes Claude Code very hard to use for non-stop daily work on Windows 11 (v2.1.197, PowerShell host).
Extra detail from monitoring process creation events (Win32_Process __InstanceCreationEvent) that may help pinpoint it. Visible conhost/console windows flash on EVERY turn from Claude Code's own internal spawns, not just user tool calls:
git.exe --no-optional-locks status --shortandgit log --oneline -n 5(parent = claude.exe)gh.exe pr view <branch> --json ...(parent = claude.exe)cmd.exe /c tasklist | findstr /I "Code.exe Cursor.exe ..."(IDE detection, parent = claude.exe)bash.exewindow per configured hook (SessionStart / PostToolUse / Stop)Workarounds we applied (consolidating hooks into one orchestrator per event, wrapping MCP servers in a pythonw launcher with STARTUPINFO+SW_HIDE and a kill-on-close Job Object, switching the default terminal from Windows Terminal to Console Host) reduce it a lot, but the internal git/gh/tasklist spawns cannot be hidden from user side at all.
Feature request: spawn internal child processes and hook/MCP commands with CREATE_NO_WINDOW (or a settings.json option like "hideChildConsoles": true) on Windows.
curious if you tried my solution above? https://github.com/anthropics/claude-code/issues/14828#issuecomment-4253966091
Adding a data point + a diagnostic method, in case it helps others triage.
On a Windows box with a lot of automation, I had the same unbearable flashing — dozens of PowerShell/conhost/OCR windows per second stealing focus. When I actually traced what was spawning each window, most of my storm was not Claude Code's tool calls. The two dominant sources were:
LogonType = Interactive("Run only when user is logged on"). Those run in the visible desktop session (session 1), so every console child they spawn — PowerShell, cmd, and especiallytesseract.exe/pdftoppm.exein OCR pipelines (one window per page) — flashes. The task's "Hidden" checkbox and-WindowStyle Hiddenare cosmetic and do not stop this.Diagnostic: attribute each flash to its real source
Run in an elevated PowerShell — this shows console processes in your visible session and their parent, so you can see whether Claude Code, a Scheduled Task (
svchost … Schedule), or some app is the spawner:The fix for the non-Claude sources
The key realization: what decides visibility is the session, not the "Hidden" flag. Interactive logon = session 1 = visible; SYSTEM/ServiceAccount (or "Run whether user is logged on or not") = session 0 = invisible.
Export-ScheduledTaskevery interactive task to XML so it's reversible.``
powershell
``$p = New-ScheduledTaskPrincipal -UserId 'SYSTEM' -LogonType ServiceAccount -RunLevel Highest
Set-ScheduledTask -TaskName 'YOUR_TASK' -Principal $p
S4Ucannot be set for a different user by SYSTEM (Access denied 0x80070005).creationflags=subprocess.CREATE_NO_WINDOWon Windows (common with pytesseract/pdftoppm/ffmpeg).Eliminating those two sources removed the overwhelming majority of my flashing. The remaining Claude-Code tool-spawn flashes are what this issue is about — this isn't a fix for that, just a way to rule out (and kill) the other contributors so you can see how much is actually the tool spawns.
I fully agree. I hope this gets fixed soon because it's really disruptive when trying to work.