# GitHub's Stacked PRs Tackle AI Code Bloat _GitHub's stacked pull requests help developers manage large AI-generated code changes by breaking them into reviewable layers._ **Published:** 2026-08-04 **Source:** https://www.startuphub.ai/ai-news/artificial-intelligence/2026/github-s-stacked-prs-tackle-ai-code-bloat --- The promise of AI coding assistants is undeniable: faster development cycles, increased productivity, and a significant boost to the software development lifecycle. Gartner projects AI could drive a 50% productivity gain across every SDLC stage by 2028. But as AI agents churn out code at an unprecedented rate, they often present developers with a familiar, yet amplified, problem: the giant, un-reviewable pull request. [GitHub](https://github.blog/engineering/turn-one-giant-ai-generated-pull-request-to-a-reviewable-stack/) is now offering a way to tame this AI-driven code sprawl with its stacked pull requests feature. AI Code BloatDriver AI agents generate massive, monolithic pull requests, often over a thousand linesFrom the article 9+ mentionsBut as AI agents churn out code at an unprecedented rate, they often present developers with a familiar, yet amplified, problem: the giant, un-reviewable pull request.leads toUnreviewable PRsDriverdevelopers face difficulty reviewing giant code changes with mixed concernsFrom the article 3 mentionsThis layered approach means that a data owner can review the data model, while a UI specialist can focus on the frontend components, all within manageable, scoped PRs.solvesGitHub Stacked PRsCorefeature breaks large AI-generated code into smaller, reviewable layersFrom the article 2 mentionsBy installing the `gh-stack` CLI extension and teaching agents how to manage stacked PRs, development teams can direct their AI coding partners to produce work in this more reviewable format.enablesDecomposition CoreContextstacked PRs enable breaking down complex features into manageable, logical stepsFrom the articleThe solution proposed by GitHub is rooted in a long-standing software engineering principle: decomposition.informsTeach AI to StackEffecttraining AI agents to produce stacked PRs as their default outputFrom the article 2 mentionsGitHub’s implementation allows this to be managed directly through the pull request UI and via the `gh stack` command-line interface.improvesStreamlined ReviewsEffectsmaller, focused changes are easier for human developers to review effectivelyFrom the article 4 mentionsThe result is a review process that grinds to a halt, with reviewers overwhelmed by the sheer volume, leading to delayed merges and potentially lower quality code.drivesFaster AI DevOutcomemanaging AI-driven code sprawl leads to quicker development cyclesFrom the articleThe promise of AI coding assistants is undeniable: faster development cycles, increased productivity, and a significant boost to the software development lifecycle.achievesIncreased ProductivityOutcomeAI could drive a 50% productivity gain across every SDLC stageFrom the article 2 mentionsThe promise of AI coding assistants is undeniable: faster development cycles, increased productivity, and a significant boost to the software development lifecycle. Imagine prompting an AI to add a complex feature, like product search to an e-commerce application. Minutes later, you’re faced with a single pull request potentially spanning over a thousand lines of code. This single commit might bundle a new data model, API routes, client wiring, UI elements, and error states, all mashed together. For AI models trained on traditional coding patterns, this monolithic approach is often the default output. The result is a review process that grinds to a halt, with reviewers overwhelmed by the sheer volume, leading to delayed merges and potentially lower quality code. ## Decomposition: The Core of Stacked PRs The solution proposed by [GitHub](https://github.blog/engineering/turn-one-giant-ai-generated-pull-request-to-a-reviewable-stack/) is rooted in a long-standing software engineering principle: decomposition. Stacked pull requests allow developers, and critically, their AI coding partners, to break down a large feature into a series of smaller, logically ordered, and independently reviewable pull requests. Each layer builds upon the previous one, creating a dependency chain that mirrors how complex features are typically built. Consider adding product search. Instead of one massive PR, the work can be segmented: - **Layer 1 (Base):** A typed catalog data model with validation and a data access module. - **Layer 2:** A validated API endpoint to retrieve product data, depending on Layer 1. - **Layer 3:** Integration logic for the chat assistant to call the API and use real product data, depending on Layer 2. - **Layer 4 (Top):** UI components for displaying product citations and managing state, depending on Layer 3. This layered approach means that a data owner can review the data model, while a UI specialist can focus on the frontend components, all within manageable, scoped PRs. GitHub’s implementation allows this to be managed directly through the pull request UI and via the `gh stack` command-line interface. ## Teaching AI Agents to Stack The real innovation here is extending this workflow to AI agents. By installing the `gh-stack` CLI extension and teaching agents how to manage stacked PRs, development teams can direct their AI coding partners to produce work in this more reviewable format. Custom agents can be assigned specific layers of the stack, a data modeler agent for Layer 1, backend agents for Layer 2, and frontend agents for subsequent layers. This ensures that AI-generated code adheres to a structured, incremental delivery process, rather than a single, overwhelming commit. ## Why This Matters for the AI Development Workflow The ability to manage AI-generated code effectively is becoming paramount. As tools like [GitHub Copilot](https://github.blog/product/github-copilot/) become more sophisticated, their output needs to be integrated into existing, high-quality development workflows. Stacked pull requests address a critical bottleneck: code review. By breaking down complex AI-generated features into bite-sized, focused PRs, teams can maintain context, improve feedback quality, and accelerate merge cycles. This is particularly important for smaller startups or teams with limited review bandwidth, where a single large PR can become a significant blocker. For founders and investors, this signals a maturing of the AI development toolchain. It’s no longer just about generating code, but about integrating that generation into established, efficient software engineering practices. Companies that can effectively manage AI-assisted development, from prompt to deploy, will gain a significant competitive edge. The underlying technology, including GitHub’s own engineering infrastructure, is designed for performance and availability. This focus on developer experience, even when dealing with the complexities introduced by AI, is key to GitHub’s position as a leader in AI code assistants, as recognized by Gartner. The challenge now is for AI agents to consistently produce work that fits this structured approach, moving beyond monolithic code dumps to a more modular, reviewable output. --- Original analysis from [startuphub.ai](https://www.startuphub.ai), the #1 AI startup directory.