Guide · 10 min

Get your Claude conversations out. Keep them yours.

Whether you use claude.ai in the browser or Claude Code in the terminal, your conversations should not be trapped in one vendor. Here is how to export them, back them up, and — if you want — make them searchable again.

Part 1 · claude.ai (web)

Export from the web interface.

  1. 1. Open your account settings

    Click your avatar (bottom-left), then Settings, then Data privacy.

  2. 2. Request an export

    Click Export data. You are asked to confirm; the export runs in background.

  3. 3. Download the archive

    You receive an email within minutes to a few hours with a signed download link. The archive is a ZIP of JSON files.

  4. 4. Store it safely

    Move the ZIP out of Downloads to your permanent backup location. Anthropic keeps the download link valid for a limited time.

Part 2 · Claude Code (CLI)

Copy the session directory.

  1. 1. Find the directory

    macOS/Linux: ~/.config/claude-code/. Windows: %APPDATA%\claude-code\.

  2. 2. Understand the format

    Sessions are stored as JSONL files (one JSON per line). Each file is a conversation with tool calls, edits and outputs.

  3. 3. Copy or version it

    tar -czf claude-code-backup.tgz ~/.config/claude-code/. Or add the directory to your regular backup.

  4. 4. Do not commit it to a public repo

    Sessions may contain paths and code snippets from private projects. Keep the backup outside git.

Part 3 · Make it useful

A backup you cannot search is just insurance.

Index it

Tools like Tramya read both the claude.ai export and the Claude Code JSONL sessions, classify them by project and make them searchable.

Move it to another agent

Once indexed, the context can be handed off to Codex, Cursor or Gemini — you are no longer locked in.

Automate it

A weekly cron that copies the Claude Code directory to a NAS or a cloud drive is often enough for solo devs.

Part 4 · Formats

Export Claude to Markdown (with YAML front-matter).

Why Markdown, not JSON

Claude’s native export is JSON: great for machines, painful to read. Most people searching for this want Markdown: one .md file per conversation, with YAML front-matter (title, date, model) that drops straight into Obsidian, Logseq or a Git notes repo.

Convert the export

Each conversation in the JSON export is an ordered list of messages. A short script walks them, writes a YAML front-matter block (title, created, model) and renders each turn as a Markdown heading plus body. The claude.ai export and the Claude Code JSONL sessions convert the same way.

Or skip the script

Tramya reads both sources directly, classifies them by project, and lets you search and re-open them, with no conversion step and no lock-in. The export stays your fallback; Tramya makes the history usable day to day.

Frequently asked questions

How do I export Claude chats to Markdown?

Claude’s own export is JSON. To get Markdown files (one per conversation, with YAML front-matter for title, date and model), convert the JSON with a short script, or use a tool that reads the export. Tramya reads the export and the Claude Code sessions directly and keeps them searchable without a conversion step.

Can I import my ChatGPT history into Claude?

Not directly inside Claude, but you can keep both in one place. Export your ChatGPT conversations, export your Claude history, and index them together in a local tool like Tramya so you can search and move context between agents regardless of where a conversation started.

Does Anthropic keep my history if I delete it locally?

For claude.ai, refer to Anthropic’s retention policy. For Claude Code, sessions are stored only on your machine; if you delete them locally, they are gone.

Can I import the export back into another tool?

The claude.ai export is JSON — any tool that understands the format (or that lets you write a small importer) can ingest it. Tramya has a native importer.

Is the Claude Code JSONL format documented?

Not officially and versioned. It is stable enough to parse but expect occasional shape changes across major Claude Code releases.

What about privacy?

The archive contains your prompts and Claude’s responses. Treat it like source code: no public repos, no shared storage without controls.