fix(hooks/precompact): unblock /compact and auto-compact - #1399
fix(hooks/precompact): unblock /compact and auto-compact#1399vasyl-pavlyuchok wants to merge 1 commit into
Conversation
The previous implementation routed through: mempalace hook run --hook precompact --harness claude-code which always returned a block decision, preventing /compact (manual) and auto-compact from running for any user installing this plugin. This patch makes the hook return allow so compaction proceeds normally. Session saving is unaffected since it goes through the Stop hook (separate path). Tested in production environment — both /compact and auto-compact now work correctly while session save behavior remains intact.
|
This wouldn't merge as-is, for reasons that show up clearly against
If |
|
Thanks! The precompact hook on develop already ends with an allow decision (since #863); this change would regress precompact mining. Closing as superseded. |
Problem
The PreCompact hook always ends up returning a
blockdecision, preventing both/compact(manual) and auto-compact from working for any user installing this plugin.The current upstream hook routes through:
Which calls
mempalace hook run --hook precompact --harness claude-code, and that path returnsblock. Net effect: no user can compact while this plugin is active.Fix
Have the hook return
{"decision": "allow"}directly so compaction proceeds.Session saving is NOT affected — it goes through the Stop hook (separate path), which continues to work as designed.
Verification
Tested in production VPS Claude Code environment:
/compact(manual) now works ✓Notes for maintainers
If the original blocking behavior was intentional (e.g. to enforce session save first), please consider an alternative implementation that allows compaction and triggers save — current behavior just blocks all compaction silently, which surprises users.
This patch takes the minimal-impact approach. Happy to iterate on a more nuanced solution if preferred.