TLDRocket
Sign in

Turn one giant AI-generated pull request to a reviewable stack

The GitHub Blog

GitHub built a way for coding agents to split one massive pull request into an ordered stack of small ones. So reviewers stop drowning in 1,700-line diffs and actually catch the bugs before merge.

Based on reporting by The GitHub Blog — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

Ask any developer who's watched an AI coding agent finish a feature overnight: the result usually lands as one gigantic pull request. GitHub's own example is a shopping-assistant feature where an agent added a data model, an API route, and new UI states all in a single diff that hit 1,721 changed lines. The pull request description was long but shallow, the reviewer opened it, saw the line count, and closed the tab to deal with it "later." That's the pattern GitHub says agents default to, because most of the code they were trained on was written and reviewed that way.

GitHub's fix isn't a smarter model, it's a different workflow: stacked pull requests. Instead of asking an agent for one finished feature, you break the work into a dependency chain of small, single-purpose pull requests, each one built on the last. In the shopping-assistant example, that means four layers: a catalog data module at the base, a validated search API on top of it, chat logic that calls that API above that, and finally the UI that renders product citations. Each layer sits closer to a single reviewable concern, small enough that a data owner can review the catalog work without ever touching UI code, and a UI owner can review citation states without wading through backend validation logic.

To make this practical with agents, GitHub ships a CLI extension, gh-stack, that lets a workflow initialize a stack, add layers on top of a base branch, and push and submit the whole chain as linked pull requests. There's also a gh-stack skill agents can install so they actually understand how to create and manage stacks rather than just being told to. In GitHub's walkthrough, separate agents handle separate layers, a data modeler agent for the catalog, a backend agent for the API, and a frontend agent for both the chat wiring and the citation UI, each running its own validation and tests before committing its layer.

The review experience is where the structure actually pays off. Every stacked pull request gets a stack map at the top for one-click navigation, and GitHub recommends reading it top-down for context but reviewing bottom-up so each layer builds on the one before it. In GitHub's example, Copilot Code Review flags two issues on the bottom layer; once the agent fixes and pushes them, GitHub detects that the branches above have diverged and blocks merging until the stack is rebased. A one-click rebase button exists in the UI, though GitHub warns it runs on GitHub's own servers and resets the commit signer, which can break signed-commit branch protection. The safer route is running the rebase and sync commands locally, which cascades the fix through every layer above it without anyone touching them by hand.

GitHub frames all this against a Gartner projection that coding agents could drive a 50% productivity gain across the software development lifecycle by 2028. The pitch, in effect, is that raw agent output was never the bottleneck, review was, and stacked pull requests are an attempt to make that review scale alongside whatever the agents can generate.

My take — AI-written commentary, not fact-checked reporting

The real bottleneck in AI-assisted coding has never been generation speed, it's been getting a human to actually read and trust the output, and a 1,721-line pull request that gets left to sit is proof of that. Stacked pull requests don't make agents smarter, they just force the same discipline good engineering teams already used before agents showed up: scope your changes, don't dump everything into one diff, and let reviewers specialize. If tooling like this becomes standard, the winners won't be the teams with the fastest agents, they'll be the teams that figured out how to keep humans meaningfully in the loop without drowning them.

Read more about this at: The GitHub Blog

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.