AIToday

AI Coding Triples PR Size, Cuts Bug Detection

Hacker News11h ago
AI Coding Triples PR Size, Cuts Bug Detection

Key takeaway

A developer who analyzed two similar software projects found that teams using Claude for code generation produced pull requests 3.5 times larger than those built with traditional AI tools. While larger PRs mean fewer tiny, easy-to-review changes, the bigger problem is that reviewers miss more bugs in code above 200 lines—and the author argues teams will not voluntarily constrain their AI agents to keep chunks smaller, likely trading short-term speed for long-term quality decay.

Summaries like this, in your inbox every morning.

Sign up free →

3 Key Points

  • What happened

    A developer compared two similar software projects—one built with traditional AI tools (autocomplete + occasional ChatGPT) and one built heavily with Claude. Average pull request size jumped 3.5× from 232 to 817 lines of code. The biggest PRs grew even more dramatically: the 90th percentile expanded 3× (from 600 to 1,799 lines), and the largest single PR reached 30,000+ lines—7× bigger than its pre-Claude counterpart.

  • Why it matters

    Research cited in the article (Smart Bear/Cisco study) shows reviewers catch far fewer bugs above 200 lines of code. The new median PR size of 210 lines now sits at that critical threshold where defect detection drops sharply. With reviewers processing 3× more code per task, the developer warns quality is likely to decline—and the incentive structure (speed now, bugs later) makes it unlikely teams will voluntarily split larger AI-generated code into smaller, more reviewable chunks.

  • What to watch

    The developer predicts a cycle where larger PRs → more overlooked defects → rework needed → slower delivery. This mirrors a lesson manufacturing and software learned decades ago about small-batch work. Without structural changes to how teams handle AI-generated code, the initial speed gains may reverse as technical debt accumulates.

In Depth

A developer compared two software projects built by overlapping engineering teams over hundreds of pull requests each. The first project, called Helpful, occurred before heavy Claude adoption and relied on autocomplete plus occasional ChatGPT assistance. The second, called Grateful, assumed Claude generated most code, with engineers responsible for context management, prompting, and review. The key finding: average PR size jumped 3.5×, from 232 lines of code to 817 lines.

The increase did not come from larger tasks alone. The distribution tells a more nuanced story. Tiny PRs—single-liners and small fixes—nearly disappeared, falling from 1 in 5 to 1 in 20. The bulk of work remained small to medium (a few hundred lines), but the center of gravity shifted about 100–200 lines heavier in the Claude-heavy project. The real driver of the 3.5× average increase was the emergence of much larger PRs. The 90th percentile jumped from 600 to 1,799 lines, and outliers ballooned: the largest PR in the Claude project exceeded 30,000 lines of code, nearly 7 times the largest in the pre-Claude project. Large and very large PRs, which made up 13% of work in Helpful, now account for 33% in Grateful.

This shift directly impacts code review quality. The author cites the Smart Bear/Cisco research, which found that reviewers are most effective on PRs below 200 lines. Once code exceeds that threshold, defect detection drops sharply. The quote from the study is stark: "Reviewers are most effective at reviewing small amounts of code. Anything below 200 lines produces a relatively high rate of defects, often several times the average. After that the results trail off considerably; no review larger than 250 lines produced more than 37 defects per 1000 lines of code." With the new median PR size at 210 lines and many PRs substantially larger, reviewers will overlook more bugs per task.

The author argues this outcome is not inevitable. Teams could configure Claude to work in smaller chunks, add annotations following best practices, and request gradual review. But he predicts they will not. The incentive structure favors throughput: engineers gain speed and convenience right now, while quality costs are pushed into the future. Splitting AI output into smaller PRs would require more back-and-forth with the tool, running counter to the "laziness instinct" that makes AI attractive. Faced with the choice of running a large task once or stopping the agent every 200 lines to review incrementally, teams will choose the former, even though the latter would maintain quality.

The author sketches an endgame: as AI models handle larger tasks, PR sizes grow further, reviewers catch fewer defects, and conceptual understanding of code degrades. Bugs accumulate, forcing rework on both humans and agents. The initial speed gain erodes as teams spend more effort fixing defects and rework of rework. Delivery slows back to historical pace—or slower. The author notes this mirrors a hard-won lesson from manufacturing and software: small-batch work prevents defects and waste. For decades, teams learned to work in small batches. Now, with AI, he observes, the industry is making a U-turn as though that lesson never happened. His conclusion: teams will eventually relearn small batches, probably sooner than expected, once the cost of technical debt becomes undeniable.

Context & Analysis

The article compares two greenfield projects of similar complexity and team overlap, differing only in how AI was used. Project Helpful relied on autocomplete and occasional ChatGPT queries, while Project Grateful assumed Claude wrote most code with engineers handling context, prompting, and review. This natural experiment revealed a structural shift in work patterns rather than simply larger tasks: tiny PRs (1-liners) dropped from 1 in 5 to 1 in 20, while large PRs roughly tripled. The author initially believed the change was order-of-magnitude larger based on hallway conversations, but the data showed a 3.5× increase—large enough to matter, but not as extreme as anecdotal evidence suggested.

The significance hinges on a specific research finding: the Smart Bear/Cisco study shows reviewers catch substantially more bugs in code below 200 lines, with defect detection dropping sharply above that threshold. The new median PR size sits exactly at 210 lines, and the distribution now includes many more very large PRs (up to 30,000+ lines). Because reviewers process three times as much code per task, the author argues quality degradation is highly likely—yet the economic incentive structure (immediate speed, deferred cost) makes it unlikely teams will voluntarily constrain their AI agents to maintain smaller PR sizes, even though doing so would preserve review quality.

FAQ

What is the actual size increase in pull requests when using Claude heavily?
The average PR size increased from 232 to 817 lines of code (3.5×), and the median went from 66 to 210 lines of code (3.2×). Large PRs also became much more common: they rose from 13% to 33% of all PRs.
Why does bigger PR size lead to more bugs being missed?
According to the Smart Bear/Cisco study cited in the article, reviewers are most effective below 200 lines; above that size, the rate of overlooked defects increases considerably. With median PR size now at 210 lines and many PRs much larger, reviewers will catch fewer bugs per task.
Could teams prevent this by asking AI to write smaller pull requests?
Technically yes—teams could configure Claude to work in smaller chunks or use annotation techniques. However, the author argues this is unlikely to happen because it would require engineers to artificially throttle their agents, reducing the immediate speed gains that make AI attractive.

Discussion

No discussion yet for this article

Stay ahead with AI news

Get curated AI news from 200+ sources delivered daily to your inbox. Free to use.

Get Started Free

Free · takes 30 seconds · unsubscribe anytime

1 minute a day. The AI essentials.

200+ sources · Email / LINE / Slack

Get it free →