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>- Splitsconversations.jsoninto 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 unifiedsearch.jsonindex.claude-export stats <path>- Generates astats.jsonwith 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.jsoninto 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-exportattempts to gracefully extract as much data as possible using Pydantic'sextra="allow"behavior, but some new features might not be fully mapped. - Exporting extremely massive ZIP files directly into memory might be resource-intensive, though
orjsonis used for high-performance parsing.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad417e609e42778101c41a8fa4ae74a6f8715d8265a55f71810c2b909b1001c9
|
|
| MD5 |
3bf2e2219f90661493defe760cebae87
|
|
| BLAKE2b-256 |
084cf4229e9ce080b5e56401fd5987e4fd4d8a8964a37f39b98a9fdb926652d5
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
193361184dd7a8f17566ec95107461c70ce147d1d2c9b9edb6b37b2a69d05093
|
|
| MD5 |
af1ebf5e6b25b6df0b33a69e2d059e5c
|
|
| BLAKE2b-256 |
889c68ea4b5820a8589efa73b1e8c0c7307497d060a962df10fbc34c76e1e0de
|