claude-stitch
v0.1.2
Published
Stitch Claude Code session logs into DOCX, PDF, or Markdown documents with analytics
Maintainers
Readme
claude-stitch
Stitch Claude Code session logs into documents with analytics.
Discovers all your Claude Code sessions from ~/.claude/projects/, stitches them chronologically, and exports to DOCX, PDF, or Markdown -- with a terminal analytics dashboard showing tokens, cost, files modified, and tool usage.
Install
npm install -g claude-stitchUsage
# Interactive mode -- pick a project and export
claude-stitch
# List all discovered projects
claude-stitch list
# Export a specific project to Markdown
claude-stitch --path ~/.claude/projects/my-project --format md
# Export all formats at once
claude-stitch --path ~/.claude/projects/my-project --format all
# Show analytics dashboard only
claude-stitch dashboard --path ~/.claude/projects/my-project
# Compact export (user prompts + Claude text only, no tool calls)
claude-stitch --path ~/.claude/projects/my-project --format md --compact
# Filter messages by keyword
claude-stitch --path ~/.claude/projects/my-project --format md --grep "database"
# Filter by date range
claude-stitch --path ~/.claude/projects/my-project --since 2025-01-01 --until 2025-02-01
# Include full tool call inputs/outputs (not truncated)
claude-stitch --path ~/.claude/projects/my-project --format md --full
# Add AI-generated summary (requires @anthropic-ai/sdk + ANTHROPIC_API_KEY)
claude-stitch --path ~/.claude/projects/my-project --format docx --summarize
# Skip the terminal dashboard
claude-stitch --path ~/.claude/projects/my-project --format md --no-dashboard
# Custom output path
claude-stitch --path ~/.claude/projects/my-project --format docx -o report.docxCommands
| Command | Description |
|---------|-------------|
| claude-stitch | Interactive project picker + export |
| claude-stitch list | List all discovered Claude Code projects |
| claude-stitch dashboard | Show analytics dashboard for a project |
Options
| Flag | Description |
|------|-------------|
| -p, --path <path> | Path to a Claude project directory |
| -f, --format <fmt> | Output format: docx (default), pdf, md, all |
| -o, --output <path> | Custom output file path |
| --compact | User prompts + Claude text only |
| --full | Include full tool call inputs/outputs |
| --grep <keyword> | Filter messages containing keyword |
| --since <date> | Include sessions after date (YYYY-MM-DD) |
| --until <date> | Include sessions before date (YYYY-MM-DD) |
| --sessions <ids> | Export specific session IDs (comma-separated) |
| --summarize | AI summary (needs @anthropic-ai/sdk) |
| --no-dashboard | Skip terminal dashboard |
Dashboard
The terminal dashboard shows:
- Session count, message count, total duration
- Token breakdown with proportional bar charts (input, output, cache)
- Estimated cost based on model pricing
- Top modified files with edit counts
- Tool usage frequency
AI Summary (optional)
Install the Anthropic SDK and set your API key:
npm install @anthropic-ai/sdk
export ANTHROPIC_API_KEY=your-key
claude-stitch --path ~/.claude/projects/my-project --summarizeOutput Formats
- DOCX -- Cover page, overview table, session chapters with turn numbering, tool calls in monospace code blocks
- PDF -- A4 pages with word-wrapped content, page numbers, structured headings
- Markdown -- YAML metadata block, overview table, files modified table, session chapters with timestamps and token usage per turn
All formats include structured metadata for AI readability.
License
MIT
