From d001593f4f3cf23579a2d6cc45d7d1a91eb9c627 Mon Sep 17 00:00:00 2001 From: Nicolas BOUTE Date: Thu, 2 Jul 2026 13:49:48 +0200 Subject: [PATCH] fix(hooks): hide console windows for detached spawns on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- plugins/claude-code/scripts/lib/memory.js | 1 + plugins/claude-code/scripts/on-post-tool.js | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/claude-code/scripts/lib/memory.js b/plugins/claude-code/scripts/lib/memory.js index 62fc4e2..69888f9 100644 --- a/plugins/claude-code/scripts/lib/memory.js +++ b/plugins/claude-code/scripts/lib/memory.js @@ -129,6 +129,7 @@ function spawnDetached(binary, args, opts = {}) { cwd, env: env || process.env, detached: true, + windowsHide: true, stdio: "ignore", }); child.unref(); diff --git a/plugins/claude-code/scripts/on-post-tool.js b/plugins/claude-code/scripts/on-post-tool.js index 66011dd..3fd6fc0 100755 --- a/plugins/claude-code/scripts/on-post-tool.js +++ b/plugins/claude-code/scripts/on-post-tool.js @@ -77,6 +77,7 @@ function pickPath(obj) { const worker = path.join(__dirname, "resolver-debounce.js"); const child = spawn(process.execPath, [worker, cwd], { detached: true, + windowsHide: true, stdio: "ignore", env: process.env, });