Environment
- OS: Windows 11
- Claude Code: VS Code Extension
- claude-mem: v13.5.0
Problem
Every hook execution causes a black console window to briefly flash on screen.
The window appears and disappears instantly, but is very disruptive during
active use since hooks fire constantly throughout a session.
Root Cause (Confirmed via Testing)
All hooks use "shell": "bash". On Windows, spawning a bash process from a
GUI application (VS Code) causes the OS to momentarily display a console window.
This is standard Windows behavior — it requires CREATE_NO_WINDOW to suppress.
Reproduction Steps
- Install claude-mem on Windows 11 with VS Code extension
- Open any project and ask Claude any question that involves file reads
- Observe repeated black console window flashes throughout processing
Impact by Hook (Confirmed)
| Hook |
Matcher |
Frequency |
Impact |
| PostToolUse |
* |
Every single tool call |
Primary cause — most disruptive |
| PreToolUse |
Read |
Every file read |
Secondary cause |
| UserPromptSubmit |
— |
Once per prompt |
Minor |
| SessionStart |
— |
Once per session |
Minor |
Disabling PostToolUse(*) alone caused a dramatic reduction in flashes.
Disabling PreToolUse(Read) alone had minimal visible effect.
Suggested Fix
On Windows, suppress console window creation when spawning bash processes.
Option A — Use CREATE_NO_WINDOW process flag in the Node.js hook runner:
// In bun-runner.js / worker-service.cjs
spawn(cmd, { windowsHide: true }) // Node.js child_process option
Option B — Detect platform and use PowerShell with hidden window:
{
"shell": "powershell",
"command": "Start-Process bash -ArgumentList '-c','<cmd>' -WindowStyle Hidden -Wait"
}
Option C — Use the args exec form (no shell spawn = no window):
{
"command": "node",
"args": ["path/to/bun-runner.js", "path/to/worker-service.cjs", "hook", "claude-code", "observation"]
}
Environment
Problem
Every hook execution causes a black console window to briefly flash on screen.
The window appears and disappears instantly, but is very disruptive during
active use since hooks fire constantly throughout a session.
Root Cause (Confirmed via Testing)
All hooks use
"shell": "bash". On Windows, spawning a bash process from aGUI application (VS Code) causes the OS to momentarily display a console window.
This is standard Windows behavior — it requires
CREATE_NO_WINDOWto suppress.Reproduction Steps
Impact by Hook (Confirmed)
*ReadDisabling PostToolUse(
*) alone caused a dramatic reduction in flashes.Disabling PreToolUse(Read) alone had minimal visible effect.
Suggested Fix
On Windows, suppress console window creation when spawning bash processes.
Option A — Use
CREATE_NO_WINDOWprocess flag in the Node.js hook runner:Option B — Detect platform and use PowerShell with hidden window:
Option C — Use the args exec form (no shell spawn = no window):