Claude History banner
thejud thejud

Claude History

Code Quality community

Description

A command-line utility to extract and format conversation history from Claude Code session files

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude History

A command-line utility to extract and format conversation history from Claude Code session files.

Overview

Claude History parses JSONL session files stored by Claude Code and outputs a chronologically ordered markdown report of your conversations. You can view just user prompts or include assistant responses in a structured format.

Installation

  1. Clone or download the repository
  2. Make the script executable:
    chmod +x claude_history.py

Usage

Basic Commands

# Extract prompts from current directory project
python3 claude_history.py

# Extract prompts from specific project
python3 claude_history.py ~/my-project

# Include assistant responses
python3 claude_history.py --agent ~/my-project

# Output without timestamps (still chronologically sorted)
python3 claude_history.py --nodate ~/my-project

# Combine flags
python3 claude_history.py -a -N ~/my-project  # Agent responses without timestamps

Command Line Options

Option Short Description
--agent -a Include assistant responses in output
--nodate -N Print messages without timestamps
--help -h Show help message

Output Formats

User Prompts Only (Default)

# Claude Code Session History

Generated on: 2024-01-01 12:00:00

- 1. **2024-01-01 10:00:00** - Hello, can you help me with Python?
- 2. **2024-01-01 10:02:00** - How do I parse JSON files?
- 3. **2024-01-01 10:04:00** - What about error handling?

With Assistant Responses (`--agent`)

# Claude Code Session History

Generated on: 2024-01-01 12:00:00

## 1. **2024-01-01 10:00:00**
**Prompt:** Hello, can you help me with Python?

**Response:** I'd be happy to help you with Python! What specific task are you working on?

## 2. **2024-01-01 10:02:00**
**Prompt:** How do I parse JSON files?

**Response:** You can use Python's built-in json module. Here's how...

How It Works

Cla