Bridging the Gap: Seamlessly Transitioning GitHub Copilot Agent Sessions to VS Code

In the modern software development lifecycle, the transition between high-level AI-assisted planning and low-level code implementation has historically been a point of friction. Developers often find themselves oscillating between specialized AI interface tools—which excel at drafting architectural plans and managing conversational context—and the integrated development environment (IDE), where the actual heavy lifting of debugging, testing, and fine-tuning occurs. GitHub is now addressing this workflow disconnect, enabling developers to move an active GitHub Copilot agent session directly from the Copilot app into Visual Studio Code without losing a single line of conversation, existing code changes, or the broader working context.

This capability represents a significant evolution in how AI agents interact with the developer’s local environment. Previously, moving from a conversational AI interface to a code editor often required manual synchronization—summarizing the AI’s progress, re-explaining the task, and manually porting code snippets. This process was not only time-consuming but also prone to losing the subtle nuances of the AI’s decision-making process. Now, the workflow is designed to be fluid, allowing the AI to handle the repetitive or time-consuming foundational work while seamlessly handing control back to the developer for final review, hands-on editing, and rigorous local verification.

Starting the Session in the Copilot App

The journey begins within the GitHub Copilot app, where developers can initiate complex tasks, ask for architectural advice, or generate initial code drafts. Before deciding to transition the work to a local environment, developers are encouraged to review the agent’s progress. A session within the Copilot app is far more than a simple repository of modified files; it acts as a comprehensive record of the task at hand, the proposed execution plan, and the entire conversation that led to the current state of the code.

This historical context is invaluable. When a developer moves into the implementation phase, they often need to understand the "why" behind a specific architectural choice. By maintaining this conversation history, the agent provides a roadmap of its logic. Developers no longer need to manually archive or summarize this history before switching tools; the context is preserved as part of the session, ensuring that the transition into VS Code is a continuation of the existing work rather than a restart.

Opening the Session in Visual Studio Code

When the time comes for the developer to take the reins, the transition is initiated directly from the Copilot app session. By selecting the "Open in VS Code" option, the developer triggers an automatic setup process. If multiple editors or VS Code instances are present, the system prompts the user to select the preferred environment.

Upon selection, VS Code launches the project using the specific worktree associated with the active session. The integration is deep: the existing session is automatically loaded into the Copilot sidebar within the editor. This creates a unified environment where three distinct components of the work—the original task conversation, the modified source code, and the active IDE tools—are perfectly synchronized. The developer is not rebuilding the state of the project in a new window; they are essentially extending the session’s life from a conversational interface into a professional development workspace.

Rigorous Review and Refined Interaction

Before moving to manual code adjustments, the immediate priority is to inspect the agent’s changes. Leveraging the native Source Control view in VS Code, developers can examine diffs on a line-by-line basis. This inspection process mirrors standard code review practices, ensuring that the agent-generated code aligns with team standards and project requirements.

The preserved conversation in the sidebar serves as a critical asset during this phase. If a particular implementation detail seems ambiguous or if the agent’s reasoning behind a specific function change is unclear, the developer can continue the dialogue with the agent directly. A prompt such as "Explain why you changed this function instead of adding a new helper" can provide immediate clarity, allowing the developer to identify potential side effects or performance implications before committing the code. This back-and-forth ensures that the agent remains an active partner in the review process rather than a static code generator.

How to continue a GitHub Copilot app session in VS Code

Making Hands-On Edits

Once the agent’s proposed changes are thoroughly vetted, the developer can begin the "hands-on" phase. There are inevitably moments where human intuition, domain-specific knowledge, or simple personal preference dictates the final structure of the code. Whether it is optimizing a specific line, tweaking a UI component for better aesthetic alignment, or adjusting variable naming conventions to match project conventions, the developer can make these changes directly in the file.

Because the editor is operating on the session’s existing worktree, these manual edits are immediately integrated with the agent’s prior work. There is no need to copy files between directories or manually manage the branch state. The manual changes effectively build upon the foundation the AI has already laid, allowing for a hybrid workflow that combines the speed of AI generation with the precision of human craftsmanship.

Verification and Local Testing

After the edits are finalized, the project must be verified. This is where the power of the integrated development environment truly shines. Using the VS Code integrated terminal, developers can run their standard suite of local validation workflows—be it npm scripts, build commands, or test runners.

It is essential to treat AI-generated code with the same level of scrutiny as code authored by a human colleague. This involves running relevant tests, analyzing any failures, and verifying behavior in real-time. For web applications, this includes testing in the browser; if the developer’s VS Code setup allows, they can leverage the integrated browser to inspect results without ever leaving the IDE. For UI-heavy changes, this verification extends to checking responsiveness, confirming that various states—such as loading, empty, or error states—behave as expected under different conditions.

Continuing the Workflow and Finalizing

One of the most powerful aspects of this workflow is the ability to pivot between AI assistance and manual coding as the situation demands. A developer might manually adjust a label and then, realizing a new test case is needed, immediately ask the Copilot sidebar to "Add a test for the updated label and run the relevant test file." Because the session remains active and the context is preserved, the agent understands exactly which component is being referenced, saving the developer the trouble of manually identifying the file or describing the context again.

Once the implementation is complete and verified, the final step is to commit and push the changes. By using the standard Source Control view in VS Code, the developer can commit the work to the branch associated with the session. Since VS Code opened the project directly from the worktree and branch of the session, the push operation updates the pull request that is already tracking the project. This eliminates the need for manual synchronization or re-attaching work to existing pull requests.

This end-to-end integration creates a clean, logical division of labor. The Copilot app excels at tackling the initial, broad-strokes implementation, while VS Code provides the necessary environment for the meticulous work of review, local testing, and final polishing. By ensuring that the session, the diff, and the worktree move seamlessly across this divide, GitHub is effectively reducing the cognitive load on developers, allowing them to focus on the quality of their code rather than the logistics of their tools.

Share:

Asep Darmawan writes for Tech Maze.

Leave a comment