CI Failure Watcher
FeaturedScheduledContinuous IntegrationUp to 12 rounds
About CI Failure Watcher
This loop checks the most recent CI run on the current branch at a fixed interval. Each round reads the run's result, and if it has not succeeded, the coding agent keeps working, for up to 12 rounds.
Key features
- 01Triggered automatically on an interval
- 02Looks only at the latest run on the current branch
- 03Capped at 12 rounds to avoid endless retries
- 04Supports Cursor and Claude Code
Use cases
- 01Waiting for a branch to turn green after pushing a fix
- 02Confirming the pipeline passes before merging
- 03Watching a slow CI run until it reports a result
- Goal
- The latest CI run on the current branch is green.
- Exit when
- Stop when the latest run's conclusion is success, or when the 12-round limit is reached.
- Between iterations run
- gh run list --branch $(git branch --show-current) --limit 1
Launch prompt
Paste into Cursor / Claude Code. The agent repeats the steps below until the exit condition is met.
prompt.md
Start the "CI Failure Watcher" loop. Goal: The latest CI run on the current branch is green. Max iterations: 12. Step 1: Check CI status — Run gh run list to get the newest run on the current branch and read its status and conclusion. `gh run list --branch $(git branch --show-current) --limit 1` Step 2: Judge the result — If the conclusion is success, end the loop. If it failed, inspect the cause and start on a fix. Step 3: Wait for next round — If the run is still in progress, change nothing and check again after the next interval. Between iterations run: `gh run list --branch $(git branch --show-current) --limit 1` Exit when: Stop when the latest run's conclusion is success, or when the 12-round limit is reached.
Steps
Each round runs in order; if the exit condition isn’t met, another round starts, up to 12.
01
Check CI status
Run gh run list to get the newest run on the current branch and read its status and conclusion.
$
gh run list --branch $(git branch --show-current) --limit 102
Judge the result
If the conclusion is success, end the loop. If it failed, inspect the cause and start on a fix.
03
Wait for next round
If the run is still in progress, change nothing and check again after the next interval.
Not met → next roundExits when met
Supported agents
Coding agents that can run this loop directly.
Cursor
Claude Code
Comments
Markdown supported