← Back to News

Stacked sessions and pull requests in the GitHub Copilot app

GitHub Copilot’s new stacked sessions feature addresses a common pain point in software development: managing multiple related code changes that build on each other. Instead of creating one massive pull request that’s difficult to review, stacked sessions let you organize related changes into a logical sequence of smaller, focused PRs. This mirrors how many experienced developers already work—breaking down large refactoring efforts or feature implementations into digestible chunks that are easier to test, review, and understand.

The technical foundation here is straightforward but powerful. GitHub Copilot now maintains context across multiple sessions, allowing you to work on interconnected changes without losing the AI’s understanding of your codebase’s structure and your intent. When you’re modernizing a legacy codebase—think updating database calls across multiple files, migrating from one framework version to another, or gradually introducing type hints to an untyped Python project—Copilot can track dependencies between changes. This means the AI understands that change A in file X relates to change B in file Y, and it can generate suggestions that account for this relationship. Each session remains independent enough to create its own PR, but connected enough that Copilot maintains architectural coherence across the entire stack.

This matters practically because code review velocity directly impacts team productivity. A 500-line PR reviewing an old authentication system alongside a new logging system alongside database optimizations is a review nightmare. With stacked PRs, you might have: PR #1 updating the authentication layer, PR #2 refactoring logging to use the new patterns, PR #3 updating database calls. Reviewers can approve them in sequence, and if one PR needs revision, you don’t have to rework the entire changeset. For cloud and automation engineers especially, this is valuable when modernizing infrastructure-as-code or migrating workloads—you can stage your changes logically rather than submitting one overwhelming PR that’s slow to review and risky to merge.

The practical applications extend beyond just cleanup work. If you’re building a new feature that requires updating an API contract, modifying database schemas, and then implementing the feature logic itself, stacked sessions let Copilot understand how these layers interact. It can catch inconsistencies between the contract change and the implementation, suggest better patterns based on the full context, and help you avoid the common mistake of partial migrations. For teams moving code to AWS or containerizing applications, this structured approach to multi-step changes reduces iteration cycles and makes the code review process actually valuable instead of overwhelming.

Source
↗ The GitHub Blog