When the worker process is killed uncleanly (e.g. mid-session usage limit, system crash, forced shutdown), the PID file at ~/.claude-mem/worker.pid is not cleaned up. On subsequent starts, the plugin checks if the recorded PID is "alive" using Windows process existence — but Windows can and does reuse PIDs for unrelated processes. In my case, PID 8016 was reused by BrLogRx.exe (Brother printer driver).
The plugin sees a live process at that PID, assumes the worker is already running, refuses to spawn a new one, then times out waiting for port 37777 to open. This loops indefinitely, and because the UserPromptSubmit hook is blocked on worker reachability, Claude Code becomes completely unusable — all prompts are blocked.
Steps to reproduce:
- Run Claude Code on Windows with claude-mem installed
- Hit a mid-session interruption that kills the worker without cleanup (usage limit, crash, etc.)
- Reopen Claude Code — hooks will immediately start reporting worker unreachable for N consecutive hooks
- npm run worker:status shows not running, but logs show Worker already running (PID alive), refusing to start duplicate
Expected behaviour: The plugin should validate that the PID belongs to its own worker process (e.g. by checking process name, querying the health endpoint, or storing a session token alongside the PID) before trusting it.
Workaround: Manually delete ~/.claude-mem/worker.pid and run npm run worker:start.
Environment: Windows 11, Node v24.13.1, claude-mem v13.4.0, Bun
When the worker process is killed uncleanly (e.g. mid-session usage limit, system crash, forced shutdown), the PID file at ~/.claude-mem/worker.pid is not cleaned up. On subsequent starts, the plugin checks if the recorded PID is "alive" using Windows process existence — but Windows can and does reuse PIDs for unrelated processes. In my case, PID 8016 was reused by BrLogRx.exe (Brother printer driver).
The plugin sees a live process at that PID, assumes the worker is already running, refuses to spawn a new one, then times out waiting for port 37777 to open. This loops indefinitely, and because the UserPromptSubmit hook is blocked on worker reachability, Claude Code becomes completely unusable — all prompts are blocked.
Steps to reproduce:
Expected behaviour: The plugin should validate that the PID belongs to its own worker process (e.g. by checking process name, querying the health endpoint, or storing a session token alongside the PID) before trusting it.
Workaround: Manually delete ~/.claude-mem/worker.pid and run npm run worker:start.
Environment: Windows 11, Node v24.13.1, claude-mem v13.4.0, Bun