Five minutes from push to merge: how we cut our agentic cycle time from 40 minutes to under 8
When agents write the code, the slow part of shipping starts after the push: CI, review, and the rounds of fixes in between. We cut our median PR from about 40 minutes to under 8 with small PRs, a checklist built from 1,299 review findings, and a babysitter that fixes whatever slips through.
TL;DR
In late October our median pull request took 35 to 58 minutes from opened to merged. In the week of November 16 it took 8.1. The week after, 6.5. The share of PRs merged in five minutes or less went from 7–22% to 38%, and the number we merged each week roughly doubled.
None of that came from the agents typing faster. It came from losing less time once the code existed:
- One behaviour per PR, under about 150 lines. Small PRs pass review first time. Big ones almost never do.
- A checklist the agent reads before it writes, built from 1,299 review findings.
- Three questions about the diff, answered in writing, before any PR opens.
- Open it ready, arm auto-merge, leave. A babysitter fixes what slips through.
Four minutes to write, forty to merge
An agent writes a feature in four minutes, so shipping it should take about four minutes. Then you watch the PR. CI runs. Greptile, our automated reviewer, comes back with a 4/5 and one finding. The agent fixes it and pushes. CI starts over. Greptile reviews again and finds a problem in the fix. Forty minutes later you are on round three of a four-minute change.
We timed the loop. CI takes a few minutes and Greptile about two, and the two run in parallel. A PR that clears everything on the first pass merges in about five minutes. Each extra round adds roughly another five. Almost all of cycle time hangs on one question: did the first review come back clean?
That gave us a target we could aim at. Under five minutes from push to merge, which only happens when Greptile's first verdict is 5/5.
PR size decides most of it
We sorted PRs by whether they passed Greptile cleanly on the first try. The result wasn't subtle.
| Changed lines | Clean first pass |
|---|---|
| Under 100 | 6 of 9 |
| 100 to 200 | 3 of 11 |
| Over 200 | 0 of 19 (about 1.9 findings each) |
Nineteen PRs over 200 lines, and not one got through clean. An earlier 40-PR study on another repo drew the same slope from a different angle: PRs that scored 5/5 had a median of 107 added lines, 4/5 had 213, and 3/5 had 971.
So the rule is one behaviour per PR, kept under about 150 changed lines, tests and lock files aside. A feature that is really four behaviours ships as four PRs, and the agent writes the next one while the last sits in review.
The load-bearing word is behaviour. You cut along what the product does, never through the middle of a change. Spread one change across two PRs and somebody forgets the sibling code path, and a forgotten sibling is exactly the thing reviewers catch.
Hand the writer the reviewer's notes in advance
Smaller PRs cut the findings. To cut them further, we read every finding Greptile had raised on a first pass over a month, October 14 to November 13: 1,299 of them. Then we sorted them into piles.
The biggest pile, about 45%, was one thing: an edge case in the logic that changed. Empty input, null, zero, one, duplicates, the record that was already processed. The other piles will look familiar to anyone who has been reviewed by a good senior engineer: double-counting, side doors into the same data, races between two reads, failure paths that left the user believing something false, migrations, UI state.
All of it went into a skill, now about 150 numbered items, that the agent loads before it writes any code headed for a PR. Not afterwards as a review pass, but up front, while it is still deciding how to write the thing. A review catches the mistake once it's made; a list read beforehand means it mostly never gets made. When a review round happens anyway, whatever Greptile caught that the list missed gets added, tagged with the PR number. Each miss makes the next first pass a little likelier to land.
Three questions the diff can't answer
The checklist still let one category through: problems you can't see by reading the diff. Our /code-review at medium depth got only 5 of about 27 PRs to a clean first pass, and its misses bunched together. So before any non-trivial PR opens, the agent writes down its answers to three questions:
- Side doors. What else can reach what this reads or shows? Earlier conversation turns, memory, a schedule, a role change, a saved grant, another route.
- Between the steps. What can change between two reads, or between what was shown and what gets acted on? What if it runs twice at once?
- Ways out. What happens on cancel, failure, timeout or early exit? Does the person see the truth?
Those three accounted for about two-thirds of real first-pass findings. Answering them takes a minute. Skipping them costs a round. After that, /code-review runs once, and never again on the same PR.
Stop waiting on yourself
What's left of cycle time is idle: a finished PR sitting there until somebody clicks a button. We took the somebody out.
- PRs open ready, not draft, with auto-merge armed in the same step. GitHub merges the moment the checks pass and the 5/5 lands.
- Every push gets reviewed. Greptile used to review only a PR's first commit, so a fix pushed after a 4/5 just sat there until someone asked for a re-review. Now it reviews every push.
- A babysitter takes over. It's a small detached script that watches the PR. If Greptile scores below 5/5 or a check fails, it starts Claude Code on a separate account, in its own worktree, to fix every finding, reply to each comment and push. It gets up to three rounds, then gives up and sends a notification.
Here is how the 634 PRs it watched actually went:
| Fix rounds needed | PRs |
|---|---|
| 0 (clean first time) | 276 (43.5%) |
| 1 | 289 |
| 2 | 48 |
| 3 | 21 |
92% merged. The ones that needed no rounds merged about 3 minutes after the babysitter started. The ones that needed rounds took 6.5 to 12.
What broke on the way
The failures taught us more than the wins did.
The babysitter that wouldn't stop. Early fix rounds ran on a different agent, and 28 of 47 hit the 15-minute limit. The agent kept watching CI after it had already pushed, and one round re-read a missing file 1,332 times. Rounds now get 8 minutes (the ones that finish take 1–3), and a round shuts itself down once its last 25 tool calls have all failed.
Two merges nobody heard about. The session watched the babysitter's log with tail -n0 -F. The babysitter creates that log after the watch starts, and on macOS that combination silently drops the lines. Two PRs merged and the session never found out. The fix is tail -n +1 -F, and that line now sits in our agent instructions with the reason written next to it.
The gate that locked itself. Our first merge gate waited for an attestation comment, but its workflow only re-ran on Greptile's comments, so it could never read the attestation. Greptile flagged that on the PR that introduced the gate. Fair enough.
Repo by repo
November medians from open to merge: hiring frontend 5.1 minutes, hiring backend 6.8 (it was 109 in October), Takeoff 8.2 (from 36.9 in October), Teams 8.8 (from 78 in September), main backend 11.8 (from 72 in September).
The faster CI we wrote about separately helped, but it was not the main lever. The main lever was that most PRs stopped needing a second lap.
Trying it on your own team
- Time the gap, not the writing. Measure from push to merge, and count rounds per PR.
- Cap PR size at whatever your reviewer passes cleanly. For us that's about 150 lines.
- Mine your reviewer's history. Its first-pass findings are a free spec for your agent's checklist.
- Ask the three questions before every non-trivial PR.
- Never leave a PR unwatched. Auto-merge plus something that fixes and re-pushes turns a stuck 4/5 into a merge.
Once agents do the typing, the number worth watching is how often a PR goes round again. Get that to zero for most of them and the five minutes mostly takes care of itself.
Frequently asked questions
What is agentic cycle time?
The wall-clock time from an agent pushing a change to that change being merged. Once agents write most of the code, writing stops being the bottleneck. The time goes to CI, automated review, and every round of fixes a review sets off, so that is where cycle time is won or lost.Why do small PRs merge so much faster?
They pass review the first time. Across 39 of our PRs, 6 of 9 under 100 changed lines got a clean 5/5 on the first pass, against 3 of 11 between 100 and 200 lines and 0 of 19 above 200. Every failed pass buys another full cycle of CI and review, so size drives time much harder than it looks like it should.What happens when a PR fails review after the agent's session has ended?
In our setup a background babysitter watches every PR. If review scores it below 5/5 or a required check fails, it runs a separate Claude Code agent to fix the findings, reply to each comment and push, for up to three rounds. GitHub's auto-merge lands the PR once it passes. Of 634 PRs it watched, 92% merged.