# simonw/claude-code-transcripts architecture

> Architecture diagram of the GitHub repository simonw/claude-code-transcripts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/simonw/claude-code-transcripts
- Repository: https://github.com/simonw/claude-code-transcripts

## Overview

claude-code-transcripts is a CLI for turning Claude Code sessions into browsable, paginated HTML transcripts and archives. Users select local sessions, import web sessions, convert JSON/JSONL files, or process all local sessions; the result can be opened locally or shared as a GitHub Gist. The central workflow parses session data, analyzes conversations, renders transcript and index pages, and offers browser-side search. The main implementation is concentrated in one Python module. Relationships for documented workflows are based on the README; the excerpts do not expose the full CLI wiring or rendering implementation.

Main entry points: [`src/claude_code_transcripts/__init__.py`](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py) (Command interface), [`src/claude_code_transcripts/templates/search.js`](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/search.js) (Transcript search), [`src/claude_code_transcripts/templates/page.html`](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/page.html) (Transcript templates), [`src/claude_code_transcripts/templates/master_index.html`](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/master_index.html) (Archive indexes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Session inputs"]
  node_cli["Command interface<br/>[__init__.py]"]
  node_local[("Local sessions<br/>[__init__.py]")]
  node_fileinput["JSON/JSONL input<br/>[__init__.py]"]
  node_websessions["Web sessions<br/>[__init__.py]"]
end

subgraph group_processing["Transcript processing"]
  node_sessionparser["Session parser<br/>[__init__.py]"]
  node_conversation["Conversation analysis<br/>[__init__.py]"]
  node_repoanalysis["Repository detection<br/>[__init__.py]"]
end

subgraph group_presentation["HTML experience"]
  node_renderer["Transcript renderer<br/>[__init__.py]"]
  node_transcripttemplates["Transcript templates<br/>[page.html]"]
  node_indexpages["Archive indexes<br/>[master_index.html]"]
  node_search["Transcript search<br/>[search.js]"]
end

subgraph group_delivery["Output and sharing"]
  node_htmloutput["HTML output<br/>[__init__.py]"]
end

node_user(("CLI user"))
node_claudeapi["Claude API"]
node_browser(("Web browser"))
node_gist["GitHub Gist"]
node_githubapi["GitHub API"]

node_user -->|"runs command"| node_cli
node_cli -->|"selects sessions"| node_local
node_cli -->|"converts file"| node_fileinput
node_cli -->|"imports session"| node_websessions
node_websessions -->|"fetches sessions"| node_claudeapi
node_cli -->|"converts input"| node_sessionparser
node_sessionparser -->|"analyzes messages"| node_conversation
node_sessionparser -->|"detects repository"| node_repoanalysis
node_cli -->|"builds archive"| node_conversation
node_cli -->|"generates HTML"| node_renderer
node_renderer -->|"renders pages"| node_transcripttemplates
node_renderer -->|"builds archive indexes"| node_indexpages
node_renderer -->|"writes pages"| node_htmloutput
node_htmloutput -->|"opens output"| node_browser
node_search -->|"fetches transcript pages"| node_htmloutput
node_cli -->|"uploads output"| node_gist
node_search -->|"looks up gist"| node_githubapi
node_gist -.->|"serves gist data"| node_githubapi

click node_cli "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"
click node_local "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"
click node_fileinput "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"
click node_websessions "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"
click node_sessionparser "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"
click node_conversation "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"
click node_repoanalysis "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"
click node_renderer "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"
click node_transcripttemplates "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/page.html"
click node_indexpages "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/master_index.html"
click node_search "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/search.js"
click node_htmloutput "https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_local,node_fileinput,node_websessions,node_user,node_browser toneBlue
class node_sessionparser,node_conversation,node_repoanalysis toneAmber
class node_renderer,node_transcripttemplates,node_indexpages,node_search,node_claudeapi,node_githubapi toneMint
class node_htmloutput toneRose
class node_gist toneIndigo
```

## Components

### Session inputs

- [Command interface](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`
- [Local sessions](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`
- [JSON/JSONL input](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`
- [Web sessions](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`

### Transcript processing

- [Session parser](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`
- [Conversation analysis](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`
- [Repository detection](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`

### HTML experience

- [Transcript renderer](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`
- [Transcript templates](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/page.html): `src/claude_code_transcripts/templates/page.html`
- [Archive indexes](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/master_index.html): `src/claude_code_transcripts/templates/master_index.html`
- [Transcript search](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/templates/search.js): `src/claude_code_transcripts/templates/search.js`

### Output and sharing

- [HTML output](https://github.com/simonw/claude-code-transcripts/blob/main/src/claude_code_transcripts/__init__.py): `src/claude_code_transcripts/__init__.py`

### Other components

- **CLI user**
- **Claude API**
- **Web browser**
- **GitHub Gist**
- **GitHub API**

## Connections

- CLI user → Command interface: runs command (evidence: `README.md`)
- Command interface → Local sessions: selects sessions (evidence: `README.md`)
- Command interface → JSON/JSONL input: converts file (evidence: `README.md`)
- Command interface → Web sessions: imports session (evidence: `README.md`)
- Web sessions → Claude API: fetches sessions (evidence: `README.md`)
- Command interface → Session parser: converts input (evidence: `README.md`)
- Session parser → Conversation analysis: analyzes messages (evidence: `src/claude_code_transcripts/__init__.py`)
- Session parser → Repository detection: detects repository (evidence: `src/claude_code_transcripts/__init__.py`)
- Command interface → Conversation analysis: builds archive (evidence: `README.md`)
- Command interface → Transcript renderer: generates HTML (evidence: `README.md`)
- Transcript renderer → Transcript templates: renders pages (evidence: `README.md`)
- Transcript renderer → Archive indexes: builds archive indexes (evidence: `README.md`)
- Transcript renderer → HTML output: writes pages (evidence: `README.md`)
- HTML output → Web browser: opens output (evidence: `README.md`)
- Transcript search → HTML output: fetches transcript pages (evidence: `src/claude_code_transcripts/templates/search.js`)
- Command interface → GitHub Gist: uploads output (evidence: `README.md`)
- Transcript search → GitHub API: looks up gist (evidence: `src/claude_code_transcripts/templates/search.js`)
- GitHub Gist → GitHub API: serves gist data
