The post-commit script in the repo root must be installed as a git hook to take effect.
cp post-commit .git/hooks/post-commit
chmod +x .git/hooks/post-commitAfter each commit, the hook checks the commit message. When the message contains the [learn] tag and the commit touches .java files, it triggers the /compound skill to analyze the diff and update .claude/memory/coding-preferences.md with any new coding preferences learned from your edits.
If preferences were updated, the hook amends the current commit to include them.
git commit -m "[learn] refactored search endpoint to match our style"Commits without the [learn] tag are ignored by the hook.