Skip to content

fastbs/claude-chat-extract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💬 Claude Chat Extract

Transform your Claude Code chat history into beautiful, shareable documentation

Extract and convert Claude Code chat history (.jsonl files) into clean Markdown or interactive HTML formats with syntax highlighting, search, and filtering.


✨ Features

🎨 Two Output Formats

  • Markdown - Clean, portable text format perfect for documentation
  • HTML - Interactive dark theme with syntax highlighting, search, and filters

🔍 Powerful Filtering

  • Date filters (today, week, month)
  • Full-text search in titles
  • Flexible selection (single, range, multiple)

Interactive UI

  • Arrow key navigation
  • Live preview and pagination
  • Batch conversion support

🛠️ Developer-Friendly

  • Preserves tool usage details
  • Structured content blocks
  • Timestamp tracking

📦 Installation

cd claude-chat-extract
npm install -g .

After installation, use either cce or claude-chat commands.

📂 Default Claude Code Chat Locations

Claude Code stores chat history in the following directories:

Windows:

%USERPROFILE%\.claude\projects
C:\Users\YourName\.claude\projects

macOS:

~/.claude/projects
/Users/YourName/.claude/projects

Linux:

~/.claude/projects
/home/username/.claude/projects

Each project folder contains .jsonl files with chat history.


🚀 Quick Start

Interactive Mode (Default)

Simply run the command to browse and convert chats interactively:

cce

Interactive CLI Interface

Convert All Chats

# Convert everything to Markdown
cce -a

# Convert to HTML
cce -a -f html

# Convert to both formats
cce -a -f both

Filter and Convert

# Today's chats only
cce -t -a

# Last week, HTML format
cce -w -a -f html

# Search for specific topics
cce -s "api" -a

# Combine filters
cce -t -s "bug" -a -f both

📖 Usage Guide

Command Line Options

Option Alias Description
-h --help Show help message
-a --all Convert all chats (non-interactive mode)
-f <format> --format Output format: md, html, or both (default: md)
-t --today Filter: only today's chats
-w --week Filter: last 7 days
-m --month Filter: last 30 days
-s <text> --search Filter: search in chat titles
-l --list List chats without converting
-n <num> --limit Limit number of results
[directory] - Specify custom directory to scan

Interactive Mode Commands

Command Description
/ Navigate through chats
Enter Convert selected chat
PgUp / PgDn Navigate pages
[number] Select single chat (e.g., 5)
[start-end] Select range (e.g., 1-10)
[n,m,k] Select multiple (e.g., 1,3,5)
[a]ll Convert all filtered chats
[f]ilter Change date filter
[s]earch Search in titles
[r]eset Clear all filters
[q]uit Exit program

📸 Output Examples

Markdown Format

Clean, portable format with emoji indicators for different message types:

Markdown Output Example

Features:

  • 👤 User messages
  • 🤖 Claude responses
  • 🔧 Tool usage blocks
  • 📋 Tool results
  • Metadata (timestamps, message counts)

HTML Format

Interactive, responsive HTML with dark theme:

HTML Output Example

Features:

  • 🎨 Beautiful dark theme UI
  • 🔍 Live search with highlighting
  • 🎯 Message type filters (User/Claude/System)
  • 📋 One-click copy buttons
  • 📱 Responsive mobile design
  • 🔽 Collapsible tool blocks
  • 💾 Self-contained single file

📁 Examples

Scan Specific Directory

cce C:\Users\YourName\.claude\projects

List Without Converting

# List all chats
cce -l

# List today's chats
cce -t -l

# List with search filter
cce -s "refactor" -l

Batch Processing

# Convert last week's chats to both formats
cce -w -a -f both

# Find and convert API-related chats
cce -s "api" -a -f html

# Limit to 10 most recent
cce -n 10 -a

🗂️ File Structure

claude-chat-extract/
├── index.js           # Main executable
├── package.json       # NPM package configuration
└── README.md          # This file

Input: .jsonl files from Claude Code chat history Output: .md and/or .html files in the same directory as source files


🎯 Use Cases

  • 📚 Documentation - Convert technical discussions into shareable docs
  • 🔄 Knowledge Base - Archive important conversations
  • 📊 Code Review - Export code-related chats for team review
  • 🎓 Learning - Save tutorial sessions for reference
  • 🔍 Analysis - Search through conversation history

🤝 Contributing

Found a bug or have a feature request? Feel free to open an issue or submit a pull request.


📄 License

MIT License - feel free to use this tool for personal or commercial projects.


🙏 Acknowledgments

Built for the Claude Code community to make chat history more accessible and shareable.

About

Extract and convert Claude Code chat history (.jsonl files) into clean Markdown or interactive HTML formats with syntax highlighting, search, and filtering.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors