Plugin cache loses execute permissions on hook scripts (.sh files become 644 instead of 755)

Resolved 💬 2 comments Opened Mar 26, 2026 by ystyleb Closed Mar 27, 2026

Bug Description

When Claude Code downloads plugins from the official marketplace (claude-plugins-official) to the local cache (~/.claude/plugins/cache/), file execute permissions are not preserved. Shell scripts that are 100755 in the source Git repository become 100644 (non-executable) in the local cache.

This causes SessionStart:startup hook error on every new session for affected plugins.

Affected Plugins

  • explanatory-output-stylehooks-handlers/session-start.sh
  • learning-output-stylehooks-handlers/session-start.sh

Both are official Anthropic plugins from anthropics/claude-plugins-public.

Root Cause

The source repository correctly marks these files as executable:

$ gh api 'repos/anthropics/claude-plugins-public/git/trees/main?recursive=1' \
  --jq '.tree[] | select(.path | contains("explanatory-output-style/hooks-handlers"))'

{"mode":"100755","path":"plugins/explanatory-output-style/hooks-handlers/session-start.sh", ...}

But after download via GCS to ~/.claude/plugins/cache/, the files lose execute permission:

$ ls -la ~/.claude/plugins/cache/claude-plugins-official/explanatory-output-style/unknown/hooks-handlers/
-rw-r--r--  session-start.sh   # Should be -rwxr-xr-x

The hooks.json references these scripts to be executed directly (not via bash):

{
  "command": "${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh"
}

Since the file lacks +x, execution fails with "permission denied", producing the startup hook error.

Steps to Reproduce

  1. Enable explanatory-output-style or learning-output-style plugin
  2. Start a new Claude Code session
  3. Observe two SessionStart:startup hook error messages

Expected Behavior

Plugin cache mechanism should preserve Git file mode bits (specifically 100755 → executable) when downloading/extracting plugin files.

Workaround

chmod +x ~/.claude/plugins/cache/claude-plugins-official/explanatory-output-style/unknown/hooks-handlers/session-start.sh
chmod +x ~/.claude/plugins/cache/claude-plugins-official/learning-output-style/unknown/hooks-handlers/session-start.sh

This fix is lost on every plugin update.

Environment

  • macOS (Darwin 25.4.0)
  • Claude Code latest

View original on GitHub ↗

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