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.
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

Ship a PR through CI and reviews

/loopnew

Draft a PR, run CI, collect reviews, merge, and release—repeat every 30 minutes until land criteria are met.

prompt
→ Claude
/loop 30m /flow-next:land # ship loop: draft PR → CI green → reviews converged → merged → released
cihigh risk

Watch PR checks pass

/loopnew

Poll GitHub PR checks every 5 minutes until all status checks pass.

prompt
→ Claude
/loop 5m gh pr checks 1234
cilow risk

Wait for CI so you don't have to

/loopnew

Poll gh pr checks every 10 minutes and get told when the PR is ready to merge, or a summary of which checks failed and why.

prompt
→ Claude
/loop 10m run `gh pr checks 1234`; if all pass, tell me it's ready to merge; if any fail, summarize which and why
cilow risk