How to delete a session in GitHub Copilot Chat in VS Code?

Deleting a session in GitHub Copilot Chat within Visual Studio Code is a straightforward process, but it requires understanding the specific interface and the conceptual model GitHub Copilot uses. The action is performed directly within the chat sidebar. To clear the current conversation thread, you must click the trash can icon, which is typically located in the chat header or near the input area. This action permanently removes the entire context and history of that specific chat session, resetting the AI's memory for that thread. It is important to note that this deletion is local and immediate; the session data is removed from your active instance of VS Code and is not synced across devices unless your settings specifically preserve chat history elsewhere. This function is essential for maintaining privacy when discussing sensitive code, starting a fresh debugging context, or simply managing clutter within the development environment.

The mechanism behind this deletion is tied to how GitHub Copilot Chat handles conversational context. Each chat session operates as an isolated thread where the model retains the message history to provide coherent, context-aware responses. Clicking the delete icon terminates that thread's persistent state in your local environment. Under the hood, this likely clears the session's data from a local storage index or cache that VS Code maintains for the extension. It does not, however, affect any previously provided code suggestions that have already been inserted into your editor windows, as those become part of your project files. Furthermore, this action is distinct from turning off the Copilot extension or logging out of your GitHub account; it is a granular control for individual conversation threads.

From a practical and security standpoint, regularly deleting sessions is a recommended practice for developers working with proprietary or confidential codebases. While GitHub states that it does not retain prompts and suggestions to train its models for enterprise users and generally respects privacy, manually clearing sessions ensures no residual conversation data remains in your local workspace, mitigating any risk of accidental exposure. For developers using Copilot across multiple projects, session deletion helps prevent context bleed, where information from one project might inadvertently influence suggestions in another when switching tasks. It is also the only way to force the model to forget prior instructions or complex problem statements when you wish to start a new, unrelated line of inquiry without historical baggage.

If the trash can icon is not visible, it may indicate an outdated version of the GitHub Copilot extension or VS Code itself, requiring an update to access the latest chat features. The functionality is consistently present in the standard Chat view provided by the official Copilot extension. There is no automated schedule or setting for session deletion; it remains a manual user action. For those seeking to manage data more broadly, reviewing GitHub Copilot's telemetry and privacy settings in VS Code's configuration is advisable, as session deletion only addresses the local chat history and not other usage data that might be collected.