Loop/ralphCImedium riskintermediatesafety C · 70 · open-ended

Continuous Claude — PR-gated Ralph loop

The Ralph loop for teams: every iteration ships as a pull request that must pass CI before merging, giving each cycle a verifiable checkpoint. Keep branch protection and human PR approval enabled rather than letting it auto-merge to main unattended.

prompt
→ Claude
Run Claude Code in a continuous loop that opens a PR per iteration, waits for CI checks, and merges when green, then starts the next iteration. Cap the run at 25 iterations; leave remaining work for the next session.
claude-code

Implementation note

When to use: running a Ralph-style loop inside a team codebase, where unreviewed commits landing on a shared branch is unacceptable — this variant makes every iteration legible to normal team process. How it works: Claude Code runs in a continuous loop where each iteration opens a pull request, waits for CI checks, merges when green, and then starts the next iteration. The PR-per-iteration structure gives every cycle a verifiable checkpoint: CI is the objective gate, and the PR trail is the audit log of what the loop did and when. Safety: the recommended configuration is to keep branch protection and human PR approval enabled rather than letting the loop auto-merge to main unattended — CI-green means the checks passed, not that the change is wanted. With approval required, the loop becomes a proposal generator; without it, you have effectively granted an agent merge rights to main.

Source: AnandChowdhary/continuous-claude

More ci loops

Re-run PR review on schedule

Loop/schedule

Re-invoke a specific PR review skill every 20 minutes until the review completes or you stop it.

prompt
→ Claude
/loop 20m /review-pr 1234 , to re-run that skill each iteration. {/ min-version: 2.1.196 /}As of v2.1.196, a scheduled fire only runs skills that Claude is [allowed to invoke on its own](/en/skills#control-who-invokes-a-skill). The following reach Claude as plain text instead of executing

Ship specs through code review

Loop/loop

Run spec-driven workflow loop every 10 minutes: plan work, collect reviews, execute tasks, open pull requests.

prompt
→ Claude
/loop 10m /flow-next:pilot # build loop: ready spec → plan → reviews → work → draft PR Cap the run at 15 passes.
cimedium riskclaude-codecodex

Get the build green

Loop/goal

Run the build, fix the first error, and repeat until npm run build exits 0, with a 10-turn cap.

prompt
→ Claude
/goal `npm run build` exits 0 — run the build, fix the first error, repeat until it succeeds; stop after 10 turns