ralph-wiggum: bash 3.2 runtime error in setup-ralph-loop.sh (empty array + set -u)
Resolved 💬 3 comments Opened Mar 18, 2026 by gio888 Closed Mar 21, 2026
Bug
plugins/ralph-wiggum/scripts/setup-ralph-loop.sh line 113 crashes on macOS (bash 3.2.57) when PROMPT_PARTS is an empty array and set -u is active:
PROMPT="${PROMPT_PARTS[*]}" # unbound variable error under bash 3.2 + set -u
Environment
- macOS (Darwin 25.3.0, arm64)
/bin/bash= GNU bash 3.2.57 (Apple ships this due to GPLv3)- Claude Code 2.1.x
Fix
The official ralph-loop plugin (in claude-plugins-official) already has the fix at the same line:
PROMPT="${PROMPT_PARTS[*]:-}" # bash 3.2 compatible
The :- default parameter expansion prevents the unbound variable error when the array is empty.
Additional context
The ralph-loop plugin also added session isolation (session_id tracking) which ralph-wiggum lacks. These may be worth porting as well.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗