gh-review-loop
Your AI reviewer flagged two instances of a bug. There are five.
This fixes all five, runs your tests, and stops after three rounds.

A staged session over a real review. The two findings are Codex's actual comments on PR #129, and the pattern, sweep report, and receipt lines are the shipping scripts' output on them (docs/demo/build_demo.py rebuilds the GIF from those scripts). The fix, the push, and the clean re-review are staged. Reproduce the sweep yourself: python3 evals/replay/replay.py.
A plugin for Claude Code and Codex that clears AI reviewer feedback on your PR without you leaving the terminal. Three things set it apart:
- It sweeps the class, not the instance. When the reviewer flags a pattern at two sites, the loop searches your diff for other sites with the same code shape and fixes the ones it finds in the same cycle, so they don't come back as round two and round three. It reports what matches the flagged lines, which is not always every sibling.
- It won't push red. Save a verification profile once and every push is gated on your repo's own tests and linters.
- It has a brake. Re-review requests are hard-capped (default 3), enforced by the script that posts them, so the loop can't spam your PR.
Works with the AI reviewer your repo already has: Claude Code, Codex, GitHub Copilot and Gemini Code Assist are built in, and CodeRabbit, Qodo, Sourcery and others are configurable. MIT, no server, no account, no vendor plan.
Install
Claude Code — two slash commands:
/plugin marketplace add OrenAshkenazy/gh-review-loop
/plugin install gh-review-loop@gh-review-loop
Codex:
codex plugin marketplace add OrenAshkenazy/gh-review-loop
codex plugin add gh-review-loop@gh-review-loop
Then, from a repo with an open PR that a reviewer bot has commented on (the loop asks which bot the first time, and remembers):
Run the AI reviewer loop
That's the whole interface. Other install paths · Prerequisites
Why this exists
Bot reviewers expand. You fix the two instances of a pattern it flagged, push, and the next review flags three more in files it hadn't reached yet. Round three finds two more. Each round costs you a context switch, and the bot never tells you it's converging.
Three things in this loop attack that directly:
It sweeps the class, not the instance. Findings are clustered by a deterministic pattern signature. When one pattern is flagged at 2+ sites, sweep_siblings.py reduces those lines to tokens, intersects them, and reports every other line in the PR's changed files containing all of the shared tokens — the siblings the reviewer hasn't reached yet. A single multi-line finding can also fingerprint its normalized block and report exact copies as mirror candidates.
Intersecting across sites is the token sweep's safety property: a candidate has to match what the flagged sites have in common, not what any one of them happens to contain. Single-site mirror sweeps require a multi-line range and meaningful identifier-like tokens. The tool reports before anything is edited, refuses a single-line site or a too-generic shape, and never reads a file outside your diff. Swept patterns are tracked across cycles, so if one comes back you see ⚠ RECURRED after sweep instead of silently re-fixing it.
How mirror matching stays precise (and what it deliberately misses)