Marketplace plugin sync strips execute permissions from .sh hook files

Resolved 💬 4 comments Opened Mar 27, 2026 by hysteric-lab Closed Apr 18, 2026

Bug

The marketplace plugin sync mechanism (GCS-based) downloads all files with 644 (rw-r--r--) permissions, stripping the POSIX execute bit from shell scripts. This causes Stop, SessionStart, and other command-type hooks to fail with:

Stop hook error: Failed with non-blocking status code: /bin/sh: .../stop-hook.sh: Permission denied

Reproduction

  1. Install any marketplace plugin that uses shell-based hooks (e.g., ralph-loop, learning-output-style)
  2. Check permissions: find ~/.claude/plugins/marketplaces/claude-plugins-official -name "*.sh" -exec ls -la {} \;
  3. All .sh files show rw-r--r-- (no execute bit)
  4. Any hook configured as "command": "${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh" fails with permission denied

Affected files (current marketplace)

Every .sh file in the marketplace lacks +x:

  • ralph-loop/hooks/stop-hook.sh
  • ralph-loop/scripts/setup-ralph-loop.sh
  • learning-output-style/hooks-handlers/session-start.sh
  • explanatory-output-style/hooks-handlers/session-start.sh
  • plugin-dev/skills/*/scripts/*.sh
  • math-olympiad/skills/*/scripts/*.sh

Expected behavior

After marketplace sync, .sh files in hooks/ and scripts/ directories should have execute permissions (755 or rwxr-xr-x).

Workaround

find ~/.claude/plugins/marketplaces/claude-plugins-official -name "*.sh" -exec chmod +x {} \;

This must be re-run after every marketplace sync.

Suggested fix

After GCS download completes, run chmod +x on all .sh files, or at minimum on files referenced by hooks.json command entries.

Environment

  • macOS (Darwin 24.6.0)
  • Marketplace sync via .gcs-sha tracking

View original on GitHub ↗

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