Plugin hook scripts lose execute permission in 'unknown' cache path

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 4 comments · opened Mar 27, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Description

Plugin hook scripts (shell scripts) lose their execute permission when cached via the unknown version path, causing Permission denied errors at runtime.

Steps to reproduce

  1. Have a plugin with a hook script (e.g., ralph-loop with stop-hook.sh)
  2. Wait for the plugin cache to sync — the unknown version path writes the file without the executable bit
  3. When the marketplace directory syncs from this cache, the hook script is no longer executable
  4. Hook invocation fails with: /bin/sh: .../stop-hook.sh: Permission denied

Evidence

Three cache versions of the same file show the issue:

# Versioned caches — correct (+x)
-rwxr-xr-x  stop-hook.sh   (cache/.../d53f6ca4cdb0/hooks/)
-rwxr-xr-x  stop-hook.sh   (cache/.../b10b583de281/hooks/)

# 'unknown' cache — missing +x
-rw-r--r--  stop-hook.sh   (cache/.../unknown/hooks/)

The marketplace copy inherits the broken permissions from the unknown cache:

-rw-r--r--  .../marketplaces/claude-plugins-official/plugins/ralph-loop/hooks/stop-hook.sh

Workaround

chmod +x ~/.claude/plugins/marketplaces/claude-plugins-official/plugins/ralph-loop/hooks/stop-hook.sh

Recurs on next plugin update that goes through the unknown path.

Expected behavior

The plugin cache should preserve file permissions (specifically the executable bit) when writing to the unknown version path, matching the behavior of the versioned cache paths.

Environment

  • macOS (Darwin 25.3.0)
  • Claude Code (latest as of 2026-03-27)

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/38923
  2. https://github.com/anthropics/claude-code/issues/39544
  3. https://github.com/anthropics/claude-code/issues/39777

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

yurukusa · 6 months ago

Auto-fix with Notification start hook:

find ~/.claude/plugins -name '*.sh' ! -perm /111 -exec chmod +x {} \; 2>/dev/null
exit 0
ashwin-ant collaborator · 6 months ago

This was fixed in v2.1.86 — Plugin hook scripts now retain their execute permission across all plugin cache and extraction paths. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.