How to continue a GitHub Copilot app session in VS Code
Learn how to move an agent session from the GitHub Copilot app into VS Code without losing the conversation, code changes, or working context. The post How to continue a GitHub Copilot app session in VS Code appeared first on The GitHub Blog .
正文 · 来源原文
Ready to try it? Download the GitHub Copilot app, start a session, and open it in VS Code when you are ready to continue coding.
Senior AI Developer Tools Advocate
The agent has finished the bulk of your change. Now you want to inspect one implementation detail, adjust a few lines by hand, and run the project locally before you ship it.
But the work is sitting in the GitHub Copilot app… and your editor is where you review diffs, debug code, and make final adjustments. Do you have to choose between staying in the session and starting over in Visual Studio Code?
You don’t. You can open the Copilot app session directly in VS Code and continue with its conversation, code changes, and working context intact. That means Copilot can handle the repetitive or time-consuming work, then hand control back to you for closer review, hands-on editing, and local testing.
In this tutorial, you’ll learn how to:
Open the session you want to continue. Before handing it off, take a moment to review the task and the work Copilot completed.
A session contains more than a collection of modified files. It also records the task, the plan, and the conversation that produced those changes. That context is important when you want to understand why Copilot chose a particular implementation or ask it to revise part of the work.
为更新后的标签添加测试并运行相关测试文件。不要修改不相关的组件。
由于您仍处于原始会话中,Copilot 会保留解释“更新后的标签”所需的上下文。
当实施准备就绪时,再次检查最终的差异。然后使用源代码管理视图或集成终端提交并推送更改:
使用存储库的正常分支、提交、审查和批准实践。由于 VS Code 打开了与会话关联的工作树和分支,因此推送分支会更新已经跟踪该工作的拉取请求。
无需将已完成的文件复制到另一个结帐中或手动将工作重新连接到拉取请求。
在 VS Code 中打开 Copilot 应用程序会话可以让您进行清晰的分工,而无需拆分工作本身。 Copilot 可以承担更大或重复的实施,而您可以进入编辑器进行详细审查、有针对性的更改、本地测试和最终完善。
会话、差异和工作树随您移动。首先在 Copilot 应用程序中指导工作,每当您需要动手控制时切换到 VS Code,并通过相同的拉取请求工作流程推送最终结果。
准备好尝试了吗?下载 GitHub Copilot 应用程序,启动会话,并在准备好继续编码时在 VS Code 中打开它。
You do not need to summarize that history or copy it into a new chat before moving to VS Code.
From the session, select Open in VS Code. If the app presents more than one supported editor or VS Code installation, choose the one you want to use.
VS Code opens the project using the worktree associated with the session. It also displays the existing session in the Copilot sidebar.
That gives you three connected pieces of the original work:
You are continuing the existing session, not reconstructing it in a new editor window.
Before editing, inspect the diff in VS Code. Open the Source Control view to see the changed files, then select a file to review its changes line by line.
Review the implementation as you would any other proposed change. In particular, check that:
The preserved conversation can help explain how Copilot arrived at the implementation. If something is unclear, continue prompting Copilot in the sidebar. For example:
You can also ask Copilot to make another change. Because the session and worktree remain connected, you do not have to describe the task from the beginning.
Once you understand the proposed changes, edit any file directly in VS Code.
This is useful for adjustments that are faster or easier to make by hand, such as:
You are editing the session’s existing worktree, so your manual changes build directly on the agent’s work. You do not need to copy files between directories or manually re-create the branch.
Use the VS Code integrated terminal to run the project’s normal validation workflow. The exact commands depend on the repository, but some web app examples may include:
Treat agent-generated changes the same way you would treat code written by a person: run the relevant tests, inspect failures, and verify the behavior yourself.
If the development server prints a localhost URL, open it to test the change in a browser. When supported by your VS Code setup, you can open the URL in VS Code’s integrated browser and inspect the result without leaving the editor.
For a user-interface change, verify both the requested behavior and nearby states. For example, check the modified component at different viewport sizes and confirm that loading, empty, and error states still work.
At any point, you can choose the interaction that best fits the next step:
For example, after making a manual UI adjustment, you might ask Copilot:
Add a test for the updated label and run the relevant test file. Do not modify unrelated components.
Because you are still in the original session, Copilot retains the context needed to interpret “the updated label.”
When the implementation is ready, review the final diff one more time. Then commit and push the changes using the Source Control view or the integrated terminal:
Use your repository’s normal branch, commit, review, and approval practices. Because VS Code opened the worktree and branch associated with the session, pushing the branch updates the pull request already tracking that work.
There is no need to copy the finished files into another checkout or reconnect the work to the pull request manually.
Opening a Copilot app session in VS Code gives you a clean division of labor without splitting the work itself. Copilot can take on a larger or repetitive implementation, while you can move into the editor for detailed review, targeted changes, local testing, and final polish.
The session, diff, and worktree move with you. Start by directing the work in the Copilot app, switch to VS Code whenever you want hands-on control, and push the finished result through the same pull request workflow.
Ready to try it? Download the GitHub Copilot app, start a session, and open it in VS Code when you are ready to continue coding.
GitHub’s context-aware secret classifier improves detection quality, raises weighted acceptance by 11.5%, and reduces median scan execution time by 86%.
Learn how to add custom instructions and skills to your repository, use custom agents, and connect MCP servers like Playwright.
Developers aren’t becoming more careless; they’re being outpaced. The tools that let developers create more software should also take on more of the work of protecting it.