Skip to main content

Claude Sessions

@magistr/claude-sessionsv2026.07.19.2· 3d agoMODELS
01README

Read Claude Code's own session transcripts as swamp data.

Claude Code appends one JSONL transcript per session under ~/.claude/projects//.jsonl. That log is write-only in practice — there is no way to ask "which of my sessions actually finished?" without reading raw JSON by hand. This model parses those transcripts into queryable resources:

  • index — per-project session counts, bytes and last activity (stats only, no parsing, so it stays cheap on a large history)
  • listSessions — one session resource per transcript: ai-title, cwd, git branch, CLI version, models used, start/last-activity, span, staleness, turn and tool-call counts, top tools, the opening prompt and the closing recap
  • search — full-text search across transcripts with snippets
  • triage — the worklist method: joins sessions to the kanban cards created by the mk-session-card hook (state files under ~/.claude/mk-session-cards/) and ranks them by a completion verdict

The completion verdict reads the session's LAST assistant message, which by the hook's convention is a recap of what was done and what is left. It is a ranking aid, not a judgment: likely-complete, likely-open, unclear, or hook-noise when the session ended on card bookkeeping rather than on a work recap. Every row carries the closing text as evidence so a human or agent makes the actual call. Sidechain (subagent) turns are excluded so a chatty subagent cannot become the session's last word.

All methods fan out over every matching session in a single run, so a whole history is one method call and one model lock.

02Models1
@magistr/claude-sessionsv2026.07.19.2extensions/models/claude_sessions.ts
fn index()
Inventory the transcript store: one row per project with session count, bytes and last activity. Cheap — stats files without parsing them.
fn listSessions()
Parse transcripts and write one session resource each: metadata, turn/tool counts, opening prompt, closing recap and completion verdict. Fans out over every matching session in one run.
fn triage()
Join sessions to their mk cards and rank them by completion verdict — the answer to 'which working-column cards belong to sessions that actually finished?'. Writes a single triage worklist plus a session resource per row.
fn search(q: string)
Full-text search across transcripts — returns matching sessions with snippets, newest first.
ArgumentTypeDescription
qstringCase-insensitive substring to find

Resources

session(infinite)— One Claude Code session: metadata, turn/tool counts, opening prompt, closing recap, completion verdict
triage(infinite)— Worklist joining sessions to their mk cards, ranked by completion verdict
index(infinite)— Per-project session counts and sizes
search(infinite)— Sessions matching a text query, with snippets
03Stats
A
100 / 100
Downloads
0
Archive size
21.7 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
04Platforms
05Labels