ralph-wiggum plugin: Hardcoded /bin/bash shebang fails on NixOS
Description
The ralph-wiggum plugin's stop hook fails on NixOS with the error:
/bin/bash: bad interpreter: No such file or directory
Environment
- OS: NixOS (Linux 6.18.5)
- Claude Code: v2.1.19
- Plugin: ralph-wiggum@claude-code-plugins v1.0.0
Root Cause
The hooks/stop-hook.sh script uses a hardcoded shebang:
#!/bin/bash
On NixOS (and many other modern Linux distributions), bash is not located at /bin/bash. NixOS places all binaries in the Nix store (e.g., /nix/store/...-bash-5.2/bin/bash), and only /bin/sh exists as a compatibility symlink.
Reproduction
- Install NixOS
- Install Claude Code
- Install ralph-wiggum plugin
- Start a ralph loop:
/ralph-loop - Exit Claude Code
- Observe the error in the Stop hook output
Suggested Fix
Change the shebang in hooks/stop-hook.sh from:
#!/bin/bash
To:
#!/usr/bin/env bash
This is the portable solution that works across all Unix-like systems, as it uses the env command (which is always at /usr/bin/env) to locate bash in the user's PATH.
Impact
The plugin's stop hook is completely non-functional on NixOS. The hook fails to execute, preventing the ralph-loop feature from working correctly when exiting sessions.
Additional Note
The same issue may exist in other shell scripts in the codebase. It's worth auditing all *.sh files for hardcoded shebangs like #!/bin/bash, #!/bin/sh, etc.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗