Why VS Code Copilot Chat can quietly use 25 GB+ of disk
Copilot Chat sessions live in VS Code's workspaceStorage folder, one directory per workspace, and they're never cleaned up. How to measure them, find the project they belong to, and clear them without breaking VS Code.
5 min read
On one MacBook we scanned in October 2026, the biggest AI tool on disk wasn't a model runner or an agent CLI. It was GitHub Copilot Chat inside VS Code: 25.8 GB of saved chat sessions across 1,307 files. 89 sessions were over 100 MB each, the largest was 494 MB, and none had been opened in five months. Nothing in VS Code's interface tells you this is happening.
Where Copilot Chat stores sessions
VS Code gives every folder or workspace you open its own storage directory, named by an ID. Chat sessions are saved inside it:
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Code/User/workspaceStorage/<id>/chatSessions/ |
| Windows | %APPDATA%\Code\User\workspaceStorage\<id>\chatSessions\ |
| Linux | ~/.config/Code/User/workspaceStorage/<id>/chatSessions/ |
If you use VS Code Insiders, replace Code with Code - Insiders. Each session is a single .json or .jsonl file, depending on which VS Code version wrote it. Next to chatSessions/ you'll often find chatEditingSessions/ (snapshots from edit sessions), which also adds up.
Measure it
On macOS:
cd ~/Library/Application\ Support/Code/User/workspaceStorage
# Total across all workspaces
du -ch */chatSessions 2>/dev/null | tail -1
# Biggest workspaces, with the project folder each one belongs to
for d in */; do
[ -d "$d/chatSessions" ] || continue
printf '%s\t%s\n' "$(du -sh "$d/chatSessions" | cut -f1)" \
"$(tr -d '\n ' < "$d/workspace.json" 2>/dev/null)"
done | sort -h | tail -10Each workspace directory contains a small workspace.json holding the folder it belongs to, such as {"folder":"file:///Users/you/code/app"}, or a "workspace" entry for multi-root workspaces. That tells you which project a big pile of sessions came from.
Why you shouldn't just delete the files
The session files aren't the whole picture. In the VS Code builds we inspected, each workspace also has a SQLite database, state.vscdb, in the same directory. Its chat.ChatSessionStore.indexentry lists the sessions that exist. Delete the files and that index still points at them, so VS Code may show history entries that won't open. Editing state.vscdb while VS Code is running risks corrupting it.
The safe ways to reclaim space
- Start with orphaned workspaces. If a workspace's
workspace.jsonpoints at a folder that no longer exists, the whole<id>directory belongs to a project you've deleted or moved. Quit VS Code, then move those directories somewhere else, and delete them once you're sure. This is the lowest-risk cleanup. - Delete individual chats from VS Code itself.Where VS Code's chat history view offers a delete action, use it. That keeps the index and the files consistent.
- Back up before anything else. Long chats are often the only record of why code looks the way it does. Copy the
chatSessions/folders to encrypted storage before deleting anything; like most AI history, they're plaintext. - Never touch
state.vscdbwith VS Code running, and keep a copy of it (together with any-walor-shmfiles next to it) before changing anything.
The short version
- Copilot Chat sessions live in
workspaceStorage/<id>/chatSessions/, one directory per workspace, and they're never cleaned up automatically. workspace.jsontells you which project each directory belongs to.- An index in
state.vscdbreferences the files, so deleting files by hand can leave broken history entries. - Clean up orphaned workspaces first, with VS Code closed and a backup made.