Years of chats with your AI coding assistant can vanish overnight: this zero-dependency tool exports them all in one schema
What this project does
ai-data-extractor does one very practical, almost nobody-bothers-to-do-properly job: it pulls out your own locally stored chat history from a bunch of AI coding assistants and saves it into one tidy, normalized JSONL file. Put simply, tools like Claude Code, Cursor, Codex, Windsurf, and Gemini CLI each stash your conversations in their own obscure database or file somewhere on your machine, in wildly different formats. One day an app upgrades or wipes its local database and years of dialogue can vanish in a blink. This project helps you move your treasure out early — the output is equally good as a training set for fine-tuning, as material for personal productivity analytics, or simply as a backup before something gets cleared.
Why it is trending
I think it is riding a pain point that is getting more acute for everyone: the longer we use AI coding assistants, the more valuable our accumulated conversations become, yet the ownership and control of those records never really rested with us. Cursor, Windsurf, and Trae have never published their storage formats, and they change structure on a whim — Cursor alone has gone through at least three storage shapes. When people realize "the project context I taught the AI for half a year could disappear in one upgrade," an open-source utility that safely exports the records becomes an immediate need. On top of that, it just added parsers for Cline, Roo Code, and Aider — two of the most-used yet most-overlooked tools — which filled a coverage gap and lit up the community.
Technical highlights
The standout technical trait here is zero dependencies, pure standard library. The entire codebase uses only Python's standard library, runs on 3.9 and above, and installs no third-party packages — which means no environment fuss, no dependency conflicts, just download and python extract.py. It now supports ten sources: Claude Code (JSONL split per session), Codex CLI (rollout files), Cursor (SQLite state.vscdb), Windsurf (SQLite with undocumented schema handled heuristically), Trae, Continue, Gemini CLI, OpenCode, Cline and Roo Code, and Aider (a Markdown transcript per project directory).
It auto-detects the operating system and scans the usual data roots — macOS ~/Library/Application Support, Linux ~/.config and ~/.local/share, Windows %APPDATA% and %LOCALAPDATA% — so you never even tell it which OS you are on. Output is per-source, timestamped JSONL, and each record is normalized into a messages[] schema containing role, content, code context (file paths, selections), code diffs, tool calls and results, timestamps, session IDs, project paths, and model names. A handy --merge flag concatenates everything into a single all_conversations.jsonl.
There is engineering discipline too. Database reads use read-only mode (mode=ro), so a running editor never blocks extraction; every reader is wrapped in error handling, so a single corrupt or locked file yields a partial result and moves on rather than crashing the whole script. For undocumented formats like Windsurf and Trae, it scans chat-related keys with a generic heuristic and honestly labels it best-effort — if a future version changes shape, you adjust KEY_HINTS or send a PR.
Who it is for
It speaks to three groups. The first is people who want to fine-tune a model on their own conversations — the README ships a complete example using datasets.load_dataset to read the JSONL, filter assistant messages, and apply a chat template, ready to train. The second is people doing personal efficiency analytics, curious about their collaboration patterns, time distribution, and favorite tools. The third is the pure backup crowd, afraid an upgrade will wipe the local store and wanting to export first for safety. The precondition is that you are comfortable running a command line, and that you realize the exported data may mix in API keys, proprietary code, and personal paths — before sharing or training you should scan with detect-secrets.
Quick start
No dependencies required. First check Python: python --version (3.9+, 3.10+ recommended). Then run interactively with python extract.py, which pops up a numbered menu to pick which sources to extract from; or be lazy and run python extract.py --all to grab everything at once. You can also do python extract.py --sources cursor,claude_code,aider to target specific ones, or python extract.py --list to see what tools are installed without actually extracting anything. The repo also bundles a ./extract_all.sh shortcut.
Compared with competitors
Honestly, there is barely a "competitor" in this niche — official export features from the various AI coding tools are either absent or limited to a single vendor. The real differentiator is "all-in-one, across ten vendors, zero dependencies." Rather than you writing your own script to dig through Cursor's SQLite or Claude Code's JSONL, it wraps up all ten tools' storage locations, format differences, and fault tolerance, then unifies them into one schema. Compared with general data-migration tools that drag in a pile of dependencies, its pure-standard-library, double-click-and-run nature is extremely friendly to individual users. The only caveat is that for undocumented formats (Windsurf, Trae) it uses heuristic scanning and may miss data after a major version change — then you either tweak KEY_HINTS or wait for a community PR. For a 300-plus-star open-source utility, that is an honest trade-off.