Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions plugins/ralph-wiggum/commands/cancel-ralph.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
---
description: "Cancel active Ralph Wiggum loop"
allowed-tools: ["Bash"]
allowed-tools: ["Bash(${CLAUDE_PLUGIN_ROOT}/scripts/cancel-ralph-loop.sh)"]
hide-from-slash-command-tool: "true"
---

# Cancel Ralph
# Cancel Ralph Loop

Execute the cancel script to stop the Ralph loop:

```!
if [[ -f .claude/ralph-loop.local.md ]]; then
ITERATION=$(grep '^iteration:' .claude/ralph-loop.local.md | sed 's/iteration: *//')
echo "FOUND_LOOP=true"
echo "ITERATION=$ITERATION"
else
echo "FOUND_LOOP=false"
fi
"${CLAUDE_PLUGIN_ROOT}/scripts/cancel-ralph-loop.sh"
```

Check the output above:

1. **If FOUND_LOOP=false**:
- Say "No active Ralph loop found."

2. **If FOUND_LOOP=true**:
- Use Bash: `rm .claude/ralph-loop.local.md`
- Report: "Cancelled Ralph loop (was at iteration N)" where N is the ITERATION value from above.
The Ralph loop has been cancelled. You can now exit normally or start a new loop.
18 changes: 18 additions & 0 deletions plugins/ralph-wiggum/scripts/cancel-ralph-loop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Cancel Ralph Wiggum Loop Script
# Removes the ralph-loop state file to stop the loop

RALPH_STATE_FILE=".claude/ralph-loop.local.md"

if [[ -f "$RALPH_STATE_FILE" ]]; then
# Extract iteration count before deleting
ITERATION=$(grep '^iteration:' "$RALPH_STATE_FILE" | sed 's/iteration: *//')

# Remove the state file
rm "$RALPH_STATE_FILE"

echo "✅ Ralph loop cancelled (was at iteration $ITERATION)"
else
echo "ℹ️ No active Ralph loop found."
fi