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

  1. Install a plugin that registers a shell script hook (e.g., ralph-loop from claude-plugins-official)
  2. Use Claude Code normally — the stop hook fires on every response
  3. 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 an unknown/ directory used as a fallback when the plugin version can't be resolved.
  • The versioned directories correctly preserve chmod +x on .sh files.
  • The unknown/ directory creates files with -rw-r--r-- (644) instead of -rwxr-xr-x (755).
  • Manually running chmod +x on the file fixes it temporarily, but the unknown/ 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-loop from claude-plugins-official

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗