Stacked sessions
Related coding tasks in the same repository where each session builds on the previous one.
Stacked sessions are a way to organize your coding work when using AI tools like GitHub Copilot. Instead of starting a new, unrelated task each time, you can group together a series of coding actions that are connected.
For example, imagine you're updating a feature in a project. You might first ask Copilot to help you write a new function, then ask it to add tests for that function, and finally ask it to refactor the existing code to use your new function. These actions, done one after another in the same project area, form a stacked session. It helps the AI understand the context and build upon what it just did, making the process smoother.
Stacked sessions refer to a sequence of related interactions within a single repository or project context, where subsequent actions leverage the state or code generated by prior actions. This approach enhances AI code generation by maintaining contextual continuity across multiple, dependent tasks.
This is typically implemented by the AI tool preserving the code state and conversational history within a defined scope, allowing it to understand the evolving codebase and user intent across a series of operations. Tradeoffs include potential for context window limitations and the need for careful task sequencing to avoid introducing errors or unintended side effects.
Microsoft Copilot's GitHub app is now offering stacked sessions, indicating a move towards more integrated and context-aware AI coding assistance. This feature allows developers to perform a series of related code modifications sequentially, improving efficiency and reducing the need to re-establish context for each task.
- Stacked sessions and pull requests in the GitHub Copilot appMicrosoft · GitHub Blog: Copilot ·
- Microsoft Copilot
- Microsoft Copilot, through GitHub Copilot, is introducing stacked sessions to allow developers to perform a series of related coding tasks sequentially within the same repository.
- Session
- A session is a single, discrete interaction or task with an AI tool, wh
- Branching
- Branching in version control creates separate lines of development, w
- Task Management
- Task management tools organize work, but stacked sessions speci
The term 'stacked sessions' appears to be a product-specific feature name introduced by Microsoft for GitHub Copilot, describing a workflow for developers. Source ↗
Open GitHub Copilot in your IDE. Start by asking it to write a simple function, like a Python function to calculate the factorial of a number. Then, immediately ask it to write unit tests for that specific function. Finally, ask it to refactor the function to be more efficient if possible. Notice how Copilot remembers the function you just created when you ask for tests or refactoring.
The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.
- PromptRole-play a student struggling with math for AI tutor simulationSimulate a student's math struggles and uncertainty for AI tutor evaluation. · 5 min
- TemplateReusable workflow templates for healthcare teamsTeams can create and share templates for common workflows like documentation or prior authorizations. · 15 min
- TemplateTemplate for building an AI tool tailored to your workA structured approach to defining and building a custom AI tool for specific business needs. · 15 min
- TemplateEvals CSV prompt list for agent skillsA CSV file template for listing prompts used in evaluating agent skills. · 20 min
- HeuristicDouble coding agent task completion with docs linksProviding coding agents with a documentation link significantly increases their task completion rate. · 2 min
Questions people ask
- What is the main benefit of stacked sessions?
- Stacked sessions allow AI coding assistants to maintain context across multiple related tasks, leading to more efficient and coherent code development.
- How do stacked sessions differ from regular coding sessions?
- Regular sessions might be independent, while stacked sessions involve a sequence of tasks where each new task builds upon the results of the previous ones.
First seen on Subvolts Jul 30, 2026. Updated Sep 15, 2026. Written by an AI model from the items above and reviewed against them weekly; report an error.

