Model or dataset
kruzovic7/ai-data-extractor avatar
kruzovic7/ai-data-extractor

AI Data Extractor: Pull Claude Code, Cursor and Aider Chat Histories Into One JSONL

Free open-source extractor for AI coding assistant chat histories. Supports Claude Code, Cursor, Windsurf, Aider, Cline/Roo Code, and more.

824 stars132 forksPythonMIT

At a glance

What is it?
A standard-library Python script that finds your own local chat history across ten AI coding assistants and normalizes it to a single JSONL schema. The Cursor, Windsurf and Trae paths are heuristic, and the README says so.
Who is it for?
Adopt it if you want a local backup of your own Claude Code, Codex CLI, Continue, Gemini CLI, OpenCode, Cline or Aider history and you are comfortable reading JSONL. Skip it if you need a stable schema for Cursor, Windsurf or Trae, because the README states those schemas are undocumented and have changed multiple times.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 6 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 16, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

Who AI Data Extractor Is For, and What It Refuses to Be

The README frames the scope narrowly: extract your own local chat history from AI coding assistants into a single, normalized JSONL format. Three named uses are fine-tuning, personal analytics, and backing up conversations before an app's local database gets cleared. That last one is the strongest argument for the tool. Cursor and similar editors keep state in SQLite files under app-data directories, and nothing in the README suggests those files are versioned or exported anywhere.

The audience is therefore an engineer with a local checkout who wants their own transcripts, not a team building a hosted service. There is no server, no account, no upload step, and no homepage listed on the repository. The extractors read files that already sit on your disk. If what you actually want is to turn PDFs or images into structured records, this is the wrong project; the name overlaps with a crowded category of document-parsing tools, and the README never mentions PDFs, OCR or image input.

How the Extractors Find and Normalize Ten Different Stores

The pipeline in the README has five steps. First, detect the OS and build a list of plausible data roots: Application Support, .config, .local/share, %APPDATA%, %LOCALAPPDATA%. Second, search each root for the tool's known folder name. Third, read the storage, which means JSONL line-by-line, SQLite over a read-only connection, or JSON trees depending on the tool. Fourth, normalize into a messages[] array. Fifth, write one conversation per JSONL line into extracted_data/.

The supported-source table is the real content here, because each row names a different storage shape. Claude Code is JSONL, one file per session, under ~/.claude/projects/**/*.jsonl. Codex CLI uses JSONL rollout files under ~/.codex/sessions/**/rollout-*.jsonl. Continue and Gemini CLI are JSON, one file per session or chat. OpenCode stores session, message and part trees under ~/.local/share/opencode/storage/. Cline and Roo Code keep one folder per task under the editor's globalStorage. Aider is the outlier: a markdown transcript at <project>/.aider.chat.history.md, with no central database at all. The README says Aider was included specifically to prove the toolkit generalizes beyond SQLite or JSONL in one app-data folder, which is a fair justification for the added code path.

Two design choices are worth calling out. SQLite is opened read-only, so a running editor does not block the extraction. And every reader is wrapped so that one corrupt or locked file produces a partial result rather than a stack trace. Partial success is the right default for a backup tool, but it also means a clean exit code does not prove that everything was captured.

Installing AI Data Extractor and Running a First Extraction

There is no package to install. The README states the script uses the standard library only, so cloning the repository and checking your Python version is the whole setup. Python 3.9 or newer is required, with 3.10 or newer recommended.

bash
python --version   # 3.9+ required, 3.10+ recommended

Before extracting anything, run the preview mode. The --list flag reports what was found for each source without writing files, which is the cheapest way to confirm the tool sees your editor's data directory at all.

bash
python extract.py --list

To extract everything without prompts, pass --all. To limit the run to specific tools, use --sources with the ids from the supported-source table. Adding --merge concatenates the per-source output into all_conversations.jsonl as well.

bash
python extract.py --all
python extract.py --sources cursor,claude_code,aider
python extract.py --all --merge

There is also a shell shorthand, ./extract_all.sh. Output lands in extracted_data/ with timestamped filenames such as claude_code_conversations_20260816_143022.jsonl, one file per source you extracted. Each line is one JSON conversation with a messages array, plus source and session_id, which the README says are the only fields you can always rely on. Aider needs extra help because it has no fixed app-data folder: pass --search-path with the directory where your projects live, and the flag is repeatable.

The Cursor, Windsurf and Trae Extractors Are Heuristics, Not Contracts

This is the limitation to weigh before adopting the tool for anything automated. The README states plainly that Cursor, Windsurf and Trae do not publish their storage schema and that it has changed multiple times. Cursor alone has gone through at least three shapes: workspace ItemTable chat, inline composer, and split bubbleId composer. The cursor.py extractor implements all three known shapes explicitly, which is more than most scrapers do, but it also means the extractor is chasing a target that moves without notice.

A schema change does not necessarily raise an error. It can silently yield fewer fields, or conversations that parse but lose their code context. The README already warns that not every tool records code_context, token usage or project_path, and that fields vary by source. Combine that with the wrapped readers that swallow per-file failures, and you get a tool whose output is trustworthy in shape but variable in completeness. If you plan to fine-tune on Cursor data, check the extracted lines for the fields you need before committing to a pipeline. The JSONL and markdown sources are on firmer ground, because those formats are files the tools themselves write to disk rather than internal databases.

One more boundary: the README describes extracting your own local history. Nothing in it suggests reading another machine's data, a cloud account, or a shared workspace, and the search locations are all user-scoped paths.

Where a Purpose-Built Parser Beats This Toolkit

If you only care about one assistant, a small script written against that assistant's own format is a reasonable alternative. Cline and Roo Code, for example, store raw Anthropic-format message arrays per task, and the README notes that the Cline extractor doubles as the simplest example of parsing that format. A fifty-line script in your own repository can read those arrays and emit whatever shape your pipeline wants, with no dependency on a third party's guess about folder layout.

The difference in approach matters more than the difference in output. AI Data Extractor normalizes ten sources into one messages[] schema, which is exactly what you want when you are aggregating across tools and exactly what you do not want when you need every field a single tool records. Normalization is lossy by design: the common schema keeps role, content, timestamps, code context and tool calls where present, and drops whatever does not fit. A single-source reader keeps everything. The trade-off is breadth against fidelity, and the README's own field-variance note is the honest signal that breadth won.

Licence, Maintenance and the Cost of Keeping Up

The repository is MIT-licensed, which permits commercial use, modification and redistribution provided the copyright notice and permission notice are retained. That is a permissive arrangement, and it is the same licence most of the tools being extracted from are not obliged to respect in return. None of this is legal advice; if you redistribute extracted transcripts, the licence on this code says nothing about the rights in the conversation content itself.

The last push was on 2026-09-11, five days before this writing, and the repository is not archived. The README marks Cline and Aider as new additions, which is consistent with a project still widening its source list rather than one in maintenance-only mode. There are no retrieved releases, so upgrades happen by pulling the default branch.

That is the real upgrade cost: because the Cursor, Windsurf and Trae schemas are undocumented and have already changed repeatedly, a pull can change extraction behaviour without a version number to pin against. Budget for re-running --list and spot-checking output after each pull, and keep the timestamped files from previous runs so you can diff them.

Editorial conclusion

Adopt it if you want a local backup of your own Claude Code, Codex CLI, Continue, Gemini CLI, OpenCode, Cline or Aider history and you are comfortable reading JSONL. Skip it if you need a stable schema for Cursor, Windsurf or Trae, because the README states those schemas are undocumented and have changed multiple times. Before relying on a run, execute python extract.py --list first, then diff two consecutive extractions of the same source to confirm the field set you actually get.

Frequently asked questions

Is there a free AI data extractor available?

Yes. AI Data Extractor is MIT-licensed and the README states it uses only the Python standard library, so there is nothing to buy and no dependency to install beyond Python 3.9 or newer.

Can AI do data extraction?

This project does not use a model to extract anything. It reads the local storage files that AI coding assistants already write, such as JSONL session files, SQLite databases and markdown transcripts, and normalizes them into one JSONL schema.

Which AI tool is best for data extraction?

The README does not rank the supported sources, and it notes that fields vary by tool: messages, source and session_id are the only ones you can always rely on. The JSONL and markdown sources (Claude Code, Codex CLI, Continue, Gemini CLI, OpenCode, Cline, Aider) rest on formats the tools write themselves, while Cursor, Windsurf and Trae rely on undocumented schemas the README calls heuristic.

Official sources

  1. Issues
  2. kruzovic7/ai-data-extractor on GitHub
  3. License: MIT
  4. README
Community notes

Community notes