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

Prerequisites

Make sure you have uv installed:

curl -LsSf https://astral.sh/uv/install.sh | sh

Global Installation

Clone and install globally:

git clone https://github.com/odysseus0/ccexport.git
cd ccexport
uv tool install .

Then use from anywhere:

ccexport

Development

Clone the repository:

git clone https://github.com/odysseus0/ccexport.git
cd ccexport

Run directly without installing:

# Using uv run (recommended)
uv run ccexport

# Or with arguments
uv run ccexport ~/projects/myapp -o session.md

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.0.tar.gz (9.8 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.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ccexport-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for ccexport-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1584b18c5662c50f363914da95f0ba1dc3ca19dd5d5b4e48e72feab84ea47ba1
MD5 ea1f819d57ab4eedc70d5d09d16ca463
BLAKE2b-256 bb3a495fa9cac0c8cd1d4ae848b4175e2b80f8512767db56c03a05e78bbdb0c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ccexport-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for ccexport-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5789e352671f0e5e2c3b918eefe589f21233367835afeb13ca998235ff956a6e
MD5 8dfbc7a363e42c920e52846eee10b37a
BLAKE2b-256 2ee9da41e0ea9680d4d7eb8b8a21e702e56297ab3fec00d0a8fce3a4c1b111d2

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