Cancel active Ralph Wiggum loop(s)
Cancel active Ralph Wiggum loop(s) when you need to stop automated task iteration. Lists all running loops and lets you selectively cancel one or multiple, cleaning up their state files.
/plugin marketplace add teknologist/claude-ralph-wiggum-pro/plugin install ralph-wiggum-pro@teknologist-pluginsFirst, list all active Ralph loops:
LOOPS_DIR="$HOME/.claude/ralph-wiggum-pro/loops"
found=0
# Use find to avoid shell glob expansion errors in zsh
while IFS= read -r f; do
[[ -z "$f" ]] && continue
if [[ -f "$f" ]]; then
found=1
SESSION=$(basename "$f" | sed 's/ralph-loop\.\(.*\)\.local\.md/\1/')
DESC=$(grep '^description:' "$f" 2>/dev/null | sed 's/description: *//' | sed 's/^"\(.*\)"$/\1/' || echo "No description")
ITER=$(grep '^iteration:' "$f" 2>/dev/null | sed 's/iteration: *//' || echo "?")
MAX=$(grep '^max_iterations:' "$f" 2>/dev/null | sed 's/max_iterations: *//' || echo "0")
STARTED=$(grep '^started_at:' "$f" 2>/dev/null | sed 's/started_at: *//' | sed 's/^"\(.*\)"$/\1/' || echo "unknown")
PROJECT=$(grep '^project:' "$f" 2>/dev/null | sed 's/project: *//' | sed 's/^"\(.*\)"$/\1/' || echo "unknown")
echo "LOOP_FOUND"
echo "SESSION=$SESSION"
echo "DESC=$DESC"
echo "ITER=$ITER"
echo "MAX=$MAX"
echo "STARTED=$STARTED"
echo "PROJECT=$PROJECT"
echo "FILE=$f"
echo "---"
fi
done < <(find "$LOOPS_DIR" -maxdepth 1 -name 'ralph-loop.*.local.md' 2>/dev/null)
if [[ $found -eq 0 ]]; then
echo "NO_LOOPS_FOUND"
fi
Based on the output above:
Say: "No active Ralph loops found."
{
"question": "Cancel this Ralph loop?",
"header": "Confirm",
"options": [
{"label": "Yes, cancel it", "description": "Stop the loop and delete its state file"},
{"label": "No, keep it running", "description": "Leave the loop active"}
],
"multiSelect": false
}
${CLAUDE_PLUGIN_ROOT}/scripts/log-session.sh "<FILE>" "cancelled" "" --delete${CLAUDE_PLUGIN_ROOT}/scripts/log-session.sh "<FILE>" "cancelled" "" --deleteExample AskUserQuestion format for multiple loops:
{
"question": "Which Ralph loop(s) do you want to cancel?",
"header": "Cancel loops",
"options": [
{"label": "All loops", "description": "Cancel all active Ralph loops"},
{"label": "abc12345: Build REST API...", "description": "Iteration 5 in /Users/dev/my-project"},
{"label": "xyz78901: Fix auth bug...", "description": "Iteration 12 in /Users/dev/other-project"},
{"label": "None - keep all running", "description": "Don't cancel any loops"}
],
"multiSelect": true
}
/cancel-ralphCancel active Ralph Wiggum loop