cancel-ralph — Claude Code command: stop an active Ralph Loop
Cancels a running Ralph Loop: checks the state file, reads the iteration number and deletes it. Handy when a loop needs to stop.
/plugin install ralph-loop@claude-plugins-officialWhat cancel-ralph does
Three steps, nothing more. The command runs a Bash check for .claude/ralph-loop.local.md. No file means it reports that no active Ralph loop was found. If the file is there, it reads the iteration: field and removes the file with rm, then tells you which iteration the loop had reached.
Its permissions cover exactly three tools: Bash(test -f .claude/ralph-loop.local.md:*), Bash(rm .claude/ralph-loop.local.md) and Read(.claude/ralph-loop.local.md). So cancelling touches one state file and leaves the rest of the project alone.
You get it with the ralph-loop plugin, there is no separate install. Keep the state file at .claude/ralph-loop.local.md — anywhere else and the command will not see it and will report no active loop.
What it helps with
- stop a running Ralph Loop
- find out which iteration a loop stopped at
- clear the state file after cancelling
- check whether a loop is active right now
Example prompts for the agent
- Cancel the Ralph Loop
- Stop the Ralph loop and tell me the iteration it was on
- Check for an active Ralph Loop and cancel it
How to install cancel-ralph
1Plugin marketplace
/plugin install ralph-loop@claude-plugins-official2Manually: put the files in place
.claude/commands/cancel-ralph.mdCall it with /cancel-ralph. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/cancel-ralph.mdCall it with /prompts:cancel-ralph. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/cancel-ralph.prompt.mdManually: put the files in place
.gemini/commands/cancel-ralph.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about cancel-ralph
How do I install cancel-ralph in Claude Code?
It ships with the plugin: run /plugin install ralph-loop@claude-plugins-official, then place the file .claude/commands/cancel-ralph.md.
What does cancel-ralph do?
It looks for .claude/ralph-loop.local.md, reads the iteration number from it and deletes the file, reporting where the loop was cancelled.
What happens when no loop is running?
The command checks .claude/ralph-loop.local.md and answers that no active Ralph loop was found.
Source text
cancel-ralph.md · Apache-2.0
--- description: "Cancel active Ralph Loop" allowed-tools: ["Bash(test -f .claude/ralph-loop.local.md:*)", "Bash(rm .claude/ralph-loop.local.md)", "Read(.claude/ralph-loop.local.md)"] hide-from-slash-command-tool: "true" --- # Cancel Ralph To cancel the Ralph loop: 1. Check if `.claude/ralph-loop.local.md` exists using Bash: `test -f .claude/ralph-loop.local.md && echo "EXISTS" || echo "NOT_FOUND"` 2. **If NOT_FOUND**: Say "No active Ralph loop found." 3. **If EXISTS**: - Read `.claude/ralph-loop.local.md` to get the current iteration number from the `iteration:` field - Remove the file using Bash: `rm .claude/ralph-loop.local.md` - Report: "Cancelled Ralph loop (was at iteration N)" where N is the iteration value
© Anthropic · Apache-2.0 · anthropics/claude-plugins-official