Skip to content

Instantly share code, notes, and snippets.

@derekantrican
derekantrican / restore_vscode_chat_sessions.py
Created February 27, 2026 06:40
Restores GitHub Copilot Chat sessions in VS Code on a new computer
#!/usr/bin/env python3
"""
VS Code Copilot Chat Session Restoration Script
================================================
When you copy your VS Code data (%APPDATA%/Code or ~/.config/Code) to a new
machine, Copilot chat sessions may not appear because VS Code's workspace
storage hash includes the folder's creation time (birthtime). When folders are
copied, their birthtime changes, producing a different hash — so VS Code creates
a fresh, empty workspace storage instead of finding the old one with your chats.