Skip to main content

claude-export

Anthropic Claude exports can be difficult to browse. claude-export is a CLI tool that converts a raw Claude export (either a ZIP file or a folder) into a fully organized local knowledge base.

It handles conversation splitting, beautiful markdown generation, code block extraction, Claude Projects parsing, artifact recovery, and comprehensive stats generation.

Installation

Ensure you have Python 3.12 or newer installed.

Clone this repository and install it in editable mode:

git clone https://github.com/yourusername/claude-export.git
cd claude-export
pip install -e .

CLI Usage

The primary command is all, which generates the complete output structure.

# Process a ZIP file
claude-export all path/to/export.zip

# Process an extracted folder
claude-export all path/to/export_folder

# Specify a custom output directory (default is ./output)
claude-export all path/to/export.zip --output ./my_knowledge_base

Modular Commands

Each feature of claude-export can also be run independently if you only need specific data:

  • claude-export split <path> - Splits conversations.json into individual JSON files.
  • claude-export markdown <path> - Generates beautiful, readable Markdown files for each conversation.
  • claude-export projects <path> - Extracts Claude Projects and organizes related conversations.
  • claude-export artifacts <path> - Recovers large assistant outputs (like React components, SVG code, etc.).
  • claude-export code <path> - Extracts every fenced code block, sorted by language, with smart deduplication.
  • claude-export search <path> - Generates a unified search.json index.
  • claude-export stats <path> - Generates a stats.json with comprehensive usage metrics.

Directory Layout

The all command produces the following organized structure in the output directory:

output/
    conversations/        # One JSON file per conversation
    markdown/             # Beautiful, readable Markdown versions of conversations
    projects/             # Folders for each Claude Project, with associated conversations
    artifacts/            # Recovered <antArtifact> outputs
    code/                 # Extracted code blocks categorized by language (e.g., code/python/)
    index.json            # Basic list of all conversations
    search.json           # Unified search index
    stats.json            # Statistics about your usage
    manifest.json         # A manifest of all files generated during the export

Features

  • Conversation Splitter: Splits the monolithic conversations.json into individual, safely named JSON files.
  • Markdown Export: Renders complete conversations with metadata (UUID, Created/Updated times, Message count), keeping formatting intact.
  • Code Extraction: Extracts fenced code blocks, attempts to read filenames from comments, and prevents duplicate files using SHA256 hashes.
  • Artifact Recovery: Recovers <antArtifact> contents and saves them individually.
  • Projects Integration: Reads project JSON structures and groups conversations inside their respective project directories.
  • Cross-Platform: Works seamlessly across Linux, macOS, and Windows, using memory-efficient parsing for large files where practical.

Limitations

  • Tool use and tool results are preserved as formatted JSON or text within the Markdown files, but complex interactive elements cannot be perfectly reproduced locally.
  • Claude's export formats can change over time. If a new schema is introduced, claude-export attempts to gracefully extract as much data as possible using Pydantic's extra="allow" behavior, but some new features might not be fully mapped.
  • Exporting extremely massive ZIP files directly into memory might be resource-intensive, though orjson is used for high-performance parsing.

License

MIT License

Metadata

Release files for claude-export 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-export 0.1.0
File Size Uploaded
claude_export-0.1.0.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-export 0.1.0
File Interpreter ABI Platform
claude_export-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.0 kB

Release files / claude_export-0.1.0.tar.gz

Download URL claude_export-0.1.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ad417e609e42778101c41a8fa4ae74a6f8715d8265a55f71810c2b909b1001c9
BLAKE2b-256 checksum
How to use checksums
084cf4229e9ce080b5e56401fd5987e4fd4d8a8964a37f39b98a9fdb926652d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / claude_export-0.1.0-py3-none-any.whl

Download URL claude_export-0.1.0-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
193361184dd7a8f17566ec95107461c70ce147d1d2c9b9edb6b37b2a69d05093
BLAKE2b-256 checksum
How to use checksums
889c68ea4b5820a8589efa73b1e8c0c7307497d060a962df10fbc34c76e1e0de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page