Skip to main content

Convert Anthropic Claude exports into an organized local knowledge base.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_export-0.1.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_export-0.1.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file claude_export-0.1.0.tar.gz.

File metadata

  • Download URL: claude_export-0.1.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for claude_export-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad417e609e42778101c41a8fa4ae74a6f8715d8265a55f71810c2b909b1001c9
MD5 3bf2e2219f90661493defe760cebae87
BLAKE2b-256 084cf4229e9ce080b5e56401fd5987e4fd4d8a8964a37f39b98a9fdb926652d5

See more details on using hashes here.

File details

Details for the file claude_export-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: claude_export-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for claude_export-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 193361184dd7a8f17566ec95107461c70ce147d1d2c9b9edb6b37b2a69d05093
MD5 af1ebf5e6b25b6df0b33a69e2d059e5c
BLAKE2b-256 889c68ea4b5820a8589efa73b1e8c0c7307497d060a962df10fbc34c76e1e0de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page