SHEET 03blog/reviewing-ai-written-pull-requests/ REVISED 

Reviewing AI-written pull requests: a process a small team can run

In a Harvard study, coding agents raised PRs 36% and review time 56%. A review process for AI-written PRs: size limits, author proof, a checklist, tooling.

Published
Length
12 min read
Tags
  • code-review
  • ai-agents
  • developer-tools
  • github-actions

To review AI-written pull requests without drowning in them, a small team needs four rules. Cap the size of each pull request. Make the author prove the change works before anyone reviews it. Check for the mistakes agents typically make. Let an AI reviewer go first, but never let it be the only approval. Review is now where the time goes, so every rule here exists to protect reviewers.

Why is code review suddenly the bottleneck?

Agents raised the amount of code written far more than they raised finished work, and every extra pull request still needs someone to read it.

The best data so far is a Harvard working paper by Fiona Chen and James Stratton, Artificial Intelligence in the Firm: Bottlenecks in Software Production. It uses Jellyfish engineering data covering 720,542 workers at 655 firms from January 2021 to August 2026 (current version dated November 19, 2026). Twelve months after a firm adopted AI coding agents:

  • Pull requests opened rose 35.7%.
  • The time from a pull request being submitted for review to its merge rose 56.1%. The wait before review started went up 59.9%, and the time in active review went up 58.5%.
  • Review comments per change rose 38.6%.
  • Jira issues resolved, the closest measure of finished work, rose only 13.7%, an estimate the paper calls borderline significant.

AI review tools didn’t fix it. By July 2026, 79.1% of the firms had used them, but only 23.3% of review comments came from AI, and humans still wrote the overwhelming majority of reviews. The effect was worse in complex codebases: time to merge rose 69.7% in the third of firms with the most repositories, against 25.4% in the third with the fewest. It’s a working paper and hasn’t been peer reviewed yet.

The volume keeps growing. GitHub’s Octoverse 2026 post says more than 40% of pull requests on GitHub started with an agent’s first draft by September 2026, up from 17% in March. On November 19, 2026, Next.js had 1,553 open pull requests older than a month that had never been reviewed. In the Hacker News thread on the Harvard paper, one commenter summed up the quality side: “With AI, I get overblown MRs that work, but oftentimes could be simpler.”

How big should an AI-written pull request be?

Keep it under about 400 changed lines, with one purpose per pull request. Agents will happily produce a 2,000-line diff. Reviewers get tired.

Google’s guide to small changes says “100 lines is usually a reasonable size for a CL, and 1000 lines is usually too large”. SmartBear’s study of 2,500 reviews covering 3.2 million lines of code at Cisco in 2006 found reviewers caught far fewer defects per line above 200 lines. Its advice: 200 lines is a good limit, 400 the absolute maximum, under 500 lines an hour, under 60 minutes at a stretch. The study is old and vendor-run, but agents haven’t changed how long a person can concentrate.

Put the limit in the task you give the agent (“keep the diff under 300 lines; if it needs more, stop and propose a split”). Then enforce it in CI, so it doesn’t depend on anyone remembering. This GitHub Actions workflow fails when a pull request changes more than 400 lines, not counting common lockfiles. A size-exception label skips it, for the rare change that can’t be split:

# .github/workflows/pr-size.yml
name: pr-size
on:
  pull_request:
    types: [opened, synchronize, reopened, labeled, unlabeled]
permissions:
  contents: read
  pull-requests: read
jobs:
  pr-size:
    runs-on: ubuntu-latest
    steps:
      - name: Fail if the PR is too big to review well
        shell: bash
        env:
          GH_TOKEN: ${{ github.token }}
          PR: ${{ github.event.pull_request.number }}
          REPO: ${{ github.repository }}
          MAX_LINES: 400
          SKIP: ${{ contains(github.event.pull_request.labels.*.name, 'size-exception') }}
        run: |
          if [ "$SKIP" = "true" ]; then echo "size-exception label set, skipping"; exit 0; fi
          changed=$(gh api --paginate "repos/$REPO/pulls/$PR/files" \
            --jq '.[] | select([.filename | endswith("package-lock.json", "pnpm-lock.yaml", "yarn.lock", "go.sum", "Cargo.lock", "poetry.lock")] | any | not) | .changes' \
            | awk '{ s += $1 } END { print s + 0 }')
          echo "Changed lines, lockfiles excluded: $changed (limit $MAX_LINES)"
          if [ "$changed" -gt "$MAX_LINES" ]; then
            echo "::error::$changed changed lines. Split this PR, or add the size-exception label and explain why in the description."
            exit 1
          fi

Make pr-size a required status check, and add generated files or snapshots to the endswith list if they inflate your numbers. The script pages through the REST API because gh pr view --json files stops at 100 files, and shell: bash turns on pipefail, so a failed API call fails the check instead of counting zero. To split big changes, Google’s guide suggests stacking small changes or splitting by layer or feature slice.

Who is responsible for code an agent wrote?

The person who opened the pull request, completely. “The agent did that” is never an answer to a review question.

Simon Willison put it plainly in Your job is to deliver code you have proven to work. He calls dumping giant untested pull requests on colleagues “rude, a waste of other people’s time, and is honestly a dereliction of duty as a software developer”. His two steps are to watch the code do the right thing yourself, and to ship an automated test that fails if you revert the change. His line on agents: “A computer can never be held accountable. That’s your job as the human in the loop.”

A pull request template makes that proof the default instead of a favor:

<!-- .github/pull_request_template.md -->
## What and why
<!-- One paragraph. Link the issue. -->

## How I verified it
<!-- Commands you ran, the test that fails without this change, screenshots. "CI is green" is not enough. -->

## AI involvement
- [ ] Written by hand
- [ ] Drafted by an agent, and I read every line of the diff
- [ ] Drafted by an agent, and I did not read every line (say which parts)

## Risk
<!-- What could break, who would notice, how to roll back. -->

- [ ] I can explain every change in this diff without asking the agent

The “AI involvement” box tells the reviewer where to look harder. A GitHub setting backs this up: in a ruleset, “Require an approval from someone other than the last person to push to a branch” means the developer whose account the agent pushed from can’t also be the approver. A newer rule on the same page, in public preview, asks for one extra approval when Copilot opens a pull request under its own identity rather than for a person.

What should a reviewer check in an AI-written PR?

Start with scope and evidence, not style. Does the diff do only what the issue asked, and is there proof that it works? Then check the places where agents tend to go wrong.

Check Why agents get it wrong How to spot it
Scope Agents “improve” nearby code nobody asked about Compare the changed files with the issue. Unrelated renames and refactors go in their own PR
Reuse The agent wrote a new helper instead of finding the existing one Search the codebase for similar function names before reading the new one
Size of the solution Extra layers, options and config for one use case Ask whether the same result fits in half the code
Tests Making a red test green is easier than fixing the code Read the test diff first: changed assertions, skipped tests, tests that only exercise mocks
The checks themselves A change that edits CI, lint rules or review config can lower its own bar Treat .github/, lint config, CODEOWNERS, REVIEW.md and agent instruction files as high-risk paths
Dependencies Models suggest packages that don’t exist or aren’t the ones you meant Open each new package’s registry page and check the lockfile diff
Error handling Broad catches and silent fallbacks make demos pass Search the diff for empty catch blocks, default values on failure and swallowed errors
Security New endpoints without authorization checks, unvalidated input, secrets in logs For every new entry point, find where it checks who the caller is

Two of these rows have numbers behind them. The USENIX Security 2025 paper on package hallucinations found that at least 5.2% of packages suggested by commercial models, and 21.7% from open-source models, didn’t exist. Attackers can register those names. On checks, the Claude Code team’s verification write-up (November 16, 2026) states the rule well: “If a change can modify the check that judges it, the check is broken.” Their Code Review reads REVIEW.md from the base branch, never from the pull request.

A practical reading order: the PR description and the evidence, then the tests, then interfaces and data models, then the implementation. If the agent wrote a session summary, use it as a map but check it against the diff. Summaries describe what the agent meant to do. The diff shows what it actually did.

Should an AI reviewer go first?

Yes, as a first pass that the author clears before asking a person. Don’t make it the only reviewer.

Run the cheap, deterministic checks before any model: types, linters, tests, the size check above. A commenter in the Hacker News thread on the Claude Code team’s post, recalling a talk on verification, described the order: “static analysis to provide cheap deterministic checks as the first goal and only then moving to other forms of verification.” Then add an AI reviewer. Options as of November 2026:

  • Claude Code Review, for Team and Enterprise plans on GitHub. Several agents look for issues, a verification step filters false positives, and findings are posted inline by severity. It doesn’t approve or block on its own, and Anthropic’s docs say it “may miss bugs, security vulnerabilities, or other issues”. The local /code-review command works on any plan.
  • Alibaba OpenCodeReview, an Apache 2.0 command-line tool that pairs a deterministic pipeline (which files to read, rule matching) with an LLM. Alibaba says it beat Claude Code’s precision on its own 200-pull-request benchmark at about a ninth of the tokens, trading some recall on purpose. An independent test reported by InfoQ on just 10 pull requests found its best configuration caught about 20% of the issues experts had flagged.

That 20% is why a person still reviews. The author resolves or answers every AI finding before requesting human review, so the human reviewer can spend their time on design and intent.

Should you let an agent approve pull requests?

Not yet, for most small teams. If you want to try, run it in observe mode, and keep a human seat on anything risky.

Anthropic launched Claude Ship on November 23, 2026. It bundles Code Review, PR Steward (beta), which works on failing checks, merge conflicts and review feedback, and Claude Approvals (beta). It’s for Team and Enterprise plans on GitHub only. Approvals reads a policy from .claude/approvals.yml on the default branch. Each rule sets how many people must approve a path and whether Claude approves, comments or blocks, and the strictest rule that applies wins.

The docs are candid about the gaps. The overview and the policy reference point out that:

  • The pull request’s author can fill a seat, so with seats: 1 nobody else has to look.
  • Claude’s approving review can satisfy a GitHub branch rule that requires one approval.
  • A rule with claude: approves doesn’t start a review by itself, so Claude can approve a change nothing has read unless the rule waits for claude/code_review = pass.
  • A machine user, an ordinary GitHub account that an agent drives, counts as a person and can fill a seat. Exclude its login with "!" in the seat’s from list.
  • Policy conditions can’t read CI results, so CI has to stay a separate required check.

The skeptics’ point, from an engineer quoted by The Register, is that if approval moves to Claude, “the devs will lose that overview and judgment opportunity”. For a small team I’d start stricter than the docs’ starter policy, which lets the author count as one of the people. This sketch requires one non-author on all code and two on review rules, CI and agent config. Docs-only changes need no human once Claude’s review passes, so they can merge on Claude’s approval alone. Delete that override if you don’t want that:

# .claude/approvals.yml (illustrative sketch, check against the policy reference)
version: 1
mode: observe
rules:
  - purpose: "Code needs one person who didn't write it."
    paths: ["**", "!docs/**", "!**/*.md"]
    verdict: { claude: comments, seats: [{ count: 1, from: [humans, "!pr/authors"] }] }
    advisory: [claude/code_review]
  - purpose: "Docs-only changes can be approved by Claude once its review passes."
    paths: ["docs/**", "**/*.md"]
    verdict: { claude: comments, seats: [{ count: 1, from: [humans, "!pr/authors"] }] }
    override:
      - { if: "claude/code_review = pass", verdict: { claude: approves, seats: 0 } }
  - purpose: "Review rules, CI and agent config take two people who didn't write the change."
    paths: ["**/.claude/**", ".github/**", "**/REVIEW.md", "**/CLAUDE.md", "**/AGENTS.md", "**/.mcp.json", "**/CODEOWNERS"]
    nested: inherit
    verdict: { claude: comments, seats: [{ count: 2, from: [humans, "!pr/authors"] }] }

The keys, quoting and seat syntax follow the policy reference as of November 29, 2026, but this is a sketch that hasn’t been run against a live repository, and Approvals is in beta. Open it in a pull request first: Approvals checks a changed policy file for errors and refuses one with unknown keys. Because the strictest rule wins, a pull request that touches both code and docs still needs a person. One limit matters for open source: on pull requests from forks, no approval counts toward a set that excludes pr/authors, so fork contributions would wait forever under this policy. Leave it in observe mode for a couple of weeks and compare Claude’s decisions with your own.

How did reviews work when agents built this site?

This site was rebuilt in November 2026 by coding agents working from a written plan, some in parallel git worktrees. Every task went to a separate reviewer agent before merge. Findings were sorted into Important and minor, fixes were capped at five rounds, and deferred minor items went into the project ledger.

The reviews caught real problems. The security-focused review of the contact-form functions returned eight Important findings, including an SSRF filter that could be bypassed with IPv4-mapped IPv6 addresses, and all eight were fixed before merge. Some findings were against the plan itself. One task’s review flagged that the JSON-LD output the plan specified didn’t escape </script>, and the fix overrode the plan. At the end, four reviewers with different focuses (security, frontend, SEO, and tooling and CI) went over the whole branch before launch.

That last pass caught something the per-task review missed. The contact-form task’s report said Cloudflare’s email-sending binding worked in Pages Functions. The final security review found it doesn’t, and mail moved to a separate Worker. The report was confident and wrong, which is why the reading order above puts the diff and the evidence ahead of the summary.

The lesson I took from it: review the spec as hard as the code, because an agent will faithfully build a mistake you wrote down.

What I’d do this week

  1. Add the pr-size workflow and make it a required check.
  2. Add the pull request template, with “How I verified it” and “AI involvement”.
  3. In a GitHub ruleset for your default branch: require one approval, dismiss stale approvals when new commits are pushed, require approval of the most recent push, and require approval from someone other than the last pusher.
  4. Add a CODEOWNERS file that puts named people on .github/, auth, payments and database migrations, and turn on “Require review from Code Owners”.
  5. Turn on an AI first-pass reviewer. The author resolves its findings before requesting a human.
  6. Write a short REVIEW.md with the five mistakes your team keeps finding in review.
  7. Track two numbers weekly: hours from a PR opening to its first human review, and PRs reverted or hot-fixed within 14 days.

What this shift does to people, their skills and your metrics is in when developers become reviewers. For triaging agent-run security reviews, see AI security audit tools. And if you want help setting up a review process that keeps up with your agents, that’s the kind of work I do as a fractional CTO.

Questions

Should AI-written pull requests be reviewed differently from human ones?

Keep the same bar and change the process around it. The author has to show evidence that the change works before anyone reviews it. The reviewer then looks for the mistakes agents tend to make, such as changes nobody asked for, duplicated code, weakened tests and new dependencies. Size limits matter more, because agents make large diffs cheap.

How big should a pull request be for a good review?

Smaller than most AI-written pull requests are. Google's engineering practices guide calls 100 lines usually reasonable and 1,000 usually too large. A 2006 SmartBear study of 2,500 reviews at Cisco found reviewers became much less effective above 200 to 400 lines and after about an hour of reviewing.

Can an AI code reviewer replace a human reviewer?

Not on a small team today. AI reviewers catch real bugs, but the vendors themselves say they miss issues, and an independent test of one open-source reviewer found that its best configuration caught about 20% of the issues experts had flagged. Use AI review as a first pass that the author clears before a person looks.

Can Claude approve pull requests on its own?

Yes, through Claude Approvals, a beta feature of Anthropic's Claude Ship, launched in November 2026. A policy file in the repository sets where Claude may approve and how many people must. Anthropic recommends starting in observe mode, and its own docs list several ways a pull request can merge with no human review if the policy and GitHub rules are loose.

Who is accountable for a bug in an AI-written pull request?

The person who opened it, then the person who approved it. A tool can't be held accountable. Write this into your team's rules so that "the agent did that" is never an acceptable answer to a review question.

About the author

Software engineer and serial founder in Alexandria, Egypt, and CTO at Zaher.AI, a GEO and SEO agency serving MENA.

Console

Type help and press Enter.