
Session Observer
One local dashboard for Claude Code, Codex and OpenCode. Follow prompts, tool calls, model steps, subagents, context use and failures as they happen.

Screenshots
The Home and Overview screenshots use example sessions. The remaining screenshots come from real Claude Code and Codex sessions. The numbered labels were added for this README; the dashboard doesn't show them.

Home: pinned sessions above the project tree. Click a session's star on Home or in the left session list to pin or unpin it. Pinned sessions stay above other sessions in their group and remain visible outside the selected date range.

Overview: totals, one bar per turn, context use and activity. Click a bar to open the turn.

Route: follow a turn through tool calls and parallel subagents. Click a stop to see its input and output.

Chat: prompts, thinking, tool chips and replies in order.

Context: what fills the context window, down to each record.
How it works
flowchart LR
C[Claude Code] -->|plugin hooks| H[scripts/hook.js]
X[Codex] -->|plugin hooks or CLI config| H
O[OpenCode] -->|in-process plugin| P[capture/plugin.js]
P -->|append by day and session| L
H -->|append by day and session| L[(~/.claude/session-observer/sessions/DAY/*.jsonl)]
L -->|recent days at start, older on request| S[Local Node server]
S -->|HTTP and live updates| D[Dashboard in your browser]
S -. reads transcript when needed .-> T[Claude transcript, Codex rollout or opencode.db]
Each integration appends every event to a JSONL file for its session inside a folder for the current UTC day. The server keeps sessions in memory. At start it reads only the last few days, and the dashboard can load older days on request. The dashboard labels sessions by agent and reads transcripts when a view needs message or context detail.
Event storage
One file per session, in the folder of the UTC day it was last active.
~/.claude/session-observer/
sessions/<YYYY-MM-DD>/<sha256(session_id)>.jsonl
deleted-sessions.jsonl ← deleted session ids, so they are not imported again
events.jsonl ← written only by older plugin versions; imported at start
Hook: append, moving the file forward to today
flowchart TD
E([hook event]) --> T{today's file exists?}
T -->|yes| A[append]
T -->|no| O{file in an earlier day?}
O -->|no| N[create today's file] --> A
O -->|yes| M[move it to today, remove the empty folder] --> A
M -.->|rename refused: file locked on Windows| A2[append where it is, retry on the next event]
Server: read recent days, follow moved files
flowchart TD
S([start]) --> I[import events.jsonl into day folders, skip deleted ids]
I --> W[read the last OBSERVER_LOAD_DAYS days]
W --> P[every 400 ms: read new bytes of each file]
P -->|same file in a newer folder| K[keep the read offset]
P --> D[push events to the dashboard]
W -->|Load sessions before …| O[read older days]
- Delete (×): removes the session's file and adds its id to
deleted-sessions.jsonl.
- Midnight race: a new session can get two files; the server reads them in order.