ccexport
Export Claude Code (cc) chat history to markdown format. A minimal CLI tool that extracts conversation history from Claude Code's local storage.
Features
- Exports the most recent Claude Code session for any project
- Outputs clean markdown with only user/assistant messages
- Filters out tool calls, thinking blocks, and interrupted messages
- Handles special characters in directory names (underscores → dashes)
- No configuration needed - uses Claude's standard storage location (~/.claude)
Installation
uv tool install ccexport
Development
Clone the repository:
git clone https://github.com/odysseus0/ccexport.git
cd ccexport
Run directly without installing:
# Using uv run
uv run ccexport
# Format and lint
uv run --with ruff ruff check .
uv run --with ruff ruff format .
Usage
Export Claude Code chat sessions:
# Export latest session from current directory
ccexport
# Export from a specific directory
ccexport /path/to/project
# Export to custom filename
ccexport -o my_session.md
# Export from specific directory to custom filename
ccexport /path/to/project -o my_session.md
The tool will:
- Find your Claude Code sessions for the specified directory
- Select the most recently modified session
- Extract user and assistant messages (text only, skipping interrupted messages)
- Export to a markdown file with timestamp-based filename
Output Format
Messages are exported as simple markdown:
## User
Your question here
## Assistant
Claude's response here
## User
Follow-up question
## Assistant
Follow-up response
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ccexport-0.1.1.tar.gz
(10.0 kB
view details)
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 ccexport-0.1.1.tar.gz.
File metadata
- Download URL: ccexport-0.1.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
685f33f23a3a6e09be083d1c8f6375a180a227e598dfcd4128d00d09a4dca20c
|
|
| MD5 |
0247f5db467b819e04acc198f6bb7652
|
|
| BLAKE2b-256 |
e744e811f7a785df2e32345fd9ba92f3baeaadaa3c07bf417135cb506266edc6
|
File details
Details for the file ccexport-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ccexport-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2285b65da6107cd9f52f12621fd0513b1a65904826ac608765d8e7e789a51dfd
|
|
| MD5 |
c93ba4b59efe6b3d19c52dbea14c321f
|
|
| BLAKE2b-256 |
eabdb155ece52ddab9290d0b6fe673edaf0bf347cedbdbef9a65dcb95ff92ad5
|