Problem
When using claude-code-transcripts all with a large archive (17+ projects, 50+ sessions), regeneration takes a while even when only 1-2 sessions have changed. Every session's JSONL is re-parsed and every HTML file is regenerated.
Proposed Solution
Add incremental generation that skips sessions whose transcripts are already up-to-date (output HTML newer than source JSONL).
Suggested Implementation
-
Incremental mode (default for all): Before calling generate_html(), check if the output directory exists and its newest HTML file is newer than the source JSONL. If so, skip.
-
--force flag: Override incremental mode and regenerate everything (current behavior).
-
project command (optional): Regenerate transcripts for a single project directory, useful for quick updates:
claude-code-transcripts project ~/.claude/projects/-Users-me-myproject -o ./archive
-
index command (optional): Regenerate only the index files without re-parsing sessions:
claude-code-transcripts index -o ./archive
Use Case
I maintain a private transcript archive (all projects) and a public one (curated subset). Running update-transcripts daily means regenerating ~50 sessions when typically only 2-3 have changed. Incremental mode would reduce this significantly.
Implementation Notes
I've sketched out a patch (~100 lines) that adds:
_is_session_up_to_date() helper function
incremental=True parameter to generate_batch_html()
--force flag to all command
- Optional
project and index commands
Happy to submit a PR if this approach sounds reasonable. Just wanted to check if you'd welcome this feature and if the design makes sense before doing the work.
Problem
When using
claude-code-transcripts allwith a large archive (17+ projects, 50+ sessions), regeneration takes a while even when only 1-2 sessions have changed. Every session's JSONL is re-parsed and every HTML file is regenerated.Proposed Solution
Add incremental generation that skips sessions whose transcripts are already up-to-date (output HTML newer than source JSONL).
Suggested Implementation
Incremental mode (default for
all): Before callinggenerate_html(), check if the output directory exists and its newest HTML file is newer than the source JSONL. If so, skip.--forceflag: Override incremental mode and regenerate everything (current behavior).projectcommand (optional): Regenerate transcripts for a single project directory, useful for quick updates:claude-code-transcripts project ~/.claude/projects/-Users-me-myproject -o ./archiveindexcommand (optional): Regenerate only the index files without re-parsing sessions:Use Case
I maintain a private transcript archive (all projects) and a public one (curated subset). Running
update-transcriptsdaily means regenerating ~50 sessions when typically only 2-3 have changed. Incremental mode would reduce this significantly.Implementation Notes
I've sketched out a patch (~100 lines) that adds:
_is_session_up_to_date()helper functionincremental=Trueparameter togenerate_batch_html()--forceflag toallcommandprojectandindexcommandsHappy to submit a PR if this approach sounds reasonable. Just wanted to check if you'd welcome this feature and if the design makes sense before doing the work.