Skip to main content

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:

  1. Find your Claude Code sessions for the specified directory
  2. Select the most recently modified session
  3. Extract user and assistant messages (text only, skipping interrupted messages)
  4. 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

Metadata

Release files for ccexport 0.1.1

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

Source distribution (sdist)

Source distribution for ccexport 0.1.1
File Size Uploaded Provenance
ccexport-0.1.1.tar.gz 10.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ccexport 0.1.1
File Interpreter ABI Platform
ccexport-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / ccexport-0.1.1.tar.gz

Download URL ccexport-0.1.1.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
685f33f23a3a6e09be083d1c8f6375a180a227e598dfcd4128d00d09a4dca20c
BLAKE2b-256 checksum
How to use checksums
e744e811f7a785df2e32345fd9ba92f3baeaadaa3c07bf417135cb506266edc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / ccexport-0.1.1-py3-none-any.whl

Download URL ccexport-0.1.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2285b65da6107cd9f52f12621fd0513b1a65904826ac608765d8e7e789a51dfd
BLAKE2b-256 checksum
How to use checksums
eabdb155ece52ddab9290d0b6fe673edaf0bf347cedbdbef9a65dcb95ff92ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for ccexport 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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