Skip to main content

Export Claude Code chat history to markdown

Project description

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

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

ccexport-0.1.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

ccexport-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for ccexport-0.1.1.tar.gz
Algorithm Hash digest
SHA256 685f33f23a3a6e09be083d1c8f6375a180a227e598dfcd4128d00d09a4dca20c
MD5 0247f5db467b819e04acc198f6bb7652
BLAKE2b-256 e744e811f7a785df2e32345fd9ba92f3baeaadaa3c07bf417135cb506266edc6

See more details on using hashes here.

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

Hashes for ccexport-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2285b65da6107cd9f52f12621fd0513b1a65904826ac608765d8e7e789a51dfd
MD5 c93ba4b59efe6b3d19c52dbea14c321f
BLAKE2b-256 eabdb155ece52ddab9290d0b6fe673edaf0bf347cedbdbef9a65dcb95ff92ad5

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