Chat Sav-your
Chat Sav-your is a VS Code extension that exports workspace-linked Copilot Chat history from persisted workspace storage instead of relying on whatever chat is currently active in the UI.
Current release track: preview (0.1.x).
Why this exists
Many chat export tools only work when a chat is currently open and detectable through the active UI state. This extension takes a different route:
- it finds the current workspace's storage area
- reads persisted
chatSessions data for that workspace
- reads persisted
GitHub.copilot-chat/transcripts event logs when available
- exports all attached chats in a structured JSON format
- also generates readable Markdown transcripts
If the chat is attached to the workspace and persisted locally, this extension aims to export it.
Current behavior
Use either:
- the status bar button:
Export Chat
Chat Sav-your: Export Workspace Chats
The button and command will:
- inspect the current workspace storage
- find all available chat session files for that workspace
- prompt for an export folder every time, defaulting to the last folder you chose for that workspace when available
- generate:
- one or more
.json exports per chat session when very large sessions need to be split into parts
- one or more
.md readable transcripts per chat session when very large sessions need to be split into parts
- copied raw
.jsonl source files for each session inside a raw/ folder
- an
index.json manifest summarizing the export
Each exported session includes:
- session metadata
- copied raw persisted source files for the session
- normalized user / assistant messages when they can be derived
- source file locations used to build the export
Settings
This extension currently exposes one release-relevant setting:
chatSavYour.maxExportChunkCharacters
Use it to control how large each generated Markdown / JSON export part can become before the exporter splits the session into numbered files.
- default:
4000000
- minimum:
250000
- maximum:
20000000
The raw copied .jsonl source files are always saved whole.
Very large sessions may be split into multiple numbered parts to avoid export failures caused by oversized in-memory strings.
You can reduce how often files split by increasing the setting chatSavYour.maxExportChunkCharacters in VS Code Settings. The default is 4,000,000, and the allowed range is 250,000 to 20,000,000.
When a session is split, the files use numbered suffixes like -1, -2, -3, and each split Markdown file ends with a sequence section that tells an AI which file came before and which file comes next.
Notes and limitations
- this approach is designed for desktop VS Code with local persisted storage
- it uses workspace-attached persisted data rather than undocumented UI state
- the export command and its dialogs are cross-platform because they use standard VS Code APIs and the workspace storage location provided by VS Code
- there are no hard-coded macOS paths in the runtime export flow; path handling uses Node's
path utilities and VS Code workspace context
- if transcript files are unavailable, the exporter falls back to the session payload
- if a future Copilot update changes storage shape, the exporter may need small parser updates
Privacy / data handling
- the extension reads persisted local workspace chat data from VS Code storage for the currently opened workspace
- export output is written only to the folder you choose
- the extension does not require a cloud service to perform the export itself
Packaging and release
For a local distributable build:
This will:
- compile the extension
- lint the source
- run the tests
- package a
.vsix
The generated .vsix can be installed directly in VS Code.
For Marketplace publishing, additional metadata is still recommended and the publisher field must be changed from local to your real Marketplace publisher ID.
Development
Install dependencies and build:
npm install
npm run compile
npm run lint
npm test
npm run release:vsix
Run the extension in an Extension Development Host using the Run Extension launch configuration.