This Java program was created because the GitHub Copilot plugin for IntelliJ does not provide an export functionality (as of the time of writing).
This project is a fork of the original Gist by nineninesevenfour (raw: URL), enhancing it with new features and improved usability.
It scans the configuration files stored by the GitHub Copilot plugin under ~/.config/github-copilot and tries to extract the contents, exporting each chat as a separate markdown file.
For detailed information about how Copilot stores its chat data and how this tool extracts it, see the DATA_STRUCTURE.md file (or DATA_STRUCTURE_cs.md for the Czech version).
- I do not take any warranty for damages caused by using this program. I tested it successfully multiple times, though.
- It might stop working at any time with updates of the GitHub Copilot plugin.
- It was tested for the GitHub Copilot IntelliJ plugin on Mac. It wasn't tested on Windows. Feel free to adapt it to your needs.
- The exported files will be written into a folder
chat-exportunder the current folder where the program is running. It creates three subfolders,basic,detailedandstyled, each containing markdown files namedYYYY-MM-DD_<Title_of_chat>.md. - Files edited during the chat are extracted and saved into the
chat-export/_assetsfolder, keeping both the original (pre-edit) and modified versions. The exported Markdown chats contain relative links to these local assets. - It will overwrite previously created files with the same name (this is intentional to be able to repeat the export multiple times); however, if by chance there are two or more equally named chats from the same date found in the same run, they will receive a sequential number in the end and NOT be overwritten.
- It detects chats of mode "Ask" and "Agent".
- It successfully extracts Thinking steps, Edited files (Working Set), Error messages, and Ratings (👍/👎).
- Empty chats are skipped.
- The user's chat message might not be 100% identical to the original due to some markdown reformatting.
- Chats of currently open workspaces cannot be exported because those configurations are locked. There will be an error logged, which you can ignore.
- Older chats will probably not have the model name or advanced steps in the output.
This project is a standard Maven project. You have multiple options to run it:
You can compile and run the application directly using Maven from the project root:
mvn compile exec:javaTo run the DiagnosticDump utility:
mvn compile exec:java -Dexec.mainClass="cz.lopin.copilotchatexport.DiagnosticDump"You can build a "fat jar" containing all dependencies and run it:
mvn clean packageThen run the generated JAR file:
java -jar target/copilot-chat-export-1.0.1-SNAPSHOT-executable.jarTo run the DiagnosticDump utility from the JAR:
java -cp target/copilot-chat-export-1.0.1-SNAPSHOT-executable.jar cz.lopin.copilotchatexport.DiagnosticDump- Open the project in your favorite IDE (like IntelliJ IDEA).
- Make sure all dependencies are downloaded by Maven.
- Navigate to the
cz.lopin.copilotchatexport.CopilotChatExportclass orcz.lopin.copilotchatexport.DiagnosticDumpclass. - Run the
mainmethod.
Note: The exported chats will be placed in the chat-export directory inside the folder where the program is executed.
The program now simultaneously generates three different versions of each chat:
chat-export/basic/...usingchat_template_basic.th- standard markdown, prompts and replies only.chat-export/detailed/...usingchat_template_detailes.th- standard markdown, with additional info like changed files, thinking sections, etc.chat-export/styled/...usingchat_template_styled.th- enhanced HTML/Markdown hybrid, optimized for dark mode with custom fonts, collapsible thinking steps, and distinct styling for code edits and errors.
Whether the styled template looks good will depend on the markdown viewer used (tested with IntelliJ and VSCode).
- User: nineninesevenfour
- Start: 2025-12-22 15:17:45
- End / Last Change: 2025-12-22 15:18:57
Request:
- Mode: Ask
Hello
Response:
Model: Claude Sonnet 4.5
References:
- ~/my-workspaces/workspace1/.gitignore
Steps:
- ✅ Collecting context
- ✅ Reading git information
- ✅ Analyzing problems and errors
- ✅ Reading runtime logs
- ✅ Generating response
Hello! How can I assist you with your code or any technical questions you might have?
Request:
Please give me a hello world Java main
Response:
Sure, here is a simple "Hello, World!" program in Java:
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }This program defines a class named
HelloWorld. Inside this class, there is a single methodmain. This method is the entry point for any Java application. TheSystem.out.println("Hello, World!");statement is used to print the string "Hello, World!" to the console.
End of Chat
- User: nineninesevenfour
- Start: 2025-12-22 15:17:45
- End / Last Change: 2025-12-22 15:18:57
Hello
Mode: Agent
Model: Claude 3.7 Sonnet
References:
~/my-workspaces/workspace1/.gitignoreSteps:
- ✅ Collecting context
- ✅ Analyzing workspace
Thinking:
The user is saying hello. I should greet them back and ask how I can help with their project.
Hello! How can I assist you with your code or any technical questions you might have?
Please fix the bug in Main.java
📝 Edited files:
I've fixed the bug in your
Main.javafile.
End of Chat
