← Registry
Loop Official

Agent Loop (Issues to PRs)

A Ralph-style loop that turns open GitHub issues into pull requests, one task per iteration, until none remain.

Agent Loop is a small Bash recipe by Ben Tossell that drives an autonomous agent over a repo's open GitHub issues. loop.sh runs the agent (Factory's `droid exec -f prompt.md`) for up to N iterations; prompt.md has the agent fetch open issues with `gh issue list`, do the smallest unit of work for one issue, verify before committing, push a feature branch, and open a PR. The loop exits early when the agent emits `<done>COMPLETE</done>` (all issues handled) or `<done>NO_TASKS</done>` (no open issues). It is explicitly inspired by Matt Pocock's Ralph loop and ships a companion Next.js UI viewer (bentossell/ralph-loop-ui) that reads the issues and shows live loop status.

Loop

Goal
Every open GitHub issue in the repo has been resolved by an autonomous agent that opened a pull request for it.
Exit when
`gh issue list --state open` returns no open issues (the agent emits `<done>NO_TASKS</done>` / `<done>COMPLETE</done>`).

Check between iterations

gh issue list --state open
$

Kickoff prompt

Start the "Agent Loop (Issues to PRs)" loop. Goal: Every open GitHub issue in the repo has been resolved by an autonomous agent that opened a pull request for it. Max iterations: 10 Between iterations run: gh issue list --state open Exit when: `gh issue list --state open` returns no open issues (the agent emits `<done>NO_TASKS</done>` / `<done>COMPLETE</done>`). Step 1: Run `gh issue list` to fetch the open issues and pick the highest-priority one to work on this iteration.