Convert GitHub Copilot chat logs from VS Code into readable Markdown format. This tool parses the chat JSON export from VS Code and generates clean Markdown files showing the conversation history with proper formatting and navigation.
- ✅ Clean output: Filters out internal VS Code metadata while preserving conversation flow
- ✅ Preserves markdown formatting: Bold text, code blocks, lists, and headers render correctly
- ✅ Multiple requests: Handles complete chat sessions with multiple back-and-forth exchanges
- ✅ Table of Contents: Auto-generated index with clickable links to each request
- ✅ Navigation links: Each request includes ^ (index), < (previous), > (next) navigation
- ✅ Shows references: Displays attached files and settings in expandable sections
- ✅ Tool invocation details: Shows detailed tool operations with input/output in collapsible blocks
- ✅ Progress indicators: Includes progress messages like "✔️ Optimizing tool selection..."
- ✅ Response timing: Includes response time information for performance insights
- ✅ Model information: Shows which Copilot model was used for each response
- Python 3.6+
- No additional dependencies (uses only standard library)
First, you need to export your chat history from VS Code:
- Open the Command Palette (
Cmd+Shift+Pon macOS orCtrl+Shift+Pon Windows/Linux) - Type "Chat: Export Chat" and select it
- Choose where to save your chat export JSON file
- The file will contain your complete chat history in JSON format
python3 chat_to_markdown.py chat.json chat.mdOpen the generated Markdown file in any Markdown viewer or editor to see your formatted chat history.
The samples/ directory contains example files:
chat.json: Original chat export from VS Code (404KB conversation about a repo organizer project)chat.md: Output from the conversion script with proper formatting, references, and navigation
The generated Markdown includes:
# GitHub Copilot Chat Log
**Participant:** username
**Assistant:** GitHub Copilot
<a name="table-of-contents"></a>
## Table of Contents
- [Request 1](#request-1): Brief summary of user request...
- [Request 2](#request-2): Another request summary...
- [Request 3](#request-3): Third request summary...
---
<a name="request-1"></a>
## Request 1 [^](#table-of-contents) < [>](#request-2)
### User
[User's question or request]
### Assistant
<details>
<summary>Used 2 references</summary>
<p>☰ copilot-instructions.md<br>⚙️ github.copilot.chat.codeGeneration.instructions</p>
</details>
[AI response with proper **bold formatting** and code blocks]
<details>
<summary>Ran Get file contents</summary>
<p>Completed with input: {
"filePath": "/path/to/file.md",
"startLine": 1,
"endLine": 50
}</p>
</details>
✔️ Optimizing tool selection...
[Continued AI response...]
*Response time: 45.32 seconds*
---
<a name="request-2"></a>
## Request 2 [^](#table-of-contents) [<](#request-1) [>](#request-3)
[Next exchange...]-
Invalid JSON: Ensure the exported chat file is valid JSON
python3 -c "import json; json.load(open('chat.json'))" -
Python errors: Run with error output for debugging
python3 chat_to_markdown.py chat.json chat.md 2>&1 -
Empty output: Check if the input JSON has the expected VS Code chat structure
-
File not found: Verify file paths are correct and files exist
Feel free to submit issues or pull requests to improve the scripts or add new features.
When filing an issue or creating a pull request, please include:
- A sample
chat.jsonfile that demonstrates the problem or use case- Redact any secrets or other private information before submitting
- The expected vs. actual output behavior
- Steps to reproduce the issue
This helps with debugging and ensures fixes work correctly across different chat formats.
This project is licensed under the MIT License, which allows free use, modification, and distribution - see the LICENSE file for details.