Blog

How Claude Code and Orbi stop agent review loops

The Claude Code team saw a PR loop over 50 times between agents. Orbi breaks it with in-session fixes and a repeat rule. The costs, and 1,963 PRs of data.

On this page · 10 sections
  1. What the Claude Code team changed in its code review
  2. Five lessons, and what Orbi does for each
  3. What one review round means in Orbi
  4. Round counts from 1,963 merged PRs
  5. Stopping when the same failure repeats
  6. PR #4166: a four-round delivery with a red base
  7. Where Orbi goes further than the article
  8. Where the Claude Code team is ahead of Orbi
  9. Make your own agent reviewer converge
  10. Related

The Claude Code team published how it reviews code now that Claude writes about 90% of it (How the Claude Code team does code review, posted by Addy Osmani on X on 26 October 2026 and written in the team's voice). This post is for engineers who run an AI reviewer on agent pull requests and want the review loop to end. I set the team's lessons next to how Orbi, the open-source delivery engine I build, handles the same loop, using 1,963 merged pull requests that Orbi's agent wrote and Orbi's reviewer passed. The prompt rules at the end can be copied as they are.

I'm Larry 🍀 Orbi, the creator of Orbi. Orbi is an open-source engine: you label a GitHub Issue, the Pi coding agent (an open-source coding agent) writes the change, a separate review session checks the pull request, and Orbi merges it when the checks pass. The agent is Pi, not Claude Code, and Orbi Cloud runs DeepSeek by default or your own model key. I have a stake in this comparison. Claims about how Orbi works point to lines in its open-source repository. The production numbers come from Orbi Cloud's delivery receipts, which only I can query; for the two public repositories you can check the PR counts with GitHub search and read every round comment on the PRs' Issues.

What the Claude Code team changed in its code review

The article describes six layers of checks plus rollback: verification before the PR, an AI review on every PR, a security review that can block merge, CI, human approval scaled by risk, and a merge queue with staged rollout. The part that matters most for agent-to-agent review is the section on convergence. The team saw one PR in its CLI project go back and forth between the agent author and the agent reviewer more than fifty times overnight, until someone stopped it by hand. When they ran git blame on what the reviewer kept flagging, about 59% was code that had been there since the first pass: in the team's words, the review system "was rarely finding new bugs", only a few more old ones each cycle.

Their fix: after three cycles the reviewer asks the author to rethink the approach, later cycles review only the new diff, findings name a class of bug so the author fixes all of it, and issues already reported are not reported again. Findings are marked Important, Nit or Pre-existing, and every finding must be fixed or resolved with a reason.

Five lessons, and what Orbi does for each

These are the five points from the article that bear on agent-to-agent review; the merge queue, staged rollout and rollback layers are outside this comparison.

Lesson from the article Orbi Source in orbi-build/orbi
Review the diff with a fresh context The reviewer is a separate session with its own prompt; it never continues the implementer's conversation prompts/prompt_review.md lines 3-5
Show runnable proof, not "done" Passing CI checks on the current head are the test evidence; the reviewer re-runs tests only to reproduce a failure or check its own fix prompts/prompt_review.md lines 221-225, 257-261
Mark pre-existing problems so the author is not blamed The reviewer reports only findings the diff introduces or exposes, each with file:line, a trigger, and a minimal fix prompts/prompt_review.md lines 226-228
Every finding is fixed or closed with a reason The reviewer fixes Blocker and Major findings itself, in the same session, then returns one verdict; Minor findings may stay, listed in that verdict. A failure that already happens on the base is reported, not fixed, unless the Issue widens the scope prompts/prompt_review.md lines 266-274, 330-347
Cap the cycles so review converges Five completed rounds per attempt; the reviewer stops early when it sees the same failure in two consecutive rounds src/orbi/review_rounds.py line 61; prompts/prompt_review.md lines 63-82

Line numbers are for origin/main at commit 01b6ed57. The biggest design difference is the fourth row.

What one review round means in Orbi

In the Claude Code setup a cycle is a round trip: the reviewer comments, the author agent pushes a commit, the reviewer reads again. In Orbi the reviewer is allowed to edit code. When it finds a Blocker or Major problem, it fixes the code on the PR branch, reruns the related tests, pushes, re-checks the diff against the Issue's acceptance items, and only then returns a verdict (prompts/prompt_review.md lines 264-316). If it pushed a fix, the engine waits for CI on the new head and merges without opening another round. A new round starts only when the verdict is findings (a Blocker or Major is still open), when a blocked_on_human_decision stop has been answered and the delivery requeued, or when CI fails at the merge gate, the last check before merge (CI results, whether the PR is behind its base branch, whether the head moved). A PR that is merely behind its base branch is updated by the merge gate and does not count as a round.

So an Orbi round is "review, fix, re-check" inside one session, and the number of fixes made inside it is not recorded anywhere. That makes an Orbi round count and a Claude Code cycle count different units, so read the numbers below as a description of Orbi's loop, not as a head-to-head score.

Round counts from 1,963 merged PRs

Orbi Cloud keeps a delivery receipt for each PR it merges: the PR, the merge commit and the number of review rounds. Queried on 3 December 2026, the receipts hold 2,080 merged PRs from 16 September to 2 December 2026 (UTC). 117 of them have no round count, which leaves 1,963. If all 117 had needed more than one round, the one-round share of all 2,080 would be 87.8%, against 93.1% of the 1,963 with a round count.

PRs 0 rounds 1 round 2 rounds 3-4 rounds
Orbi's own organization (14 repos) 1,789 0 1,663 (93.0%) 101 25
Other Orbi Cloud users (34 repos) 174 1 164 (94.3%) 8 1
Total 1,963 1 1,827 (93.1%) 109 26

The one receipt with a round count of zero is a September PR in another user's repository, and the receipt does not say why it has no round. Five things limit what this table shows:

  • Merged PRs only. A delivery that never merged, because it is still at ai-blocked or its PR was closed, is not here. The cap is five completed rounds: a fifth round can still pass and merge, and the engine will not start a sixth. For the public orbi-build/orbi repository I can give a fuller denominator: PRs opened by Orbi's GitHub app in the window (by creation date) number 461; 454 merged, 6 were closed unmerged and 1 is still open (GitHub search repo:orbi-build/orbi is:pr author:app/orbi-build created:2026-09-16..2026-12-02, checked on 3 December 2026).
  • The count resets after a person steps in. When a maintainer resolves an ai-blocked Issue and puts it back in the queue, the round budget starts again (src/orbi/review_rounds.py, Issue #1779). A PR that used five rounds, got a human decision, and then passed in its next round records one round.
  • The rules changed during the window. The review prompt changed in 19 commits during these eleven weeks; for example, the rule in the four-round story below was added on 28 October. The table mixes several versions of the design.
  • It is mostly my own workload. 91% of the PRs are in my own organization, with Issues I wrote in a structured format and a review prompt tuned on those repositories. The other 174 PRs are spread thin over 34 repositories. In orbi-build/orbi the median merged PR changed 228 lines (additions plus deletions, tests included), and one in ten changed more than 1,357.
  • The reviewer uses the same model by default. Orbi can run the reviewer on a different model from the implementer (review_pi_provider and review_pi_model in src/orbi/config.py); when those are unset it uses the same one. The reviewer is a separate session, not necessarily a separate model.

The more useful number is why a PR got sent back. I read every round comment in the two public repositories, orbi-build/orbi and orbi-build/orbi-website. They have 715 merged PRs with a round count in the window. 26 of those 715 needed more than one round (24 took two and 2 took three), which makes 28 send-backs. Each round comment starts with Orbi review round <N> for PR #<P> (or its Chinese form) on the PR's Issue, so gh api --paginate repos/orbi-build/orbi/issues/<issue>/comments (or the same path under orbi-website) shows them:

  • 20 were CI failures at the merge gate after the reviewer had already returned zero Blocker and zero Major findings.
  • 8 were reviewer findings it did not fix inside its own session (7 Major, 1 Blocker).

In those repositories most extra rounds came from CI, not from two agents trading comments on the same findings. The in-session fix may explain part of that, but these receipts can't separate its effect from that of the structured Issues.

The in-session fix has a cost: nobody reviews the reviewer's own fixes. The reviewer re-checks its work against the review rules before it returns a verdict, but that is the same session checking itself. The backstops are outside it. Any commit it pushes must pass CI. The merge lands only if the PR's head is still the exact commit Orbi last checked: the head the verdict names, or, when the PR was behind, the base-merge commit the gate made on top of it after CI passed on it. That base merge is not re-read by the reviewer. A finding it cannot fix sends the PR to a new round with a fresh session. None of these would catch a fix that passes CI but is wrong in a way the tests don't cover.

Stopping when the same failure repeats

A round cap alone still lets a loop burn its whole budget on one wall. Before doing any review work, Orbi's reviewer reads the round history for the delivery. If it sees the same failure reason in two or more consecutive rounds, it does not try the same fix path again. It returns blocked_on_human_decision with one Major finding that names the repetition and one question with two to four options, each written as an acceptance criterion to append to the Issue (prompts/prompt_review.md lines 63-123). The reviewer makes this call by reading the earlier round comments; the engine does not count repetitions itself.

What happens next depends on the question. If it is about accepting code from outside contributors, money or pricing, or overriding a decision the maintainer wrote down, the Issue waits at ai-blocked for a person. Otherwise, if the reviewer marked one option as recommended, the engine takes that option once by itself: it appends the criterion to the Issue, puts the delivery back in the queue, and posts a comment saying what it chose and that a person can reply with another option. Without a recommended option, it waits for a person.

The Claude Code team's rule asks the author to re-evaluate after three cycles. Orbi also has a count cap, but its early stop is triggered by repetition, so a PR that keeps hitting different, real problems can use its five rounds, and a PR stuck on one problem stops after two to ask for one decision, after which it can carry on.

PR #4166: a four-round delivery with a red base

The longest runs in the data are four rounds. One of them, PR #4166 in the private orbi-cloud repository (a status-page change, merged 2 December 2026), shows the rule that does the most work in our setup, and the auto-answer from the previous section.

Round 1 ended with zero findings, but CI failed. In round 2 the reviewer traced the failure to two tests that had nothing to do with the PR: one had an entitlement expiry hard-coded to 1 December 2026, so it started failing on 2 December; the other asserted a list of failure codes that had just grown on the Orbi engine's own main branch, which this repository's CI checks out. Both failed on the base commit too. Because they kept this PR's checks red, the reviewer reported them as two Major findings, noting they were pre-existing, and would not fix them in this PR, because changing unrelated code to make this PR's checks pass is out of scope. Its fix direction was to clean the base first, in a separate ticket or through the maintainer's base-fix command.

The next review session saw the same red failure in consecutive rounds and stopped instead of trying again. It returned blocked_on_human_decision with a question of the "pick the best option" kind and a recommended answer: fix the two tests as part of this ticket, since both changes were small and mechanical and the base was red for every other PR too. Orbi took that answer by itself. That stop is not a review round: Orbi records it with a requeue comment, so the round count stayed at two. Orbi appended that as a new acceptance criterion to the Issue, naming the two test files and the command that had to exit 0, and posted a comment saying what it chose and inviting a different answer; it did not wait for one. With the criterion in the Issue, those test changes were now in scope. The round-3 reviewer made both changes itself and returned zero findings, but CI was still red. The round-4 session's commits brought branch coverage, which had dropped, back above 97.5% and removed an unused import; CI passed, and the PR merged with seven commits. The automatic choice is not a human recovery, so the round count kept going instead of resetting.

The rule behind the refusal in round 2 dates from 28 October 2026. In Orbi's review prompt, deleting, skipping or weakening an unrelated existing test, or editing unrelated code or CI configuration only to make the delivery's own checks pass, is a Blocker (prompts/prompt_review.md lines 213-220). A test that already fails on the base stays as it is unless the Issue says otherwise. This is Orbi's version of the Pre-existing label: the PR is not blamed for old breakage, and it is not allowed to hide it either. Changing the scope took a written acceptance criterion that anyone reading the Issue can see and the maintainer can overrule.

Where Orbi goes further than the article

  • It doesn't hold PRs up over nitpicks. A verdict passes with zero Blocker and zero Major findings; Minor findings are listed in the verdict, but they never block the merge or cost a round. Findings must come from this diff, each with file:line and a reproducible trigger, and speculative findings are not allowed (prompts/prompt_review.md lines 226-228, 330-331). The article makes the same point from the other side: a nit takes a human a second to dismiss, but an agent author answers it with another commit and another review cycle.
  • The reviewer fixes what it can. In the article, an agent fixes findings overnight and the PR then goes through another review pass. Orbi's reviewer fixes Blocker and Major findings itself before it returns a verdict, so a finding costs a round trip only when the reviewer cannot fix it or the fix is out of scope. In the two public repositories, 20 of the 28 send-backs were CI failures after the reviewer had no Blocker or Major left to report, and the other 8 were findings it did not fix.
  • The loop stops on repetition, and the decision is written down. The PR in the article was stopped by hand after more than fifty cycles, and the fix it describes asks the author to re-evaluate after three. Orbi's reviewer stops as soon as it sees the same failure in two consecutive rounds and returns a question whose options are acceptance criteria. Whichever one is taken is appended to the Issue, where the maintainer can read it and answer differently.
  • Turning checks green the cheap way is a Blocker. Deleting, skipping or weakening an unrelated test to make checks pass is the top severity in Orbi's review prompt. The article describes no rule like this.
  • No approval click on Orbi's own deliveries. The article's goal is at most one person in the loop for most PRs, counting the author, and it lets automated review clear some low-risk changes. Orbi's own deliveries in my repositories merge without an approval click, on CI, the verdict, and the exact commit Orbi last checked. The person who writes the Issue is still in the loop, and the two exceptions in the next section still stop for a person.
  • The reviewer's rules are open. The review prompt, the round cap and the merge gate are in Orbi's public repository, and each round leaves a comment on the Issue.

Where the Claude Code team is ahead of Orbi

Several layers in the article have no counterpart in Orbi today:

  • Orbi has no separate security review. Security issues are one category of Blocker inside the same review (prompts/prompt_review.md line 319), not a second pass that can block on its own.
  • Findings are not filtered by a vote. Orbi runs one reviewer per round. The Claude Code team runs several bug-hunting agents in parallel and keeps a finding only when enough of them vote for it.
  • Human approval does not scale with risk. In my repositories, where no branch rule requires an approval, Orbi's own deliveries merge on its gates without a human approval tier for risky paths. Two cases do stop for a person: a PR from an outside contributor is never merged automatically, even after a clean review (src/orbi/review_merge.py, Issue #842), and if a branch rule requires an approval, Orbi waits instead of approving itself, as I cover in Should AI approve pull requests?.
  • Nothing grades the reviewer against past incidents. The Claude Code team scores its reviewer daily against PRs that caused incidents. I change Orbi's review prompt through ordinary Issues and have no such evaluation set yet.

Make your own agent reviewer converge

If you run an AI reviewer on agent PRs, with Orbi or anything else, these rules carry over. Each one is in Orbi's review prompt today. The in-session fix needs a reviewer that can push to the PR branch; a read-only review bot can still use the rest.

Review the exact diff from <base-sha> to <head-sha>. Do not review a moving HEAD.
Only report findings this diff introduces or exposes. Each finding needs file:line,
a reproducible trigger, actual vs expected, and a minimal fix. No speculative findings.
Blocker = data error, security hole, main path down, irreversible damage.
Major = a functional error in a reasonable scenario, or a broken key contract.
Fix the Blocker and Major findings this diff introduces or exposes yourself,
in this session; rerun the related tests, push, then re-check the diff before
you return a verdict.
Deleting, skipping or weakening an unrelated test to make checks pass is a Blocker.
A failure that also happens on the base is pre-existing: report it, but do not fix it
here unless the Issue's acceptance criteria say so.
Before reviewing, read the previous rounds. If the same failure appears in two
consecutive rounds, stop and ask a human one question instead of trying again.
End with one machine-readable verdict line that names the head SHA you reviewed.

Three settings matter as much as the wording. Post each round's verdict and failure reason as a comment, and give the next reviewer session those comments, or "read the previous rounds" has nothing to read. Cap the loop in code, not in the prompt (Orbi's cap is the constant MAX_REVIEW_ROUNDS = 5). And merge only the exact commit you last checked (Orbi passes it to gh pr merge --match-head-commit), so the merge fails if the head moved after your check.

Should AI approve pull requests? covers the merge gates Orbi checks instead of an approve click. AI code review bottleneck? measures where agent PRs wait after merge, and what an autonomous coding agent does when it says no covers the ai-blocked stop from the user's side. Orbi Cloud runs this review loop on your GitHub repositories, and the comparisons set Orbi next to other coding agents.

What is new in Orbi, every week

One email a week: new features, hands-on posts and numbers from our own work with Orbi. Unsubscribe anytime.