Skip to content

docs: fix HOOKS_TUTORIAL.md paths, matcher, and missing timeout (#1037)#1101

Merged
igorls merged 1 commit intoMemPalace:developfrom
wahajahmed010:fix/hooks-tutorial-1037
Apr 25, 2026
Merged

docs: fix HOOKS_TUTORIAL.md paths, matcher, and missing timeout (#1037)#1101
igorls merged 1 commit intoMemPalace:developfrom
wahajahmed010:fix/hooks-tutorial-1037

Conversation

@wahajahmed010
Copy link
Copy Markdown

Fixes four issues in examples/HOOKS_TUTORIAL.md that cause silent hook failures:

Problems fixed:

  1. Relative paths → Absolute paths (/absolute/path/to/hooks/...)
    Claude Code resolves hooks from working directory at fire time, not repo root.

  2. Wrong matcherStop uses "*", PreCompact has no matcher
    PreCompact hooks don't use matchers (only Stop hooks do per hooks/README.md).

  3. Missing timeout → Added "timeout": 30 to both hooks
    Matches the specification in hooks/README.md.

  4. Ambiguous target → Specified ~/.claude/settings.local.json
    Clarified global vs project-scoped config paths.

Also added:

  • chmod +x instructions for hook scripts
  • Note to replace /absolute/path/to/hooks/ with actual path
  • Proper JSON formatting with newlines

This aligns the tutorial with the correct examples already documented in hooks/README.md.

Fixes #1037

Disclosure: This contribution was generated with AI assistance and reviewed before submission.

Fixes four issues causing silent hook failures:

1. **Relative paths** → Absolute paths (/absolute/path/to/hooks/...)
   Claude Code resolves hooks from working directory, not repo root.

2. **Wrong matcher** → Stop uses *, PreCompact has no matcher
   PreCompact doesn't use matcher (only Stop hooks do).

3. **Missing timeout** → Added timeout: 30 to both hooks
   Matches hooks/README.md specification.

4. **Ambiguous target** → Specified ~/.claude/settings.local.json
   Clarified global vs project-scoped config.

Also added executable chmod instructions and path replacement note.

Fixes MemPalace#1037
@igorls igorls added documentation Improvements or additions to documentation area/hooks Claude Code hook scripts (Stop, PreCompact, SessionStart) labels Apr 24, 2026
@igorls igorls merged commit 9b7536a into MemPalace:develop Apr 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/hooks Claude Code hook scripts (Stop, PreCompact, SessionStart) documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: HOOKS_TUTORIAL.md has relative paths and wrong config keys

2 participants