# amargoyal/notchlight architecture

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

- Interactive diagram: https://gitdiagram.com/amargoyal/notchlight
- Repository: https://github.com/amargoyal/notchlight

## Overview

Notchlight is a macOS notch companion whose central workflow is collecting Claude Code and Codex activity, turning it into session status, and presenting that status in an interactive island. The README also describes music, file tray, clipboard, calendar, HUD, customization, and update features. Several feature implementations are unsampled; those are represented as components without speculative call chains. Edges use README statements or source-index/import evidence where available.

Main entry points: [`src/main/index.ts`](https://github.com/amargoyal/notchlight/blob/main/src/main/index.ts) (Electron app runtime), [`src/main/agentCoordinator.ts`](https://github.com/amargoyal/notchlight/blob/main/src/main/agentCoordinator.ts) (Agent coordinator), [`src/main/store.ts`](https://github.com/amargoyal/notchlight/blob/main/src/main/store.ts) (Claude session state), [`src/renderer/LiveCompanion.tsx`](https://github.com/amargoyal/notchlight/blob/main/src/renderer/LiveCompanion.tsx) (Live island)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agents["Agent activity"]
  node_agentcoord["Agent coordinator"]
  node_claudestore["Claude session state<br/>[store.ts]"]
  node_transcripts["Transcript reader<br/>[transcripts.ts]"]
  node_hooks["Claude hook server<br/>[hookServer.ts]"]
  node_codexactivity["Codex activity<br/>[codex.ts]"]
  node_approvals["Codex approvals<br/>[codexApprovals.ts]"]
  node_hooksinstaller["Hook installation"]
end

subgraph group_companion["Companion features"]
  node_spotifyfeature["Music controls<br/>[spotify.ts]"]
  node_tray["File tray<br/>[clipboardStore.ts]"]
  node_clipboard["Clipboard history<br/>[clipboardStore.ts]"]
  node_calendar["Calendar face<br/>[calendar.ts]"]
  node_hud["System HUD<br/>[hud.ts]"]
end

subgraph group_app["App and settings"]
  node_main["Electron app runtime<br/>[index.ts]"]
  node_config[("App configuration<br/>[config.ts]")]
  node_preferences[("Companion preferences<br/>[companionStore.ts]")]
  node_preload["Renderer bridge<br/>[index.ts]"]
  node_updates["Release updates<br/>[updates.ts]"]
end

subgraph group_interface["Island interface"]
  node_liveui["Live island<br/>[LiveCompanion.tsx]"]
  node_islandview["Island views<br/>[IslandView.tsx]"]
  node_buddy["Status buddy<br/>[Buddy.tsx]"]
  node_customize["Customization<br/>[customize.tsx]"]
  node_preview["Feature preview<br/>[Preview.tsx]"]
end

node_user(("Mac user"))
node_claude(("Claude Code"))
node_codex(("Codex"))
node_spotify(("Spotify"))
node_macos(("macOS services"))

node_user -->|"launches"| node_main
node_claude -.->|"sends events"| node_hooks
node_hooks -->|"updates phases"| node_claudestore
node_transcripts -->|"supplies session facts"| node_claudestore
node_codex -.->|"reports activity"| node_codexactivity
node_codexactivity -->|"provides sessions"| node_agentcoord
node_claudestore -->|"provides sessions"| node_agentcoord
node_agentcoord -.->|"publishes snapshot"| node_main
node_main -.->|"sends state"| node_liveui
node_preload -->|"exposes bridge"| node_liveui
node_liveui -->|"renders"| node_islandview
node_islandview -->|"renders"| node_buddy
node_user -->|"chooses appearance"| node_customize
node_customize -->|"previews changes"| node_preview
node_main -->|"reads and writes"| node_config
node_main -->|"uses companion state"| node_preferences
node_user -->|"controls music"| node_spotifyfeature
node_spotify -.->|"provides playback"| node_spotifyfeature
node_main -.->|"coordinates"| node_spotifyfeature
node_user -->|"manages files"| node_tray
node_user -->|"views history"| node_clipboard
node_user -->|"views today"| node_calendar
node_user -->|"uses controls"| node_hud
node_macos -.->|"provides events"| node_calendar
node_macos -.->|"provides system state"| node_hud
node_main -->|"initializes"| node_tray
node_main -.->|"checks releases"| node_updates
node_user -->|"installs hooks"| node_hooksinstaller
node_hooksinstaller -.->|"configures hooks"| node_codex
node_user -.->|"answers requests"| node_approvals

click node_main "https://github.com/amargoyal/notchlight/blob/main/src/main/index.ts"
click node_config "https://github.com/amargoyal/notchlight/blob/main/src/main/config.ts"
click node_preferences "https://github.com/amargoyal/notchlight/blob/main/src/main/companionStore.ts"
click node_preload "https://github.com/amargoyal/notchlight/blob/main/src/preload/index.ts"
click node_agentcoord "https://github.com/amargoyal/notchlight/blob/main/src/main/agentCoordinator.ts"
click node_claudestore "https://github.com/amargoyal/notchlight/blob/main/src/main/store.ts"
click node_transcripts "https://github.com/amargoyal/notchlight/blob/main/src/main/transcripts.ts"
click node_hooks "https://github.com/amargoyal/notchlight/blob/main/src/main/hookServer.ts"
click node_codexactivity "https://github.com/amargoyal/notchlight/blob/main/src/main/codex.ts"
click node_approvals "https://github.com/amargoyal/notchlight/blob/main/src/main/codexApprovals.ts"
click node_hooksinstaller "https://github.com/amargoyal/notchlight/blob/main/bin/install-codex-hooks.mjs"
click node_liveui "https://github.com/amargoyal/notchlight/blob/main/src/renderer/LiveCompanion.tsx"
click node_islandview "https://github.com/amargoyal/notchlight/blob/main/src/renderer/IslandView.tsx"
click node_buddy "https://github.com/amargoyal/notchlight/blob/main/src/renderer/Buddy.tsx"
click node_customize "https://github.com/amargoyal/notchlight/blob/main/src/renderer/customize.tsx"
click node_preview "https://github.com/amargoyal/notchlight/blob/main/src/renderer/Preview.tsx"
click node_spotifyfeature "https://github.com/amargoyal/notchlight/blob/main/src/main/spotify.ts"
click node_tray "https://github.com/amargoyal/notchlight/blob/main/src/main/clipboardStore.ts"
click node_clipboard "https://github.com/amargoyal/notchlight/blob/main/src/main/clipboardStore.ts"
click node_calendar "https://github.com/amargoyal/notchlight/blob/main/src/main/calendar.ts"
click node_hud "https://github.com/amargoyal/notchlight/blob/main/src/main/hud.ts"
click node_updates "https://github.com/amargoyal/notchlight/blob/main/src/main/updates.ts"

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_agentcoord,node_claudestore,node_transcripts,node_hooks,node_codexactivity,node_approvals,node_hooksinstaller,node_user toneBlue
class node_spotifyfeature,node_tray,node_clipboard,node_calendar,node_hud toneAmber
class node_main,node_config,node_preferences,node_preload,node_updates toneMint
class node_liveui,node_islandview,node_buddy,node_customize,node_preview toneRose
class node_claude,node_codex,node_spotify,node_macos toneIndigo
```

## Components

### Agent activity

- [Agent coordinator](https://github.com/amargoyal/notchlight/blob/main/src/main/agentCoordinator.ts): `src/main/agentCoordinator.ts`
- [Claude session state](https://github.com/amargoyal/notchlight/blob/main/src/main/store.ts): `src/main/store.ts`
- [Transcript reader](https://github.com/amargoyal/notchlight/blob/main/src/main/transcripts.ts): `src/main/transcripts.ts`
- [Claude hook server](https://github.com/amargoyal/notchlight/blob/main/src/main/hookServer.ts): `src/main/hookServer.ts`
- [Codex activity](https://github.com/amargoyal/notchlight/blob/main/src/main/codex.ts): `src/main/codex.ts`
- [Codex approvals](https://github.com/amargoyal/notchlight/blob/main/src/main/codexApprovals.ts): `src/main/codexApprovals.ts`
- [Hook installation](https://github.com/amargoyal/notchlight/blob/main/bin/install-codex-hooks.mjs): `bin/install-codex-hooks.mjs`

### Companion features

- [Music controls](https://github.com/amargoyal/notchlight/blob/main/src/main/spotify.ts): `src/main/spotify.ts`
- [File tray](https://github.com/amargoyal/notchlight/blob/main/src/main/clipboardStore.ts): `src/main/clipboardStore.ts`
- [Clipboard history](https://github.com/amargoyal/notchlight/blob/main/src/main/clipboardStore.ts): `src/main/clipboardStore.ts`
- [Calendar face](https://github.com/amargoyal/notchlight/blob/main/src/main/calendar.ts): `src/main/calendar.ts`
- [System HUD](https://github.com/amargoyal/notchlight/blob/main/src/main/hud.ts): `src/main/hud.ts`

### App and settings

- [Electron app runtime](https://github.com/amargoyal/notchlight/blob/main/src/main/index.ts): `src/main/index.ts`
- [App configuration](https://github.com/amargoyal/notchlight/blob/main/src/main/config.ts): `src/main/config.ts`
- [Companion preferences](https://github.com/amargoyal/notchlight/blob/main/src/main/companionStore.ts): `src/main/companionStore.ts`
- [Renderer bridge](https://github.com/amargoyal/notchlight/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [Release updates](https://github.com/amargoyal/notchlight/blob/main/src/main/updates.ts): `src/main/updates.ts`

### Island interface

- [Live island](https://github.com/amargoyal/notchlight/blob/main/src/renderer/LiveCompanion.tsx): `src/renderer/LiveCompanion.tsx`
- [Island views](https://github.com/amargoyal/notchlight/blob/main/src/renderer/IslandView.tsx): `src/renderer/IslandView.tsx`
- [Status buddy](https://github.com/amargoyal/notchlight/blob/main/src/renderer/Buddy.tsx): `src/renderer/Buddy.tsx`
- [Customization](https://github.com/amargoyal/notchlight/blob/main/src/renderer/customize.tsx): `src/renderer/customize.tsx`
- [Feature preview](https://github.com/amargoyal/notchlight/blob/main/src/renderer/Preview.tsx): `src/renderer/Preview.tsx`

### Other components

- **Mac user**
- **Claude Code**
- **Codex**
- **Spotify**
- **macOS services**

## Connections

- Mac user → Electron app runtime: launches (evidence: `README.md`)
- Claude Code → Claude hook server: sends events (evidence: `README.md`)
- Claude hook server → Claude session state: updates phases (evidence: `src/main/store.ts`)
- Transcript reader → Claude session state: supplies session facts (evidence: `src/main/store.ts`)
- Codex → Codex activity: reports activity (evidence: `README.md`)
- Codex activity → Agent coordinator: provides sessions (evidence: `src/main/agentCoordinator.ts`)
- Claude session state → Agent coordinator: provides sessions (evidence: `src/main/agentCoordinator.ts`)
- Agent coordinator → Electron app runtime: publishes snapshot (evidence: `src/main/index.ts`)
- Electron app runtime → Live island: sends state
- Renderer bridge → Live island: exposes bridge (evidence: `src/preload/index.ts`)
- Live island → Island views: renders (evidence: `src/renderer/LiveCompanion.tsx`)
- Island views → Status buddy: renders (evidence: `src/renderer/IslandView.tsx`)
- Mac user → Customization: chooses appearance (evidence: `README.md`)
- Customization → Feature preview: previews changes (evidence: `src/renderer/customize.tsx`)
- Electron app runtime → App configuration: reads and writes (evidence: `src/main/index.ts`)
- Electron app runtime → Companion preferences: uses companion state (evidence: `src/main/index.ts`)
- Mac user → Music controls: controls music (evidence: `README.md`)
- Spotify → Music controls: provides playback (evidence: `README.md`)
- Electron app runtime → Music controls: coordinates (evidence: `src/main/index.ts`)
- Mac user → File tray: manages files (evidence: `README.md`)
- Mac user → Clipboard history: views history (evidence: `README.md`)
- Mac user → Calendar face: views today (evidence: `README.md`)
- Mac user → System HUD: uses controls (evidence: `README.md`)
- macOS services → Calendar face: provides events (evidence: `README.md`)
- macOS services → System HUD: provides system state (evidence: `README.md`)
- Electron app runtime → File tray: initializes (evidence: `src/main/index.ts`)
- Electron app runtime → Release updates: checks releases (evidence: `README.md`)
- Mac user → Hook installation: installs hooks (evidence: `README.md`)
- Hook installation → Codex: configures hooks (evidence: `README.md`)
- Mac user → Codex approvals: answers requests (evidence: `README.md`)
