Skip to content

Repository files navigation

chat-takeout-md

Convert local Claude and Gemini data exports into a portable Markdown archive, including images and documents that are present in the export. Processing is entirely offline.

Supported Exports

  • Claude data exports containing conversations.json
  • Gemini Apps activity exports from Google Takeout containing MyActivity.html, MeineAktivitäten.html or MeineAktivitaeten.html
  • Input as an extracted directory or a .zip archive

Claude conversations are exported one Markdown file per conversation. Google Takeout does not expose a reliable conversation ID for Gemini HTML activity exports, so Gemini is exported one Markdown file per activity entry.

Use Without Installing

npx chat-takeout-md ./takeout.zip --output ./chat-archive

You can also provide an already extracted directory:

npx chat-takeout-md ~/Downloads/Takeout --output ./chat-archive

The CLI scans the input recursively and detects both supported sources when they are present in the same Takeout folder.

Install Globally

npm install --global chat-takeout-md
chat-takeout-md ./takeout.zip --output ./chat-archive

Node.js 18 or newer is required. The package has no runtime dependencies.

Output

chat-archive/
  index.md
  manifest.json
  claude/
    *.md
  gemini/
    *.md
  assets/
    claude/
    gemini/

Images are embedded using relative Markdown links. Other located attachments such as PDF, DOCX or audio files are copied and linked. If a Claude export only contains attachment metadata or extracted text, the missing binary file is noted in the generated Markdown.

CLI Options

chat-takeout-md <export-directory-or-zip> [options]

-i, --input <path>      Export directory or ZIP archive
-o, --output <path>     Output directory (default: ./markdown-export)
    --claude <path>     Explicit Claude directory containing conversations.json
    --gemini <path>     Explicit Gemini directory containing activity HTML
    --no-assets         Do not copy located attachments into the output
    --dry-run           Detect export sources and item counts without writing
    --overwrite         Replace generated files in an existing output directory
-h, --help              Show help

Before writing personal archives, inspect what the converter detected:

npx chat-takeout-md ./takeout.zip --dry-run

Export Notes

For Claude, download your data export and point the CLI at the extracted folder or ZIP file that contains conversations.json.

For Gemini, Google Takeout stores chat content under My Activity / Gemini Apps. The HTML export contains locally supplied or generated assets when Google includes those files in the archive. Remote thumbnails are not downloaded by this tool.

Privacy

The CLI never calls an external service and does not upload chat content. Your source export and generated Markdown archive can contain sensitive data; keep them outside public repositories. The repository .gitignore excludes common export and output folders as an additional guardrail.

Development

npm test
npm pack --dry-run

Tests use small synthetic exports only and cover directory detection, ZIP input, local assets and dry-run behavior.

License

MIT

About

Convert Claude and Gemini data exports into portable Markdown archives with attachments.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages