Where GitHub Copilot Stores Your Chat History
Copilot Chat is saved per workspace, in a directory named after a hash of your project's path. Here is the exact location, why renaming a folder makes the history vanish from the UI, and how to get it back.
Copilot Chat history is on your disk, in plain text, and easy to find once you know the rule: VS Code stores it per workspace, in a directory named after a hash of the project folder's path. That one detail explains almost every way people lose it.
On the machine this article was written on, VS Code is holding 66 workspace directories, 64 of which contain chat sessions, with the oldest session dating to February. Nothing in the editor surfaces that inventory, and nothing exports it.
The exact location
Chat sessions live under workspaceStorage, one directory per project, with a chatSessions folder inside:
# macOS
~/Library/Application Support/Code/User/workspaceStorage/<hash>/chatSessions/
# Windows
%APPDATA%\Code\User\workspaceStorage\<hash>\chatSessions\
# Linux
~/.config/Code/User/workspaceStorage/<hash>/chatSessions/Recent VS Code versions write each session as a .jsonl file — one JSON object per line — while older versions wrote a single .json per session. You will often see both, plus a sibling chatEditingSessions directory holding the file edits a chat proposed. If you use Insiders, VSCodium, Cursor or Windsurf, each has its own root with the same shape underneath: substitute Code - Insiders, VSCodium, Cursor or Windsurf for Code in the paths above.
To see what you have, count the sessions and find the oldest:
R="$HOME/Library/Application Support/Code/User/workspaceStorage"
# how many chat sessions are on this machine
find "$R" -path '*chatSessions/*' -type f | wc -l
# which project a workspace directory belongs to
cat "$R"/<hash>/workspace.jsonWhy the history disappears when nothing was deleted
The directory name is a hash derived from the workspace folder's URI — the path itself. VS Code computes it when you open a folder, and uses it to find that workspace's stored state, including chat.
Rename the folder, move the project, or open it through a different path, and VS Code computes a different hash. It opens a fresh workspace with no history — while the old sessions sit untouched under the old hash.
This is the single most common way Copilot chat history is 'lost', and it is worth internalising because the fix is trivial once you know the cause. The same mechanism produces several variants that look unrelated:
- Renaming or moving a project directory. New path, new hash, empty history.
- Opening the same project through a symlink, a different mount, or a different case on a case-insensitive filesystem — the URI differs, so the hash differs.
- Switching between a local folder and a dev container or remote, which addresses the workspace by a different URI scheme entirely. This has been reported as a VS Code issue: the sessions remain in the old workspaceStorage hash while the UI shows none.
- Saving a folder as a .code-workspace file after having used it as a plain folder. That is a different URI, and therefore a different history.
- Moving between editors. Copilot Chat in VS Code, Insiders and VSCodium each write under their own root — same extension, three separate histories.
How to get it back
If the chat panel is empty after a move or rename, the sessions are almost certainly still on disk. Find the directory that still points at the old path, then copy its sessions into the current workspace's directory:
R="$HOME/Library/Application Support/Code/User/workspaceStorage"
# 1. find the old workspace by the path it recorded
grep -l "old-project-name" "$R"/*/workspace.json
# 2. find the current one the same way
grep -l "new-project-name" "$R"/*/workspace.json
# 3. copy the sessions across (VS Code closed)
cp -R "$R/<old-hash>/chatSessions/." "$R/<new-hash>/chatSessions/"Close VS Code before copying, and copy rather than move until you have confirmed the history shows up — the old directory is your only copy. If grep finds nothing, the workspace.json may record the path differently than you expect (a file:// URI, a container path); grep for a distinctive fragment rather than the whole path.
How to back it up
There is no export in the product, so a backup means copying the directory. It is small — the sessions on this machine total well under a megabyte — so there is no reason not to:
SRC="$HOME/Library/Application Support/Code/User/workspaceStorage"
DEST="$HOME/Backups/copilot-chat-$(date +%Y-%m-%d)"
mkdir -p "$DEST"
rsync -a --include='*/' --include='chatSessions/***' --exclude='*' "$SRC/" "$DEST/"If you want the same answer for every AI tool on the machine rather than Copilot alone, promptwake doctor scans for AI coding history across tools and reports what each is holding and what is at risk. It runs through npx, needs no account, writes nothing and sends nothing anywhere.
Where the personal fix stops working
Copying a directory solves this for one developer on one machine. At team scale the same five problems appear as with every other tool: the files are on the laptop they were written on, nobody else can read them, the history is fragmented across as many directories as you have opened projects, it covers Copilot and nothing else, and a folder of JSONL on a personal machine is not evidence anyone can show to a customer or an auditor asking how a piece of code came to exist.
Copilot's per-workspace design makes the fragmentation worse than most. A developer working across eight repositories has eight separate histories that no single view unites, and a rename anywhere in that set quietly starts a ninth.
What to do this week
Back up workspaceStorage today; it is small and takes one command. Before you rename or move any project you have used Copilot Chat in, copy the chatSessions directory first — that is the moment the history is lost, and it is entirely preventable.
If the conclusion is that this record matters and should not be scattered across per-project directories on individual laptops, that is the problem PromptWake exists for: it captures the prompt, the response and the resulting diff from the AI tools your team already uses, keeps them locally by default, and on the paid tiers syncs them into one searchable timeline. Do the backup regardless — the next rename does not wait for a purchasing decision.
