Veridical13 min readArticle

Pull Request Size: What Is Ideal and When to Split

Geometric illustration of a focused code change

A good pull request is one self-contained change, and in practice that usually means somewhere between 100 and 400 changed lines. Past roughly 400 to 500 lines, reviewers stop finding defects at the rate they do on small diffs, and past 1,000 lines the change should almost always be decomposed. Those numbers are heuristics, not laws, and the sections below explain where they come from, where they bend, and how to hold your team to them without turning review into a counting exercise.

Veridical
veridical.dev
Review Every Change With Evidence
Veridical provides evidence-based GitHub pull request reviews, with verified findings and inline evidence to help surface critical defects before merging.
Visit Veridical

TL;DR

  • Aim for one self-contained, single-purpose change. About 100 lines is a comfortable baseline, 200 to 400 is a common team ceiling, and 1,000+ should be split.
  • Size matters because attention is finite: Microsoft researchers found review effectiveness for one defect type was 76% in small changes against 36% in large ones.
  • Lockfiles, mass deletions, generated code and mechanical refactors inflate line counts without inflating risk. Judge cognitive load, not only the number.
  • When work cannot be split cleanly, use feature flags or stacked pull requests rather than one big-bang merge.
  • Track average PR size as a trend. A rising line is an early warning, and an advisory review score on every PR gives you a second safeguard.

Table of Contents

How pull request size is measured

Most teams measure size as lines changed: additions plus deletions, with modified lines counted as both. BSSw describes the same convention, adding the number of files touched as a second dimension. Both are proxies. A 300-line change in one file with a single idea is easier to hold in your head than a 120-line change spread across 15 files in three subsystems.

Two measures are worth tracking side by side, which is how Multitudes reports PR size: lines changed and files changed. Lines tell you how much a reviewer must read. Files tell you how much context a reviewer must load.

A third dimension has no number attached: the count of distinct ideas. If the description reads “fix the timeout, rename the config keys, and add retry logic,” that is three pull requests wearing one title.

Three dimensions used to assess pull request size

What counts as a good pull request size

Published guidance clusters in a narrow band. The table below collects what the sources we checked actually say.

Source Guidance
Google engineering practices The right size is one self-contained change. 100 lines is usually reasonable, and 1,000 lines is usually too large.
Materialize developer guide Keep PRs small, ideally under 500 lines changed, with one semantic change per review unit.
LeadDev Many organizations cap PRs at 200 to 400 lines, and some elite teams aim for under 105 total changes.
GitScrum best practices Ideal is under 200 changed lines and a single logical change, reviewable in 15 to 30 minutes. Over 400 is flagged as too big.

Notice what the sources share. Nobody argues that bigger is better, and almost nobody insists on a single magic number. Google’s own guidance says there are no hard and fast rules about how large is too large. The consistent anchor is the unit of change, not the line count.

For a working policy, a practical reading looks like this:

  • Under 200 lines: the target for most feature and bug-fix work.
  • 200 to 400 lines: acceptable when the change is cohesive. Expect a longer review and write a stronger description.
  • 400 to 1,000 lines: needs a reason. Ask whether it can be split, and if not, say why in the description.
  • Over 1,000 lines: split it, unless it falls under one of the exceptions below.

Why review quality falls as the diff grows

The mechanism is cognitive load. A reviewer holds the diff, the surrounding code and the author’s intent in working memory at once. Add enough files and that stops being possible, so the reviewer shifts from reading to skimming.

The Google Testing Blog makes the point plainly in its case for small pull requests: a mistake in a focused change is more obvious, while in a 40-file change that does several things it is easy to lose. GitHub’s own documentation on stacking code changes says review quality degrades as pull request size increases, and that reviewers may skim and miss issues.

The empirical evidence points the same direction. In Characteristics of Useful Code Reviews, the Microsoft study behind the 76% versus 36% figure, review usefulness drops as the number of files or lines in a changeset rises. Treat the exact thresholds as indicative: the study measured specific defect types in a specific environment. The direction is not in doubt, though.

There is a second effect that matters to managers. Large pull requests wait longer for a reviewer willing to start them, they collide with other work, and they are harder to revert. LeadDev reports that teams keeping PRs small see faster cycle times and fewer merge conflicts.

When a large pull request is acceptable

Line count is a blunt instrument, and a few categories legitimately break it. Google’s guidance notes that large file deletions and changes produced by trusted refactoring tools are reviewed far more easily than functional code. The same logic extends to a few other cases:

  • Lockfiles and generated artifacts. Thousands of lines, almost no review value. Exclude them from your size measurement if your tooling allows.
  • Mass deletions. Removing a dead module is a big number and a small risk, provided you verify nothing still calls it.
  • Mechanical renames. A tool-driven rename across 80 files is reviewable by checking the tool invocation and sampling the output.
  • Declarative tests and fixtures. Dense, repetitive and easy to parse, so they weigh less than logic of the same length.

The inverse also holds. Fifty lines that alter an authorization check, a cache key or a SQL query can deserve more scrutiny than a 600-line deletion. Size tells you how long a review will take. It does not tell you how dangerous the change is.

Two rules keep exceptions honest. Never mix a refactor and a behavior change in the same pull request, because the mechanical part hides the meaningful part. And say in the description which part is generated, so the reviewer knows where to spend attention.

How to make pull requests smaller

Small pull requests are mostly a planning habit, not a typing habit. The work is decided before the first commit.

  1. Write the one-sentence description first. If it needs the word “and” twice, you have found your split points.
  2. Separate preparation from behavior. Land the refactor, the new interface or the schema migration first, with no change in behavior. The follow-up PR then contains only the logic.
  3. Ship tests with the code they cover. A change and its tests belong together, but test-only additions for existing code can go separately.
  4. Slice vertically when possible. A thin end-to-end path through the feature is easier to review and safer to merge than a complete data layer with nothing consuming it.
  5. Open early, merge often. A pull request open for two days at 150 lines is healthier than one open for two weeks at 1,500.
  6. Move formatting changes out. Auto-format commits buried in a feature diff inflate the number and hide real edits.

Authors sometimes object that splitting creates more review overhead. It does create more review events, but each one is cheaper, and the total attention spent usually falls because reviewers stop re-reading context they could not hold the first time.

When the work cannot be split cleanly

Some changes have a real dependency chain: a new abstraction, then its first consumer, then the migration. Two techniques cover most of these cases, and both appear in GitHub’s guidance on stacking changes.

Feature flags. Merge incomplete work behind a flag that is off in production. Each PR stays small, the main branch stays releasable, and the flag flips only when the pieces are complete. The cost is flag hygiene: a flag nobody removes becomes permanent branching in your code.

Stacked pull requests. Build a series of dependent branches in which each layer targets the one beneath it. Reviewers validate the foundation first, then the logic on top. The cost is rebasing: when a lower layer changes after feedback, everything above must be updated, so keep stacks shallow, usually three or four layers at most.

Either way, tell reviewers the order. A short note at the top of each description, such as “2 of 4, depends on the interface change in the first PR,” saves them from reconstructing the plan.

Using pull request size as a team metric

For technical leads and project managers, average PR size is less a rule than a signal. Multitudes treats it as a possible bottleneck for change lead time, and its guidance is to read it at team level, not as an individual scorecard. That framing is the right one. Ranking developers by diff size teaches people to game the number, usually by bundling changes less visibly or splitting arbitrarily.

A sensible dashboard approach:

  • Track the median and the 90th percentile of lines changed per PR, because averages hide the occasional 3,000-line outlier.
  • Watch the trend over weeks, not a single sprint.
  • Pair size with time to first review and time to merge. If size rises and both lengthen, you have a bottleneck you can name.
  • Exclude lockfiles and generated files from the count.

A soft limit with a visible warning works better than a hard block. Let authors override with a stated reason, and review the overrides in retrospectives. For more on building this kind of process, see our guide to research-backed code review practices and our walkthrough of evidence-based GitHub pull request reviews.

Security-sensitive changes need smaller units still

In code that handles authentication, payments or personal data, a skimmed review is not a productivity problem but a leak waiting to happen. Two habits help. Keep security-relevant changes in their own pull requests so they cannot hide inside a feature diff. And put a short checklist in your PR template so authors validate inputs, parameterize queries and justify new dependencies before a reviewer opens the diff. A public example of such a template shows the pattern in practice.

If your team works under a compliance regime, review evidence matters as much as review itself. We cover one example in our piece on PCI DSS code review requirements.

Our perspective: size is a risk control, not a virtue

We review pull requests for a living, so we see what happens on both sides of the 400-line mark. Our view is that small pull requests are the cheapest way to raise the floor under any review process, whether the reviewer is a person, a tool or both.

Our perspective: size is a risk control, not a virtue — overview diagram

But we do not think size limits are sufficient. A team can hold every PR under 200 lines and still merge a defect, because a small diff can break a caller that is not in the diff at all. That is why we review repository context, meaning callers, interfaces and dependencies, and not only the changed lines. A one-line change to a function signature is tiny by any size metric and potentially enormous in blast radius.

We also think a review should end with something you can act on. Every Veridical review closes with a calibrated advisory score, built on projections of real-defect F1, which you can wire into a merge gate. Findings are published only when they are tied to concrete evidence, so you do not have to take them on faith. Size discipline keeps the diff reviewable. Verified findings and a score keep the review honest. Teams that want reliable quality use both.

— Łukasz

Pairing small pull requests with an evidence-based review

Once your pull requests are the right size, the next question is what reads them besides your teammates. Veridical reviews GitHub pull requests, checks repository context beyond the diff, and returns verified findings with inline evidence and an advisory score. Paid plans add deterministic checks, review history and repair workflows.

Plans on the pricing page: Standard is 39 USD per month and Pro is 69 USD per month, and a Launch tier is also listed. Open-source maintainers can look at our free reviews for open source projects. If you want to turn a score into a gate, see how to block bad merges with CI quality gates.

FAQ

What is a good PR size?

A good pull request is one self-contained change, typically around 100 to 400 changed lines. Google’s guidance calls 100 lines usually reasonable, while other teams set a ceiling of 200 to 400. Use the range as a default and the single-purpose rule as the tiebreaker.

How big of a PR is too big?

Guidance generally treats more than 1,000 lines as too large to review well, and review effectiveness already falls past roughly 400 to 500 lines. The exceptions are deletions, generated files and tool-driven refactors. If the change is hard to describe in one sentence, it is too big regardless of the count.

Do small pull requests really make reviews better?

The evidence says yes, within limits. Microsoft research found reviewers caught a given defect type far more often in small changes, and Google’s engineers argue mistakes are more obvious in focused diffs. Small size improves odds, but it does not replace checking callers and dependencies outside the diff.

Should we enforce a hard limit on PR size?

A soft limit usually works better. Warn above your threshold, allow an override with a written reason, and review the exceptions periodically. Hard blocks tend to produce arbitrary splits that make the code harder to follow.

Sources