Skip to content

fix(hooks): hide console windows for detached spawns on Windows#1

Open
nboute wants to merge 1 commit into
fmflurry:mainfrom
nboute:fix/windows-hide-detached-spawns
Open

fix(hooks): hide console windows for detached spawns on Windows#1
nboute wants to merge 1 commit into
fmflurry:mainfrom
nboute:fix/windows-hide-detached-spawns

Conversation

@nboute

@nboute nboute commented Jul 2, 2026

Copy link
Copy Markdown

Problem

On Windows, every Write/Edit fires the PostToolUse hook, which spawns the reingest and cross-file resolver workers as detached child processes. Node's spawn(..., { detached: true }) opens a new console window for each child unless windowsHide: true is set. A burst of edits therefore produces a stream of flashing/persistent cmd windows.

Fix

Add windowsHide: true to the two detached spawns:

  • plugins/claude-code/scripts/lib/memory.jsspawnDetached() (reingest / resolve)
  • plugins/claude-code/scripts/on-post-tool.js — the resolver-debounce.js worker

windowsHide is a no-op on macOS/Linux, so there is no behavior change off Windows. Verified locally: after the change, editing files no longer opens console windows, and code-memory reingest still runs correctly (symbols + imports written to FalkorDB/Qdrant).

🤖 Generated with Claude Code

On Windows, spawning a detached child process (`detached: true`) without
`windowsHide: true` opens a new console window each time. The PostToolUse
hook fires on every Write/Edit and spawns the reingest + resolver workers
detached, so a burst of edits produced a stream of flashing/persistent cmd
windows.

Add `windowsHide: true` to the detached spawns in:
  - scripts/lib/memory.js (spawnDetached — reingest/resolve)
  - scripts/on-post-tool.js (resolver-debounce worker)

No behavior change on macOS/Linux; the flag is Windows-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants