@myndboostersai/ai-history
v1.1.4
Published
Export your Cursor, Claude Code, Copilot Chat and Gemini history to Markdown + JSONL
Readme
AI History
Export your Cursor, Claude Code, GitHub Copilot Chat, and Gemini CLI history to Markdown + JSONL.
These tools have been quietly writing your chat history to disk for months. This pulls it back out — retroactively, from sessions that already happened — and normalizes all four into one format.
Read-only. It never modifies your editor's data.
Install & run
No clone, no build, no compiler:
npx @myndboostersai/ai-history listTo install it permanently:
npm i -g @myndboostersai/ai-history
ai-history listRequires Node 22.5+.
It uses Node's built-in SQLite, so there is no native build step — it installs in seconds with zero dependencies. Verified working even with
--ignore-scripts --omit=optional.On Node < 22.5 it falls back to the optional
better-sqlite3, which does need a C++ toolchain. Upgrading Node is easier.
Usage
1. See what history you have
ai-history listFound history for 26 project(s):
2442 turns /Users/you/code/payments-api
claude_code:2442
529 turns /Users/you/code/console-ui
copilot_chat:529 gemini:171
...Run this first — it tells you which projects have history before you export anything.
2. Export it
# Chats for the project you're standing in -> ./.history
cd ~/code/my-app && ai-history
# A specific project
ai-history --project ~/code/my-app
# Everything, anywhere
ai-history --all --out ~/all-chats
# One agent only
ai-history --project ~/code/my-app --agent cursor| Flag | Meaning |
|---|---|
| list | Show which projects have history (writes nothing) |
| --all | Every project, not just the current folder |
| --project <path> / -p | A specific folder |
| --out <dir> / -o | Where to write (default ./.history) |
| --agent <name> / -a | cursor | claude_code | copilot_chat | gemini. Repeatable. |
| --help / -h | Usage |
Output
.history/
cursor/2026-07-10_<session>.md # human-readable
cursor/2026-07-10_<session>.jsonl # machine-readable, full fidelity
claude_code/...
copilot_chat/...
gemini/...Each JSONL line is one turn:
{
"agent": "cursor",
"sessionId": "...",
"projectPath": "/Users/you/code/my-app",
"timestamp": "2026-07-10T10:00:00.000Z",
"role": "user",
"text": "Fix the login bug", // ONLY human prompts / assistant prose
"contextFiles": ["src/auth.ts"], // files attached at prompt time
"toolCalls": [...], // what the agent invoked
"toolResults": [...], // what came back — never mixed into `text`
"filesTouched": ["src/auth.ts"],
"model": "composer-2.5" // which model actually answered
}text is guaranteed free of tool output. A 1000-line file read can never masquerade as
something you typed — that lives in toolResults. So pulling out every real prompt you ever
wrote is one line:
cat .history/**/*.jsonl | jq -r 'select(.role=="user" and (.text|length>0)) | .text'Or see which models actually answered you, across every tool:
$ cat .history/**/*.jsonl | jq -r '.model' | sort | uniq -c | sort -rn
1352 gpt-5.3-codex
1346 claude-opus-4-8
890 gemini-3-flash-preview
540 claude-haiku-4.5
448 claude-sonnet-5
...The .md files truncate long tool output for readability; the .jsonl always has it whole.
Where it reads from
| Agent | Location |
|---|---|
| Claude Code | ~/.claude/projects/ (all platforms) |
| Gemini CLI | ~/.gemini/tmp/ (all platforms) |
| Cursor | macOS ~/Library/Application Support/Cursor/UserLinux ~/.config/Cursor/UserWindows %APPDATA%\Cursor\User |
| Copilot Chat | same as Cursor, with Code in place of Cursor |
Using Gemini or Claude as the model inside Cursor doesn't need a separate adapter — those
chats are stored by Cursor, so the Cursor adapter already captures them. The gemini agent
is the standalone Gemini CLI.
Status
All four adapters are validated against real data on Linux:
| Agent | Verified | |---|---| | Claude Code | ✅ 3,557 turns | | Copilot Chat | ✅ 2,867 turns | | Gemini CLI | ✅ 890 turns | | Cursor | ✅ 59 turns |
⚠️ macOS and Windows are not yet proven. The platform paths are unit-tested but have
never run on a real Mac or Windows machine. Every on-disk format in this project turned out
to differ from its documentation, so treat those platforms as unverified until someone
actually runs it. If you're on one, please try ai-history list and report back.
Not covered: Continue.dev, Cline/Roo, Aider, Windsurf.
Also a VS Code / Cursor extension
The same core powers an editor command. Build it and press F5, then run "AI History: Export Chat History" from the command palette. The CLI is usually easier — the extension exports everything it can find rather than scoping to a folder.
Docs
- RUNBOOK.md — install, usage, troubleshooting
- ARCHITECTURE.md — how each format is decoded, and why it was hard
Development
npm install
npm test # 86 tests
npm run typecheck
npm run build # CLI + VS Code extension