You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using claude-mem's PostToolUse hook on Windows, failed MCP server connections cause Windows Terminal to open new tabs that don't automatically close. Over time, this results in dozens or hundreds of accumulated terminal tabs, each showing error messages from failed uvx process executions.
The root cause is a combination of:
uvx spawning new terminal windows/tabs on Windows
Processes exiting with non-zero exit codes due to connection failures
Windows Terminal's default closeOnExit: "graceful" behavior keeping failed tabs open
Steps to Reproduce
Install claude-mem on Windows with Windows Terminal as the default terminal
Configure claude-mem with MCP server settings (or have misconfigured/unreachable MCP server)
Use Claude Code and execute any tool that triggers PostToolUse hook
Observe that each tool execution opens a new Windows Terminal tab
Notice that tabs showing errors remain open and accumulate over time
Error Messages Observed
Hook Execution Failure:
Plugin hook bun worker-service.cjs start failed to start: The operation was aborted
Health Check Failures:
Worker failed to start (health check timeout)
Failed to start server. Is port 37777 in use?
Windows Compatibility Issue:
'wmic' is not recognized as an internal or external command
Root cause: WMIC deprecated/removed in Windows 11
Affects: ProcessManager.ts lines 91-92, 174
Consequential Errors:
Database not initialized
Process Leak Evidence
121 orphaned claude CLI processes accumulated over 6 hours
Total memory consumption: ~44GB RSS
Each process: ~372MB average
All child processes remain running after task completion
Expected Behavior
PostToolUse hook executions should not open visible terminal windows/tabs
OR failed processes should clean up and close terminals automatically
Users should not experience terminal tab proliferation during normal Claude Code usage
Actual Behavior
Each PostToolUse hook execution spawns a new Windows Terminal tab via uvx
When MCP server connection fails or errors occur, tabs remain open with error messages
Consider using Windows-specific process spawning methods that don't create visible windows
Additional Context
The Windows Terminal behavior is technically correct - it keeps tabs open on error to allow users to see error messages. However, this conflicts with claude-mem's hook pattern of frequent background executions, leading to UX degradation.
Bug Description
When using claude-mem's PostToolUse hook on Windows, failed MCP server connections cause Windows Terminal to open new tabs that don't automatically close. Over time, this results in dozens or hundreds of accumulated terminal tabs, each showing error messages from failed uvx process executions.
The root cause is a combination of:
Steps to Reproduce
Error Messages Observed
Hook Execution Failure:
Plugin hook bun worker-service.cjs start failed to start: The operation was aborted
Health Check Failures:
Worker failed to start (health check timeout)
Failed to start server. Is port 37777 in use?
Windows Compatibility Issue:
'wmic' is not recognized as an internal or external command
ProcessManager.tslines 91-92, 174Database not initialized
Process Leak Evidence
claudeCLI processes accumulated over 6 hoursExpected Behavior
Actual Behavior
Environment
Related Issues
This appears related to #213, which discusses Windows process management issues and the migration from uvx to Bun runtime.
Suggested Solutions
Short-term workarounds:
Long-term fixes:
Additional Context
The Windows Terminal behavior is technically correct - it keeps tabs open on error to allow users to see error messages. However, this conflicts with claude-mem's hook pattern of frequent background executions, leading to UX degradation.