| name | cancel-ralph |
| description | Cancel an active Ralph Loop. Use when the user wants to stop, cancel, or abort a running ralph loop. |
Cancel Ralph
Trigger
The user wants to cancel or stop an active Ralph loop.
Workflow
-
Check if .claude/ralph/scratchpad.md exists.
-
If it does not exist: Tell the user "No active Ralph loop found."
-
If it exists:
- Read
.claude/ralph/scratchpad.md to get the current iteration from the iteration: field.
- Remove the loop state:
rm -rf .claude/ralph
- Report: "Cancelled Ralph loop (was at iteration N)."
Notes
Removing the state file is the only thing that stops the loop — there is no separate sentinel file to clean up. The Stop hook is a no-op whenever .claude/ralph/scratchpad.md is absent.
A loop that paused at Claude Code's 8-continuation-per-turn ceiling is still active: its state file is intact and any next message resumes it. Cancel it here if the user does not want it to resume.
Output
A short confirmation with the iteration count, or a message that no loop was active.