Plugin cache doesn't preserve execute permission on hook scripts
Resolved 💬 2 comments Opened Mar 26, 2026 by shunkakinoki Closed Mar 27, 2026
Summary
When Claude Code downloads plugins into the cache (~/.claude/plugins/cache/), hook shell scripts (e.g. stop-hook.sh) are written without the execute permission bit, causing intermittent "Permission denied" errors.
Error
Stop hook error: Failed with non-blocking status code: /bin/sh: line 1:
/home/<user>/.claude/plugins/cache/claude-plugins-official/ralph-loop/unknown/hooks/stop-hook.sh:
Permission denied
Details
- The plugin cache stores multiple versions in hash-named directories (e.g.
b10b583de281/,15268f03d2f5/) plus anunknown/fallback directory. - When a new version is fetched or the
unknown/fallback is populated,.shfiles are written with644(no execute bit) instead of755. - The error is intermittent because sometimes the resolved version already has the permission fixed from a previous manual
chmod +x, and sometimes it falls back tounknown/which was freshly written without+x.
Expected behavior
Hook scripts (.sh files) should be written with execute permission (755) when cached, or chmod +x should be applied after extraction.
Workaround
chmod +x ~/.claude/plugins/cache/claude-plugins-official/*/unknown/hooks/*.sh
Environment
- Platform: Linux (NixOS)
- Shell: fish
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗