Plugin installer strips execute permissions from .sh files

Status Fixed / completed
Reported on v2.1.85
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.

Summary

When Claude Code downloads plugins from GitHub marketplaces, all files lose their git file mode — scripts committed as 100755 (executable) are installed as 100644 (not executable). This causes Permission denied errors for any hook that directly executes a .sh script.

Reproduction

# Check git mode in the repo — correctly 100755:
gh api "repos/anthropics/claude-plugins-official/git/trees/HEAD?recursive=1" \
  | jq '.tree[] | select(.path | contains("stop-hook")) | {path, mode}'
# {"path": "plugins/ralph-loop/hooks/stop-hook.sh", "mode": "100755"}

# Check installed file — stripped to 644:
ls -la ~/.claude/plugins/marketplaces/claude-plugins-official/plugins/ralph-loop/hooks/stop-hook.sh
# -rw-r--r-- ... stop-hook.sh

# Result on Stop hook:
# Stop hook error: Permission denied

Impact

15 .sh files across claude-plugins-official are affected:

  • ralph-loop/hooks/stop-hook.sh — actively breaks Stop hook
  • learning-output-style/hooks-handlers/session-start.sh — breaks SessionStart hook
  • explanatory-output-style/hooks-handlers/session-start.sh — breaks SessionStart hook
  • 12 more in plugin-dev/ and math-olympiad/ skills

Suggested Fix

After downloading/extracting plugin files, restore execute permissions for files that had 100755 mode in the git tree. Alternatively, chmod +x any .sh files in hook directories.

Workaround

Plugin authors can work around this by invoking scripts via bash "$script" instead of executing directly in their hooks.json commands.

Environment

  • Claude Code 2.1.85
  • macOS Darwin 25.3.0 (arm64)

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/39964
  2. https://github.com/anthropics/claude-code/issues/39954
  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

A Notification start hook can auto-fix stripped permissions:

find ~/.claude/hooks ~/.claude/plugins/*/hooks .claude/hooks -name '*.sh' ! -perm /111 -exec chmod +x {} \; 2>/dev/null
exit 0

Add to global ~/.claude/settings.json. Runs on every session start and restores execute permissions.

ashwin-ant collaborator · 6 months ago

This was fixed in v2.1.86 — The plugin installer now preserves execute permissions on .sh files extracted from the plugin archive. 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.