Claude Conversation Extractor: export Claude Code chats

Claude Conversation Extractor

A zero-dependency Python CLI that finds Claude Code logs in ~/.claude/projects, searches them and saves chats as Markdown, JSON or HTML

  • 691 ★ on the repository
  • Last commit
  • MIT
CLI

Extended access

Why this level

  • The tool reads all Claude Code logs on disk, and conversations can hold keys, paths and private code
  • The export writes files with that content to an ordinary folder: the `--detailed` mode adds terminal output and MCP server responses
All reasons and checks

zerosumquant/claude-conversation-extractor

Install

Works in

In your terminal, with SkillFoxx CLI

npx skillfoxx add cli/claude-conversation-extractor

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The tool reads all Claude Code logs on disk, and conversations can hold keys, paths and private code
  • The export writes files with that content to an ordinary folder: the `--detailed` mode adds terminal output and MCP server responses

This is third-party code. Review the repository files before installing.

What it does

Claude Code has no export button: conversations sit in `~/.claude/projects` as JSONL files in an undocumented format. Claude Conversation Extractor finds those files on its own and turns them into readable documents. The package installs from PyPI, is written in pure Python and runs on Windows, macOS and Linux. The `claude-extract` command lists conversations and exports chosen ones: by number (`--extract 1,3,5`), the most recent (`--recent 5`) or all at once (`--all`). The default format is Markdown, and the `--format` flag switches to `json` or `html`. The `--detailed` flag adds tool calls, MCP responses, system messages and terminal output to the export. The output folder is set with `--output`. The `claude-start` command opens an interactive menu with search as you type, `claude-search "query"` searches all conversations without the menu, and the old `claude-logs` name is kept for compatibility. Search is case-insensitive, shows match previews and offers to export the matching sessions right away.

Who it is for. For people who work in Claude Code every day and want to keep session history in plain files, search it for past decisions and share extracts with a team.

Good fit when

  • You want to back up every Claude Code conversation with a single `claude-extract --all` before they get deleted
  • You are looking for a solution Claude suggested last week and remember only a couple of words from the chat
  • You need an HTML export to view in a browser or JSON for your own analysis
  • Documentation or debugging needs a full transcript with tool calls and MCP responses, which `--detailed` gives
  • You want to put the logs into a separate folder with `--output`, for example a backups directory

Not a fit when

  • You need a full viewer with a spending chart and several agents: the tool works only with Claude Code logs
  • You need an export from the Claude cloud app on claude.ai: the tool reads local `~/.claude/projects` files
  • The logs hold secrets that must not land in plain files: decide where the results will live before exporting
  • You need support for the latest changes to the Claude Code log format: the repository has not been updated for a long time

Example request

claude-extract --recent 5 --format html --output ~/claude-backups

Limitations

The last commit in the repository dates from January 2026, so the Claude Code log format may have changed since. The tool parses undocumented JSONL files, and where the format differs some records may be missing from the export.

The tool reads local logs. The result goes by default into a `Claude logs` folder on the desktop, which the `--output` flag changes. Python 3.8 or newer is required, and on macOS and Linux it is convenient to install through pipx to avoid environment problems.

Export in several formats arrived in version 1.1.1. In detailed mode the export holds everything the agent saw: commands, terminal output and MCP server responses, including file contents.

How to disable. Remove the package with `pipx uninstall claude-conversation-extractor` or `pip uninstall claude-conversation-extractor`. Previously exported files stay in the output folder and are deleted by hand.

FAQ

How do I export Claude Code conversations to Markdown?

Install the package with `pipx install claude-conversation-extractor`, then run `claude-extract` and pick conversations from the list. `claude-extract --all` exports everything at once and `claude-extract --recent 5` takes the last five sessions.

Where does Claude Code store its logs?

In `~/.claude/projects` on macOS and Linux and in `%USERPROFILE%\.claude\projects` on Windows. These are JSONL files in an undocumented format, which the tool finds automatically.

How do I find an old conversation by a word?

Run `claude-search "error handling"` or open the menu with `claude-start` and choose search: results appear as you type. Search is case-insensitive and shows snippets around the match.

Which formats can a conversation be saved in?

Markdown by default, JSON for programmatic processing and HTML for viewing in a browser. The format is set with the `--format` flag, and the `--detailed` flag adds tool calls and system messages.

Does it need any dependencies?

No, the package is written in pure Python and needs version 3.8 or newer. Pipx is only for a convenient install without environment conflicts.

Discussion

No questions or reviews yet.

CLI tools

Claude Code History Viewer

claude-code-history-viewer

A desktop app for browsing, searching and analyzing conversation history from Claude Code, Codex CLI, Gemini CLI, Cursor, Cline, Aider and other agents

CLIExtended access2.3KRepository stars

A local web editor for Claude Code config: shows project sizes, deletes old chat histories and manages MCP servers

CLIExtended access267Repository stars

Local memory for Claude Code: a single binary indexes past conversations and injects relevant context into new sessions.

MCP serverBroad access230Repository stars

About a hundred skills for Claude Code: meetings, research, publishing, TDD, Telegram, email and personal analytics

PluginBroad access409Repository stars

cc-lens

Claude Code Lens (cc-lens)

Local Claude Code analytics: a dashboard of sessions, tokens, cost and projects from your ~/.claude data, no cloud

CLIExtended access599Repository stars

A Parrot plugin for Claude: the agent searches Mac meeting recordings, finds promises, drafts recap emails and preps for calls.

MCP serverExtended access125Repository stars

README in short

The description is built around one problem: Claude Code has no export and the logs sit in an undocumented format. Then come installation for three systems, command examples, export formats, search and file locations. Answers to common questions close it.

README badge

Report a problem

Foxx AIClaude Conversation Extractor: export Claude Code chats
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.