@papercraneai/summarize-chat
v1.0.1
Published
CLI tool that creates and maintains an evolving summary of learnings from Claude Code conversations
Maintainers
Readme
@papercraneai/summarize-chat
CLI tool that creates and maintains an evolving summary of learnings from your Claude Code conversations.
Features
- Discovers conversations from
~/.claude/history.jsonl - Incrementally processes only new messages since last run
- Maintains a single evolving summary document (not per-session)
- Uses Claude (Haiku) to intelligently merge new learnings
- Keeps summary under a configurable size for context loading
- Tracks token usage and cost
Installation
npm install -g @papercraneai/summarize-chatPrerequisites: Requires Claude Code to be installed and authenticated.
Usage
# Basic usage - summarize recent conversations
summarize-chat run --since 24
# Specify a custom summary file
summarize-chat run --sync-summary ~/my-learnings.md --since 24
# Check status
summarize-chat statusOptions
summarize-chat run [options]
Options:
--in-summary <path> Read existing summary from this file
--out-summary <path> Write summary to this file
--sync-summary <path> Read and write to the same file
--staleness <hours> Hours before a session is considered stale (default: 2)
--since <hours> Only process sessions from the last X hours
--max-size <kb> Maximum summary size in KB (default: 50)
--full Re-summarize all sessions (ignore state)Default Paths
- Summary:
~/.claude/learning-summary/summary.md - State:
~/.claude/learning-summary/state.json
How It Works
- Discovery: Reads
~/.claude/history.jsonlto find conversation sessions - Filter: Skips sessions still active (within staleness window) and already processed
- Parse: Extracts user/assistant messages from session JSONL files
- Summarize: Sends existing summary + new messages to Claude with instructions to merge learnings while keeping under the size limit
- Update: Saves the updated summary and records processed sessions in state
Output
--- Results ---
Sessions processed: 2
Total messages summarized: 121
Summary size: 10.5KB
--- Token Usage ---
Model: claude-haiku-4-20250514
Input tokens: 15,297 (3 uncached, 0 cache read, 15,294 cache write)
Output tokens: 2,912
Cost: $0.0337License
MIT
