docs(hooks): clarify plugin auto-installs hooks; update manual install to use CLI - #1187
Closed
ichoosetoaccept wants to merge 1 commit into
Closed
Conversation
ichoosetoaccept
requested review from
bensig,
igorls and
milla-jovovich
as code owners
April 24, 2026 23:47
ichoosetoaccept
force-pushed
the
docs/fix-hooks-install-instructions
branch
from
May 2, 2026 10:55
9adea4d to
5a41960
Compare
Collaborator
|
Thanks for catching the double-firing — clean fix.✨ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The hooks guide told all users to manually add hooks to
settings.jsonusing absolute bash script paths. This is wrong in two ways:Plugin users don't need to do anything — hooks are registered automatically by the Claude Code plugin runtime (loaded in-memory from
hooks/hooks.jsonat session start). Adding manual entries on top causes both Stop and PreCompact hooks to fire twice per event.Non-plugin users (pip/uv standalone installs) should use
mempalace hook runCLI, not absolute paths to internal bash wrapper scripts.Changes:
mempalace hook run --hook stop --harness claude-codemempalace hook run --hook stop --harness codexmatcherfrom Stop/PreCompact examples (matchers are for tool-name filtering in PreToolUse/PostToolUse, not event-based hooks)Related to #408 — the old manual workaround existed partly because earlier versions used
python3 -m mempalacewhich silently failed on uv installs. With 3.3.3 usingmempalace hook run, plugin-managed hooks work correctly.How to test
Install via Claude Code plugin marketplace, run
/hooks— both Stop and PreCompact appear automatically, sourced from~/.claude/plugins/*/hooks/hooks.json. Nothing insettings.json. Check~/.mempalace/hook_state/hook.logto confirm saves fire.Checklist
python -m pytest tests/ -v)ruff check .)