Skip to content

fix: correct hook paths from .claude/hooks to bin/hooks#7

Merged
itz4blitz merged 1 commit intoitz4blitz:mainfrom
LarsenClose:fix/hook-path-inconsistency
Jan 28, 2026
Merged

fix: correct hook paths from .claude/hooks to bin/hooks#7
itz4blitz merged 1 commit intoitz4blitz:mainfrom
LarsenClose:fix/hook-path-inconsistency

Conversation

@LarsenClose
Copy link

Problem

The session-start and post-action-suggestions hooks in lib/presets.js are configured with incorrect paths (.claude/hooks/) while all other hooks correctly use bin/hooks/.

This causes MODULE_NOT_FOUND errors on SessionStart:

SessionStart:startup hook error: Failed with non-blocking status code: 
Error: Cannot find module '/path/to/project/.claude/hooks/session-start.js'
    code: 'MODULE_NOT_FOUND'

Root Cause

In lib/presets.js, two hooks had inconsistent paths:

// Before (incorrect)
command: 'node .claude/hooks/session-start.js'
command: 'node .claude/hooks/post-action-suggestions.js'

// After (correct - matches all other hooks)
command: 'node bin/hooks/session-start.js'
command: 'node bin/hooks/post-action-suggestions.js'

Fix

Updated both hook paths to use bin/hooks/ which is where initProject() actually installs them.

Testing

All 636 tests pass.

The session-start and post-action-suggestions hooks were configured with
incorrect paths (.claude/hooks/) while all other hooks correctly use
bin/hooks/. This causes MODULE_NOT_FOUND errors on SessionStart.

Error seen:
  Cannot find module '/path/to/project/.claude/hooks/session-start.js'

Both hooks are installed to bin/hooks/ by init, so the preset paths
should match.
@itz4blitz
Copy link
Owner

I will test this after the latest v2-beta release which includes MCP. I also corrected some of the hook paths there - once it's passed CI we'll know if these are redundant or still needed. Thanks for the PR.

@itz4blitz itz4blitz merged commit 9f0b687 into itz4blitz:main Jan 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants