ralph-loop plugin: stop-hook.sh Permission denied — /bin/sh is dash on Ubuntu

Resolved 💬 4 comments Opened Mar 27, 2026 by banifou Closed Apr 30, 2026

Bug Description

The ralph-loop plugin's stop hook fails with "Permission denied" on every session exit:

Ran 1 stop hook
  ${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh
  Stop hook error: Failed with non-blocking status code: /bin/sh: 1:
  .../ralph-loop/hooks/stop-hook.sh: Permission denied

Root Cause

The hook command in hooks.json is:

{ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh" }

Claude Code executes this via /bin/sh, which on Ubuntu is dash (not bash). Dash cannot directly execute the script despite the #!/bin/bash shebang and correct file permissions (-rwxrwxr-x).

Environment

  • OS: Ubuntu 24.04.4 LTS
  • Kernel: 6.17.0-14-generic
  • Shell: GNU bash 5.2.21
  • /bin/sh: symlink to dash (/bin/sh -> dash)
  • Claude Code: 2.1.85
  • Plugin: ralph-loop (installed via /plugin install ralph-loop@claude-plugins-official)

Workaround

Change hooks.json to explicitly invoke bash:

{ "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh" }

Suggested Fix

Update plugins/ralph-loop/hooks/hooks.json to prefix with bash. This affects all Debian/Ubuntu systems where /bin/sh defaults to dash.

View original on GitHub ↗

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