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

Resolved 💬 4 comments Opened Mar 27, 2026 by jamiemunro Closed Apr 18, 2026

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 ↗

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