| name | extract-transcripts |
| description | Extract readable transcripts from Claude Code and Codex CLI session JSONL files |
Extract Transcripts
Extracts readable markdown transcripts from Claude Code and Codex CLI session JSONL files.
Scripts
Claude Code Sessions
python3 ~/.claude/skills/extract-transcripts/extract_transcript.py <session.jsonl>
python3 ~/.claude/skills/extract-transcripts/extract_transcript.py <session.jsonl> --include-tools --include-thinking
python3 ~/.claude/skills/extract-transcripts/extract_transcript.py <directory> --all
python3 ~/.claude/skills/extract-transcripts/extract_transcript.py <session.jsonl> -o output.md
python3 ~/.claude/skills/extract-transcripts/extract_transcript.py <session.jsonl> --summary
python3 ~/.claude/skills/extract-transcripts/extract_transcript.py <directory> --all --skip-empty
Options:
--include-tools: Include tool calls and results
--include-thinking: Include Claude's thinking blocks
--all: Process all .jsonl files in directory
-o, --output: Output file path (default: stdout)
--summary: Only output brief summary
--skip-empty: Skip empty and warmup-only sessions
--min-messages N: Minimum messages for --skip-empty (default: 2)
Codex CLI Sessions
python3 ~/.claude/skills/extract-transcripts/extract_codex_transcript.py <session.jsonl>
python3 ~/.claude/skills/extract-transcripts/extract_codex_transcript.py ~/.codex/history.jsonl --history
Session File Locations
Claude Code
- Sessions:
~/.claude/projects/<project-path>/<session-id>.jsonl
Codex CLI
- Sessions:
~/.codex/sessions/<session_id>/rollout.jsonl
- History:
~/.codex/history.jsonl
DuckDB-Based Transcript Index
For querying across many sessions, use the DuckDB-based indexer:
python3 ~/.claude/skills/extract-transcripts/transcript_index.py index
python3 ~/.claude/skills/extract-transcripts/transcript_index.py index --full
python3 ~/.claude/skills/extract-transcripts/transcript_index.py index --limit 10
python3 ~/.claude/skills/extract-transcripts/transcript_index.py recent
python3 ~/.claude/skills/extract-transcripts/transcript_index.py recent --limit 20
python3 ~/.claude/skills/extract-transcripts/transcript_index.py recent --project myapp
python3 ~/.claude/skills/extract-transcripts/transcript_index.py recent --since 7d
python3 ~/.claude/skills/extract-transcripts/transcript_index.py search "error handling"
python3 ~/.claude/skills/extract-transcripts/transcript_index.py search "query" --cwd ~/myproject
python3 ~/.claude/skills/extract-transcripts/transcript_index.py show <file_path>
python3 ~/.claude/skills/extract-transcripts/transcript_index.py show <file_path> --summary
Requirements: DuckDB (pip install duckdb)
Database location: ~/.claude/transcript-index/sessions.duckdb
Output Format
Transcripts are formatted as markdown with:
- Session metadata (date, duration, model, working directory, git branch)
- User messages prefixed with
## User
- Assistant responses prefixed with
## Assistant
- Tool calls in code blocks (if --include-tools)
- Thinking in blockquotes (if --include-thinking)
- Tool usage summary for Codex sessions