Skip to content

fix: restore executable bit on suggest.sh Stop hook - #122

Open
skpalan wants to merge 1 commit into
ramarivera:mainfrom
skpalan:fix/suggest-hook-executable
Open

fix: restore executable bit on suggest.sh Stop hook#122
skpalan wants to merge 1 commit into
ramarivera:mainfrom
skpalan:fix/suggest-hook-executable

Conversation

@skpalan

@skpalan skpalan commented May 30, 2026

Copy link
Copy Markdown

Problem

hooks/suggest.sh was committed without the execute bit (mode 100644) in 53bf15a (the v0.5.x suggestions feature). Claude Code invokes Stop hooks as direct commands, so the missing +x causes the hook to fail immediately:

permission denied: hooks/suggest.sh   # exit 126

This surfaces a "Stop hook error occurred" banner after every turn for anyone who installs/upgrades to v0.5.x. Every other hook script (react.sh, buddy-comment.sh, name-react.sh, mood-react.sh, file-type-react.sh) ships as 100755; suggest.sh is the lone exception.

Repro

printf '{"last_assistant_message":"hi"}' | hooks/suggest.sh; echo $?   # 126, permission denied

Fix

Restore mode 100755 to match the sibling hook scripts. No content change.

printf '{"last_assistant_message":"hi"}' | hooks/suggest.sh; echo $?   # 0

Suggestion (follow-up)

To prevent regressions if the bit is lost again, cli/install.ts could chmod +x the hook scripts during installation.

suggest.sh shipped with mode 100644 (no execute bit) in 53bf15a. Claude
Code invokes Stop hooks as direct commands, so the missing +x makes the
hook fail with "permission denied" (exit 126) and surfaces a "Stop hook
error occurred" banner after every turn.

Restore mode 100755 to match the other hook scripts (react.sh,
buddy-comment.sh, name-react.sh, etc.).
@ramarivera

Copy link
Copy Markdown
Owner

Hey @skpalan — thanks for this fix! The only thing blocking it from getting CI + review is the DCO check: the commit(s) are missing a Signed-off-by line.

Quick fix from your branch:

git commit --amend -s --no-edit   # single commit
# or, for multiple commits:
git rebase --signoff origin/main
git push --force-with-lease

Once DCO goes green we can run CI and get this reviewed — it's a small, wanted change.

🤖 Created with the help of AI (Claude Fable 5).

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.

2 participants