GitHub shipped Stacked Pull Requests in public preview on July 31, and followed up on August 4 with an engineering blog describing a complete workflow for turning giant AI-generated diffs into something reviewable. This is not just a new feature—it is GitHub's first explicit admission that when an agent generates 1000+ lines of code in one shot, the traditional "one PR, one conversation" model breaks down.
How it works
Technically, stacked PRs are an ordered chain of linked PRs within the same repository. Each PR targets the branch of the PR below it, forming a bottom-up merge chain: the base merges first, and upper layers automatically rebase to follow.
- GitHub.com: native UI plus a stack map showing dependencies
- CLI: lifecycle management via the
gh-stackextension (GitHub CLI 2.90.0+, Git 2.20+) - AI agents: a
gh-stackskill lets Copilot and other agents callgh stackcommands to split changes automatically - Splitting isn't free—upper layers must rebase and resolve conflicts after lower-layer changes, and CI can't be skipped.
- Tests must run at every layer, not just after the whole chain is done.
- Upper layers aren't independently shippable until they land on main.
- The
gh-stackskill's auto-splitting depends on prompt quality—it's not magic, and reviewers still need to examine each layer's actual changes. - Original post: https://github.blog/engineering/turn-one-giant-ai-generated-pull-request-to-a-reviewable-stack
- Docs: https://docs.github.com/pull-requests/get-started/stacked-prs-quickstart
Importantly, branch protection and required checks apply across the entire chain—stacking bypasses no merge gates. GitHub has deliberately bundled "safety governance" with the workflow upgrade.
The example workflow
The blog's case study splits a 1000+ line AI-generated diff into four layers:
1. L1 — data model 2. L2 — API 3. L3 — wiring layer 4. L4 — UI
Each layer gets a different reviewer; the base layer is reviewed and merged first, and upper layers build on it. This matches WHOOP engineer Mayank Saini's experience: "A big change used to mean one giant PR nobody wanted to review. Now it's a stack of small PRs where reviewers can actually follow the reasoning—and the whole chain merges at once."
Why now?
AI coding has collapsed the cost of *generating* code, but the cost of *reviewing* it hasn't changed. An engineer reviewing a 1000-line PR isn't much faster than reviewing 200 lines, yet an agent produces 1000 lines in minutes. The bottleneck has shifted from writing to reading, throttling the entire pipeline at the review stage.
Stacked PRs are not "prefer small PRs" discipline rhetoric—they make incremental review a platform default. The agent decides how many layers, how big each layer is, and who reviews; the stack map keeps dependencies visible while reviewers browse layers in parallel.
Four real-world caveats
Takeaway
Stacked PRs belong to the same wave as OpenAI Codex's Sol/Luna layering and Cloudflare's ADLC: when AI compresses implementation toward zero, every stage of engineering management gets rewritten. GitHub chose stacking because it stays within the "PR as the unit of collaboration" tradition—the path of least resistance and best ecosystem compatibility. Teams already using Graphite, Sapling, or git-branchless may find native stacking isn't a full replacement yet, but GitHub's entry turns stacking from an "advanced technique" into a "default action"—and by GA, native stacking could well become the default workflow for new repositories.
Links: