I ran into a slightly annoying problem recently: I deleted an old project directory first, and only later remembered that I had a useful Copilot Chat conversation inside that workspace. The code was not important anymore, but the chat had a few debugging notes that I wanted to keep.

At first it looked like the conversation was gone together with the folder. It was not. VS Code stores most workspace state under its own user data directory, so deleting the project folder does not immediately delete the chat session files.

Try the Chat History UI First

The easiest way is still inside VS Code.

Open the Chat view:

Then click the history button in the upper-right corner of the Chat panel. In some versions of VS Code, the same entry is under the ... menu as Show All Sessions.

In my case, the old session was no longer shown with the original project name. It appeared as an untitled or stale workspace entry, but the messages were still there. If you only need to copy one or two answers, this is usually enough.

Find the Workspace Storage Folder Manually

If the session does not show up in the UI, the next place to check is VS Code's workspaceStorage directory.

Common paths are:

Windows: %APPDATA%\Code\User\workspaceStorage\
macOS:   ~/Library/Application Support/Code/User/workspaceStorage/
Linux:   ~/.config/Code/User/workspaceStorage/

Each subdirectory is named with a hash, so the folder names are not useful by themselves. The trick is to open workspace.json inside each directory and check which workspace it belongs to.

For example, on macOS:

$ cd ~/Library/Application\ Support/Code/User/workspaceStorage
$ find . -name workspace.json -maxdepth 2
./5560a56aeb7d4f8b9c2a3d1e/workspace.json
./a23f0d8a1c9b4e55aa987001/workspace.json

Then inspect the file:

$ cat ./5560a56aeb7d4f8b9c2a3d1e/workspace.json
{"folder":"file:///Users/me/work/old-project"}

Once the folder matches the deleted project path, look for chat session files under that same storage directory. Depending on the VS Code and Copilot Chat version, the directory name may differ, but searching for JSON files containing a phrase from the conversation works well:

$ grep -R "the error message I remembered" .

The recovered files are just JSON. They are not as comfortable to read as the VS Code UI, but the user prompts and assistant replies are usually easy enough to recognize.

Export Important Sessions Next Time

For conversations that are worth keeping, I now export them before cleaning up a workspace.

Open the Command Palette:

Run:

Chat: Export Session...

This saves the current session as a JSON file. I usually put it next to the related notes or issue document, because workspace-local chat history is easy to forget when deleting an old project.

Notes

Deleting the workspace folder is not the same as clearing VS Code's user data, so there is a good chance the chat history still exists. However, if you have already cleaned VS Code storage, reinstalled VS Code, or used a system cleanup tool, the session may really be gone.

For a quick recovery, check the Chat history UI first. For a more stubborn case, inspect workspaceStorage and match the old path through workspace.json.