Skip to content

Stop hook summarize fails with "Unable to connect" error in v9.0.4 #673

Description

@grimnir

Description:

After upgrading to claude-mem v9.0.4, the Stop hook consistently fails with the error:

Hook error: Error: Unable to connect. Is the computer able to access the url?
This error appears after every assistant response, flooding the console output.

Environment:

claude-mem version: 9.0.4
OS: macOS (Darwin 25.2.0)
Claude Code: Latest version
bun: installed and working
Steps to Reproduce:

Install claude-mem v9.0.4
Start a Claude Code session
Send any message and wait for response
Observe "Unable to connect" error on every Stop event
Investigation:

The worker service is running correctly on port 37777:

curl -s http://127.0.0.1:37777/api/health

Returns: {"status":"ok","build":"TEST-008-wrapper-ipc",...}

Manual testing of the summarize hook with valid transcript works:

CLAUDE_PLUGIN_ROOT=/path/to/claude-mem/9.0.4
bun scripts/worker-service.cjs hook claude-code summarize
<<< '{"session_id":"test","transcript_path":"/valid/path/to/transcript.jsonl"}'

Returns: {"continue":true,"suppressOutput":true}

However, when called automatically by Claude Code's Stop event, it fails. The error message "Unable to connect" appears to be misleading - the actual issue seems to be that the hook receives empty or malformed input data (missing transcript_path).

Workaround:

Remove the Stop section from hooks/hooks.json:

"Stop": [
{
"hooks": [
...
]
}
]
Expected Behavior:
The summarize hook should either:

Work correctly with the data provided by Claude Code
Fail gracefully without flooding the console with errors
Additional Context:

Previous version (8.5.3) used a separate summary-hook.js script
Version 9.0.x integrated this into worker-service.cjs
Other hooks (context, observation, session-init) work correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions