Hook
ralph-loop Stop hook
- Workflow
- Publisher
- Anthropic (opens in a new tab)
- License
- Apache-2.0
A Stop hook script that blocks Claude from exiting and feeds the same prompt back until a completion promise or an iteration cap is reached.
stop-hook.sh reads a state file at .claude/ralph-loop.local.md, and if a loop is active it blocks the stop and re-feeds the prompt. It ends the loop when the max iterations value is reached or when the last assistant message contains the expected promise tag. It only reacts to the session that started the loop.
The script relies on jq and perl. The README says the default iteration limit is unlimited and recommends always passing --max-iterations, since a loop on an impossible task will otherwise keep spending tokens.
What the badge means
Source verified means the source URL for this entry responded with HTTP 200 on . That is the whole claim. Nobody has read, scanned or run this code on your behalf, and the badge does not mean Anthropic or anyone else endorses it.
Sources change after the check date. Read the code and the publisher page before you install. How to check an extension