Skip to content

Locale en · ko

Small PRs for the Agent Era — GitHub Stacked PRs and Copilot Stacked Sessions

By PapaCoder · Published 4 Aug 2026

Summary

GitHub’s 2026-07-30 public preview of stacked PRs plus Copilot stacked sessions: make agent output reviewable layers with gh-stack, not one mega-diff.

Many teams already get several agent-opened pull requests a day. The bottleneck is not generation speed — it is the single mega-diff. Reviewers see a schema migration and UI polish in one scroll, CI is all-green or all-red together, and “what do we merge first?” becomes a meeting.

Core takeaway: On 2026-07-30 GitHub put stacked pull requests into public preview, so the default unit of agent output can be an ordered chain of small, dependent PRs instead of one sprawling change. In the Copilot app, stacked sessions chain that work session-by-session onto the same stack.

Why it matters

For agent workflows, inspection beats invention. When auth scaffolding, API, UI, and tests land in one PR:

  • Reviewers cannot approve by layer — LGTM means everything.
  • Fixing the middle layer means rebase pain or “just open a new PR.”
  • High-risk layers (data, auth) drown in UI noise.

In a stack, each PR targets the branch of the PR below it. Reviewers see that layer’s diff only, use the stack map for context, and can review layers in parallel. Ready layers can merge together; branch protections and required checks still apply (Changelog).

From the agent side, the product pushes back on “one prompt = one mega commit.” Docs and the changelog call out the gh-stack skill so coding agents such as Copilot can create and manage stacks directly.

How it compares

ApproachUpsideCost
One giant PRSimpleHard to review, partial-land, or roll back cleanly
Manual multi-PR + rebaseLayered in theoryHumans babysit base branches
Graphite / external stack hostsMature stack UXExtra product, permissions, training
GitHub-native stacksWorks on github.com, CLI, mobile, agent skillsPublic preview (may change); merge-queue support rolls out gradually

For a long time the practical answer to “we want stacks” was a third-party host. The preview’s signal is that GitHub itself treats stacks as a first-class PR shape for the agent era. Teams happy on Graphite need not migrate tomorrow; teams drowning in unreviewable agent PRs finally have a native option.

If our earlier piece on Copilot Code Review Skills + MCP was about review agents, this one is about how generated work is sliced for humans. They complement each other.

Code / config example

From the official quickstart, a typical CLI path looks like this (public preview — commands may change):

# CLI extension
gh extension install github/gh-stack

# Agent skill (e.g. Copilot)
gh skill install github/gh-stack

# First layer
gh stack init feature/auth-schema

# Add the next layer after committing work
gh stack add feature/auth-api

# Open PRs and link the stack
gh stack submit

# Inspect
gh stack view

Conceptually:

main
  └─ PR#1  feature/auth-schema     (schema only)
       └─ PR#2  feature/auth-api   (API against #1)
            └─ PR#3  feature/auth-ui (UI against #2)

Opening PR#2 shows only that layer’s diff. Merging can land a contiguous group from the bottom up; remaining upper PRs rebase and retarget. With a merge queue, the stack enters in order and may span consecutive merge groups if it exceeds queue buffers (Merging stacked PRs).

Copilot app stacked sessions start a new session on top of an existing one: prior context, a plan gate, then a stacked PR aimed at the earlier PR’s branch. GitHub’s walkthrough stacks a react-bootstrap removal on a frontend modernization PR in a legacy React app (Stacked sessions blog).

Practical use

  1. Write layer boundaries before prompting. Example: (1) schema/contracts (2) server (3) client (4) observability/docs. Prefer “stack layer 1 only” over “do the whole feature.”
  2. Install the gh-stack skill for agents. The Copilot tutorial assumes CLI + skill (Stack AI-generated code).
  3. Do not grow upper layers while lower CI is red. A stack is a dependency chain; fixing only the top recreates mega-PR pain.
  4. Agree on partial merges. “Schema + API today, UI tomorrow” is now a product-supported workflow.
  5. Assume preview rollout. As of the changelog, availability rolls out over coming days; merge-queue support over coming weeks. Missing UI may be timing, not a bad install.

The first time I ran gh stack submit, the stack map changed the review conversation compared with the old habit of hand-wiring base branches. Separately, asking an agent to “open a stack” without the skill installed once produced two ordinary PRs with no stack link — a reminder that tooling setup beats clever prompting.

Senior-engineer perspective

Stacks are not a silver bullet.

  • Bad layer cuts yield small but meaningless PRs. Split by rollback and approval unit, not file count.
  • gh stack merge for a selected contiguous group is all-or-nothing for that selection and still hits branch protection. Strict-review teams must keep lower layers green first.
  • Smaller layers increase the need for intent in the PR body. Agents do not get a free pass because the diff is shorter.
  • If you already run Graphite well, measure migration ROI. Native value is one model across web, CLI, mobile, and agent skills — not magic quality.

Using it in Cursor

Cursor users may not live in the Copilot app’s stacked-session UI, but they can apply the same discipline on GitHub:

  • When a Cursor Agent / Cloud Agent PR balloons, follow up with “add the next stack layer on this branch…” and expose gh stack via agent tools or hooks.
  • Codify in AGENTS.md / project rules: “Do not mix schema, public API, and UI in one PR. Prefer gh stack.”
  • Plan-first, then one session per layer, mirrors Copilot stacked sessions mentally — GitHub now accepts that shape natively.
  • Teams that already split draft vs human publish (as PapaCoder does) can mirror it: agents open stacks; humans approve layers and merge.

FAQ

Q. It’s public preview — safe for production?
A. Docs mark it subject to change. Pilot on internal repos first; keep a rollback plan for critical paths.

Q. Does it work with merge queues?
A. Support is rolling out progressively. Queued stacks keep order; ejecting a PR also removes layers above it. If you do not see it yet, check rollout timing.

Q. Must we leave Graphite?
A. No. Decide based on whether native UX + agent skills outweigh existing stack-tool investment.

Q. Will agents choose good layers automatically?
A. No. Layer design stays human (or human-authored templates). Stacks execute the cut; they do not invent it.

Q. How is this different from the Copilot code-review piece?
A. That draft covered review agents (Skills/MCP). This one covers PR structure for generated work.

Sources

Closing

Teams are likely to standardize on reviewable layers, not “whatever one agent session emitted.” Stacks pull that grammar into GitHub itself. The next experiment is simple: take this week’s largest agent PR and reopen it as schema / server / UI — the review thread will tell you whether the preview earns a place in your default harness.

Related posts

More in Ai Agents

Comments

Checking sign-in…

No comments yet.