# nateherkai/claude-wrapped architecture

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

- Interactive diagram: https://gitdiagram.com/nateherkai/claude-wrapped
- Repository: https://github.com/nateherkai/claude-wrapped

## Overview

Claude Wrapped is a local year-in-review generator for Claude usage. The main flow starts with a Claude Code command or direct CLI run, scans local session history and optionally a Claude app export, combines yearly aggregates, and produces a browser-ready story page and share card. The README documents the story’s analytics, personality, soundtrack, and privacy-focused sharing; the source excerpts show the scanner, shared scoring helpers, export reader, and CLI orchestration. The template and skill are present in the tree but were not sampled, so their internal wiring is not asserted.

Main entry points: [`scripts/wrapped.mjs`](https://github.com/nateherkai/claude-wrapped/blob/main/scripts/wrapped.mjs) (Wrapped CLI), [`scripts/scan-worker.mjs`](https://github.com/nateherkai/claude-wrapped/blob/main/scripts/scan-worker.mjs) (Transcript scanner), [`scripts/chat-export.mjs`](https://github.com/nateherkai/claude-wrapped/blob/main/scripts/chat-export.mjs) (Chat export reader), [`assets/template.html`](https://github.com/nateherkai/claude-wrapped/blob/main/assets/template.html) (Story page template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and orchestration"]
  node_skill["Slash command skill<br/>[SKILL.md]"]
  node_runner["Wrapped CLI<br/>[wrapped.mjs]"]
end

subgraph group_ingest["History ingestion"]
  node_local_history[("Local session history")]
  node_worker["Transcript scanner<br/>[scan-worker.mjs]"]
  node_chat_export["Chat export reader<br/>[chat-export.mjs]"]
end

subgraph group_analysis["Aggregation and analysis"]
  node_shared["Scoring helpers<br/>[common.mjs]"]
  node_yearly_data[("Yearly aggregates")]
  node_story_metrics["Story metrics<br/>[wrapped.mjs]"]
end

subgraph group_experience["Story experience"]
  node_template["Story page template<br/>[template.html]"]
  node_story["Interactive story"]
  node_share_card["Share card<br/>[template.html]"]
end

node_user(("Claude Code user"))
node_browser(("Browser"))

node_user -->|"runs command"| node_skill
node_user -->|"runs directly"| node_runner
node_skill -.->|"starts workflow"| node_runner
node_runner -->|"scans history"| node_local_history
node_runner -->|"dispatches batches"| node_worker
node_local_history -.->|"provides transcripts"| node_worker
node_worker -->|"uses scoring"| node_shared
node_runner -->|"calls export reader"| node_chat_export
node_chat_export -->|"uses scoring"| node_shared
node_worker -->|"returns aggregates"| node_runner
node_chat_export -->|"returns aggregates"| node_runner
node_runner -->|"merges aggregates"| node_yearly_data
node_runner -->|"derives metrics"| node_story_metrics
node_story_metrics -.->|"populates page"| node_template
node_template -.->|"renders story"| node_story
node_template -.->|"renders card"| node_share_card
node_runner -->|"opens output"| node_browser
node_story -->|"opens in"| node_browser

click node_skill "https://github.com/nateherkai/claude-wrapped/blob/main/SKILL.md"
click node_runner "https://github.com/nateherkai/claude-wrapped/blob/main/scripts/wrapped.mjs"
click node_worker "https://github.com/nateherkai/claude-wrapped/blob/main/scripts/scan-worker.mjs"
click node_chat_export "https://github.com/nateherkai/claude-wrapped/blob/main/scripts/chat-export.mjs"
click node_shared "https://github.com/nateherkai/claude-wrapped/blob/main/scripts/common.mjs"
click node_story_metrics "https://github.com/nateherkai/claude-wrapped/blob/main/scripts/wrapped.mjs"
click node_template "https://github.com/nateherkai/claude-wrapped/blob/main/assets/template.html"
click node_share_card "https://github.com/nateherkai/claude-wrapped/blob/main/assets/template.html"

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_skill,node_runner,node_user,node_browser toneBlue
class node_local_history,node_worker,node_chat_export toneAmber
class node_shared,node_yearly_data,node_story_metrics toneMint
class node_template,node_story,node_share_card toneRose
```

## Components

### Entry and orchestration

- [Slash command skill](https://github.com/nateherkai/claude-wrapped/blob/main/SKILL.md): `SKILL.md`
- [Wrapped CLI](https://github.com/nateherkai/claude-wrapped/blob/main/scripts/wrapped.mjs): `scripts/wrapped.mjs`

### History ingestion

- **Local session history**
- [Transcript scanner](https://github.com/nateherkai/claude-wrapped/blob/main/scripts/scan-worker.mjs): `scripts/scan-worker.mjs`
- [Chat export reader](https://github.com/nateherkai/claude-wrapped/blob/main/scripts/chat-export.mjs): `scripts/chat-export.mjs`

### Aggregation and analysis

- [Scoring helpers](https://github.com/nateherkai/claude-wrapped/blob/main/scripts/common.mjs): `scripts/common.mjs`
- **Yearly aggregates**
- [Story metrics](https://github.com/nateherkai/claude-wrapped/blob/main/scripts/wrapped.mjs): `scripts/wrapped.mjs`

### Story experience

- [Story page template](https://github.com/nateherkai/claude-wrapped/blob/main/assets/template.html): `assets/template.html`
- **Interactive story**
- [Share card](https://github.com/nateherkai/claude-wrapped/blob/main/assets/template.html): `assets/template.html`

### Other components

- **Claude Code user**
- **Browser**

## Connections

- Claude Code user → Slash command skill: runs command (evidence: `README.md`)
- Claude Code user → Wrapped CLI: runs directly (evidence: `README.md`)
- Slash command skill → Wrapped CLI: starts workflow
- Wrapped CLI → Local session history: scans history (evidence: `README.md`)
- Wrapped CLI → Transcript scanner: dispatches batches (evidence: `scripts/wrapped.mjs`)
- Local session history → Transcript scanner: provides transcripts
- Transcript scanner → Scoring helpers: uses scoring (evidence: `scripts/scan-worker.mjs`)
- Wrapped CLI → Chat export reader: calls export reader (evidence: `scripts/wrapped.mjs`)
- Chat export reader → Scoring helpers: uses scoring (evidence: `scripts/chat-export.mjs`)
- Transcript scanner → Wrapped CLI: returns aggregates (evidence: `scripts/wrapped.mjs`)
- Chat export reader → Wrapped CLI: returns aggregates (evidence: `scripts/wrapped.mjs`)
- Wrapped CLI → Yearly aggregates: merges aggregates (evidence: `scripts/wrapped.mjs`)
- Wrapped CLI → Story metrics: derives metrics (evidence: `scripts/wrapped.mjs`)
- Story metrics → Story page template: populates page
- Story page template → Interactive story: renders story
- Story page template → Share card: renders card
- Wrapped CLI → Browser: opens output (evidence: `scripts/wrapped.mjs`)
- Interactive story → Browser: opens in (evidence: `README.md`)
