Tutorial: Split Giant AI PRs into Reviewable Stacks
The biggest time sink in my team's workflow isn't writing code—it's the "AI dump" PR that lands in my lap at 3 PM with 1,800 lines of changes and a one-line summary that says "add search." I stare at it, my reviewer stares at it, and we both know this thing is going to sit for days because nobody wants to mentally parse a thousand lines of generated code in one go.
Coding agents are absurdly productive (Gartner's 50% SDLC productivity projection by 2028 feels conservative), but they ship in big blocks by default. They don't care about review ergonomics. That's on us.
The problem in practice
Last week I asked an agent to add product search to our shopping assistant. The starting state was exactly what you'd expect:
- A mock assistant pulling responses from a random line generator
- Hardcoded, inconsistent product data scattered across components
- Zero backend—no catalog module, no API, no data layer
My reviewer's response was predictable: "1,721 lines changed!! This description isn't very helpful. I'll review this later."
Translation: this sits in review limbo for a week, context degrades, feedback quality drops, and the whole thing merges under-reviewed.
Stacked PRs: the actual workflow
The fix isn't to slow down the agent—it's to give the agent a structure to ship into. Stacked pull requests decompose that giant diff into logical layers:
PR 1: Add catalog data model + seed data
↓
PR 2: Build /api/search route + validation
↓
PR 3: Wire client + render UI states
↓
PR 4: Add tests + end-to-end coverage
Each PR is ~300-400 lines, scoped to one concern, and naturally builds on the previous one. Reviewers can move linearly—understand the data layer, then the API, then the UI—without holding the entire feature in their head at once.
The agent still does its job at full speed. We just route its output through a pipeline that humans can actually consume.
Getting started
If you're using GitHub, tools like Stacking.dev or the native GitHub stacked PR experience let you branch from a parent PR, open a child, and link them automatically. The dependency chain keeps itself in sync, and CI runs per-layer.
Start small: pick your next agent-generated feature, break it into 3-4 logical chunks before you even prompt the agent, and watch your review cycle time drop from days to hours.

Embarrassed that I stacked the same change twice. Has anyone else dealt with an angry reviewer?