Problem
hooks/mempal-precompact-hook.sh (via mempalace hook run --hook precompact) unconditionally returns:
{"decision": "block", "reason": "COMPACTION IMMINENT. Save ALL topics..."}
This means /compact in Claude Code is permanently blocked as long as the plugin is installed. There is no mechanism for the model (or user) to signal "I saved what I needed, please proceed."
Observed in mempalace 3.0.14, Claude Code on macOS.
Reproduction
-
Install mempalace plugin.
-
Run /compact in any Claude Code session.
-
Claude Code reports:
Error: Compaction blocked by PreCompact hook: [bash ${CLAUDE_PLUGIN_ROOT}/hooks/mempal-precompact-hook.sh]: COMPACTION IMMINENT. Save ALL topics, decisions, quotes, code, and important context from this session to your memory system...
-
The model saves drawers via mempalace_add_drawer.
-
/compact is retried — still blocked. The hook never inspects whether any save actually happened.
Impact
- Users cannot compact sessions without manually patching / removing the hook.
- The "save before compact" nudge is still useful, but a hard block that can never be cleared is a footgun — many users will end up disabling the whole plugin.
Suggested fix
One of:
- Stateful check — track timestamp of last
mempalace_add_drawer (or any write) and approve if a save happened since the last /compact / session-start.
- Two-phase hook — first call returns
block with instructions; subsequent call within N seconds returns approve (gives the model one turn to save, then lets compaction through).
- Warn-only mode — return
approve but include the reason text so the model still sees the nudge; document an opt-in MEMPALACE_BLOCK_COMPACT=1 env var for users who want a hard block.
Option 1 matches user expectations best.
Workaround (for now)
Replace hooks/mempal-precompact-hook.sh with:
#!/bin/bash
cat >/dev/null
echo '{"decision":"approve"}'
exit 0
…or delete the PreCompact block from hooks/hooks.json. Both get wiped on plugin update.
Problem
hooks/mempal-precompact-hook.sh(viamempalace hook run --hook precompact) unconditionally returns:{"decision": "block", "reason": "COMPACTION IMMINENT. Save ALL topics..."}This means
/compactin Claude Code is permanently blocked as long as the plugin is installed. There is no mechanism for the model (or user) to signal "I saved what I needed, please proceed."Observed in mempalace 3.0.14, Claude Code on macOS.
Reproduction
Install mempalace plugin.
Run
/compactin any Claude Code session.Claude Code reports:
The model saves drawers via
mempalace_add_drawer./compactis retried — still blocked. The hook never inspects whether any save actually happened.Impact
Suggested fix
One of:
mempalace_add_drawer(or any write) and approve if a save happened since the last/compact/ session-start.blockwith instructions; subsequent call within N seconds returnsapprove(gives the model one turn to save, then lets compaction through).approvebut include the reason text so the model still sees the nudge; document an opt-inMEMPALACE_BLOCK_COMPACT=1env var for users who want a hard block.Option 1 matches user expectations best.
Workaround (for now)
Replace
hooks/mempal-precompact-hook.shwith:…or delete the
PreCompactblock fromhooks/hooks.json. Both get wiped on plugin update.