Bug Description
When the claude-mem worker becomes unreachable during a session, the summarize hook enters an infinite retry loop that never stops. Each retry generates a new "Stop hook feedback" message that triggers another Claude response, which triggers another hook attempt, creating an endless cycle.
Environment
- OS: Windows 11 Home
- Claude Code: v2.1.169
- claude-mem: v13.4.0
- Shell: Bash (via Git for Windows)
Steps to Reproduce
- Start a Claude Code session with claude-mem installed
- The worker becomes unreachable (in this case due to
printf: write error: Permission denied)
- Any tool call triggers the hook, which fails
- On session end/summarize, the hook retries indefinitely
Observed Behavior
The hook script fails with:
/usr/bin/bash: line 1: printf: write error: Permission denied
claude-mem worker unreachable for N consecutive hooks.
Where N increments from 1 to 33+ without stopping. The summarize event hook keeps retrying on every Claude response, creating an infinite feedback loop that makes the session unusable.
Expected Behavior
After N consecutive failures (e.g., 3-5), the hook should stop retrying for the remainder of the session, or at minimum not retry on the summarize event which creates a feedback loop.
Impact
- Wastes API tokens (each retry triggers a Claude response)
- Makes the session difficult to close gracefully
- User must force-quit with Ctrl+C
Suggestion
Add a max retry cap or exponential backoff. If the worker is unreachable after N attempts, disable hooks for the rest of the session and log a single warning instead of retrying indefinitely.
Bug Description
When the claude-mem worker becomes unreachable during a session, the
summarizehook enters an infinite retry loop that never stops. Each retry generates a new "Stop hook feedback" message that triggers another Claude response, which triggers another hook attempt, creating an endless cycle.Environment
Steps to Reproduce
printf: write error: Permission denied)Observed Behavior
The hook script fails with:
Where N increments from 1 to 33+ without stopping. The
summarizeevent hook keeps retrying on every Claude response, creating an infinite feedback loop that makes the session unusable.Expected Behavior
After N consecutive failures (e.g., 3-5), the hook should stop retrying for the remainder of the session, or at minimum not retry on the
summarizeevent which creates a feedback loop.Impact
Suggestion
Add a max retry cap or exponential backoff. If the worker is unreachable after N attempts, disable hooks for the rest of the session and log a single warning instead of retrying indefinitely.