Bug
The ralph-loop plugin's scripts/setup-ralph-loop.sh crashes on line 113 with:
PROMPT_PARTS[*]: unbound variable
Root Cause
The script uses set -euo pipefail (line 6), which includes set -u (nounset). On line 9, PROMPT_PARTS=() initializes an empty array, but on line 113:
PROMPT="${PROMPT_PARTS[*]}"
In bash, expanding an empty array with set -u triggers unbound variable. This happens both when no arguments are passed AND when all arguments are flags (e.g., --max-iterations 5).
Fix
Change line 113 from:
PROMPT="${PROMPT_PARTS[*]}"
to:
PROMPT="${PROMPT_PARTS[*]:-}"
The :- default operator provides an empty string fallback, allowing the script to reach the proper empty-prompt validation on line 116.
Repro
- Install the
ralph-loop plugin
- Run
/ralph-loop (no arguments)
- Script crashes instead of showing the usage help
Environment
- macOS (bash 3.2 — Apple default)
- Claude Code with official plugins marketplace