Plugin cache drops execute permission on hook scripts (unknown/ directory)
Resolved 💬 2 comments Opened Mar 26, 2026 by Teo-Asinari Closed Mar 27, 2026
Description
Plugin hook scripts in the unknown/ cache directory are written without the execute bit, causing a "Permission denied" error on every stop hook invocation.
Steps to Reproduce
- Install a plugin that registers a shell script hook (e.g.,
ralph-loopfromclaude-plugins-official) - Use Claude Code normally — the stop hook fires on every response
- Observe the error:
Stop hook error: Failed with non-blocking status code: /bin/sh:
/Users/<user>/.claude/plugins/cache/claude-plugins-official/ralph-loop/unknown/hooks/stop-hook.sh: Permission denied
Details
- The plugin cache directory at
~/.claude/plugins/cache/<org>/<plugin>/contains multiple versioned subdirectories (e.g.,61c0597779bd/,79caa0d824ac/) plus anunknown/directory used as a fallback when the plugin version can't be resolved. - The versioned directories correctly preserve
chmod +xon.shfiles. - The
unknown/directory creates files with-rw-r--r--(644) instead of-rwxr-xr-x(755). - Manually running
chmod +xon the file fixes it temporarily, but theunknown/directory gets regenerated (losing the fix).
Expected Behavior
Hook scripts in the unknown/ cache directory should be written with the execute bit set, matching the behavior of versioned cache directories.
Environment
- macOS (Darwin 25.2.0)
- Claude Code CLI
- Plugin:
ralph-loopfromclaude-plugins-official
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗