Claude tracker suite

From tdimino/claude-code-minoan · View interactive version

Claude tracker suite is an AI agent skill from the GitHub repository tdimino/claude-code-minoan. Manage Claude Code sessions — search by topic or ID, browse recent sessions with full metadata (tags, summaries, titles, cost), view title/nickname history timelines, resume in Ghostty tabs, spawn interactive or headless sessions, monitor live sessions, and bootstrap new setups. Triggers on resume s

How to use this skill

Skill file

Claude Session Management Suite

Search, browse, monitor, and manage Claude Code session history across all projects.

Tools

Commands on PATH (~/.local/bin) are thin wrappers around scripts in scripts/; scripts run directly with node or bash from ~/.claude/skills/claude-tracker-suite/scripts/.

Everyday use

| Tool | Invoked by | Purpose |

|------|-----------|---------|

| claude-tracker-search → search-sessions.js | /claude-tracker-search | Keyword search, --id prefix lookup, titles <id> timeline |

| claude-tracker-recent → recent-sessions.js | /claude-tracker-recent | Last N sessions with title, tags, summary, model, cost (headless sdk-cli sessions only with --all) |

| claude-tracker → list-sessions.js | /claude-tracker | Recent sessions with status badges |

| claude-tracker-alive | Direct | Which sessions have running processes |

| claude-tracker-resume | /claude-tracker-resume | Find and reopen crashed sessions; --workspace restores the last stamp |

| scripts/claude-tracker-pick | Direct | fzf picker with preview; Enter→Ghostty, Ctrl-O→current terminal, Ctrl-Y→copy |

| scripts/open-sessions.js | Direct | List top N sessions, open the selected ones in Ghostty tabs |

| scripts/new-session.sh | /spawn | New interactive, prompt-driven, or headless session |

| scripts/resume-session.sh | Direct | Open a session in a Ghostty tab, optionally the project in Cursor |

| ~/.claude/scripts/ghostty-resume.sh | Direct | The suite's single terminal opener (tabs and splits) |

| scripts/checkpoint-session.js | /checkpoint, /checkpoint-list | Named bookmarks within sessions |

| scripts/quote-session.js | /quote, /quote-search | Capture and search tagged phrases (FTS5) |

| scripts/tag-session.js | /tag | Manual session tags with provenance |

Index, maintenance, and setup (details in references/operations.md)

| Tool | Invoked by | Purpose |

|------|-----------|---------|

| scripts/index-transcripts.js | Hooks / launchd / in-process | Incremental transcript FTS indexer; session metadata and title history |

| scripts/db-maintain.js | Weekly launchd | FTS optimize, WAL truncate, VACUUM when a quarter of pages are free |

| scripts/search-regression.js | After search changes | Recall fixtures (exit 1 on regression) |

| scripts/audit-suite.js | Direct | Self-audit → AUDIT.md |

| scripts/backfill-summaries.js | Direct | Hermetic summary backfill (disabled by default, --enable) |

| scripts/save-workspace.js, scripts/restore-workspace.sh | launchd / direct | Snapshot live sessions; restore them into Ghostty tabs |

| scripts/claude-wrapper.sh | Source in .zshrc | cc shell function for named sessions |

| scripts/open-file-explorer.sh | Direct | yazi in a Ghostty split |

| scripts/detect-projects.js, ~/.claude/scripts/update-active-projects.py | Direct | Project discovery; regenerate active-projects.md |

| scripts/bootstrap-claude-setup.js | Direct | Generate a ~/.claude/ setup for a new machine |

| claude-tracker-watch | — | Dormant summarize daemon (Claude Code no longer writes the file it watches) |

All scripts use ~/.claude/lib/tracker-utils.js for shared utilities (path decoding, session parsing, live-session detection, git remote detection) and ~/.claude/lib/tracker-db.js for SQLite access (node:sqlite DatabaseSync, WAL mode, singleton lazy-open). No npm dependencies—the DB module uses Node's built-in node:sqlite (Node >= 22.13).

Quick Start

# Search by topic
claude-tracker-search "kothar soul"

# Lookup by session ID prefix (exact directory from JSONL ground truth)
node ~/.claude/skills/claude-tracker-suite/scripts/search-sessions.js --id d7b8f4dd

# Search by session name/slug only (fast — no body scan)
claude-tracker-search "thera" --name

# List top 10 sessions, open selected in Ghostty tabs
node ~/.claude/skills/claude-tracker-suite/scripts/open-sessions.js

# Check what's alive
claude-tracker-alive

# Resume crashed sessions in Ghostty
claude-tracker-resume --open

Search

claude-tracker-search "$ARGUMENTS"

How search works: the default path queries the transcript full-text index (FTS5 over all user+assistant conversation text, built by index-transcripts.js), merged with metadata FTS over titles/slug/summary/first-prompt (bm25 column weights: custom_title 3x, auto_title 2x, summary 2x, first_prompt 1.5x, slug 1x). Multi-word queries match per-term at the session level (terms may appear in different messages), expand through synonym groups in references/synonyms.json, and fall back from AND to OR with a labeled partial-match notice. Ranking: IDF-weighted saturated match-density with a short-session damp. Results include highlighted snippet excerpts.

Before every body search, search-sessions.js runs an in-process index refresh (1.5s budget) so sessions from today are searchable within seconds of their last turn. The refresh line reads Index refreshed: N session(s) in Xms — M still pending. Pass --no-refresh to skip it.

Omitting the current session: --exclude-current drops the session the search runs in, named by CLAUDE_CODE_SESSION_ID (set in Claude Code's Bash tool). That session holds the query just typed, so it always matches; /claude-tracker-search and /claude-tracker-resume pass the flag. It prints Omitted the current session (<id>) when it drops a hit, applies to --name and --deep too, and leaves --id and titles lookups alone. With the variable unset (a plain terminal) nothing is omitted.

Former-title fallback: default search also checks title_history for sessions whose past titles match the query but whose current title does not. A session renamed away from a name the user remembers still surfaces under a "former-title matches" heading, capped to avoid crowding body results. Each former-title hit prints its old name, provenance, date, and a link to the full timeline via the titles subcommand.

| Flag / Subcommand | Description |

|------|-------------|

| --limit <n> | Max results (default: 15) |

| --id <prefix> | Lookup by session ID prefix (8+ chars) |

| --name | Titles/slugs/summaries only via metadata FTS (fastest) |

| --deep | Bypass the index: streaming raw JSONL scan (new/unindexed sessions; whole-phrase matching) |

| --open | Resume the top hit in a new Ghostty tab immediately |

| --copy | Copy the top hit's resume command to the clipboard (opt-in; nothing writes clipboard by default) |

| --no-refresh | Skip the on-demand index catch-up before searching |

| titles <id-prefix> | Print the chronological title/nickname timeline for a session (all rename, slug, cache, and summarizer events) |

Interactive Picker (restart recovery)

~/.claude/skills/claude-tracker-suite/scripts/claude-tracker-pick              # fuzzy-find recent 50
~/.claude/skills/claude-tracker-suite/scripts/claude-tracker-pick --here      # resume in current terminal
~/.claude/skills/claude-tracker-suite/scripts/claude-tracker-pick --project thera --limit 100

Enter opens the session in a Ghostty tab, Ctrl-O resumes in the current terminal, Ctrl-Y copies the resume command. Preview shows title, summary, and first prompt. Pair with restore-workspace.sh (bulk restore from the launchd snapshot)—the picker is for choosing, restore is for "give me back everything".

Resume Crashed Sessions

claude-tracker-resume                    # List crashed sessions with resume commands
claude-tracker-resume --open             # Reopen each in a new Ghostty tab
claude-tracker-resume --open --limit 3   # Reopen at most 3
claude-tracker-resume --dry-run          # Preview without acting
claude-tracker-resume --days 14          # Widen the look-back window (default 7)

A crashed session is the newest transcript per project (within the look-back window) that has no live Claude process, for projects with no live tab at all. Liveness comes from ~/.claude/sessions/<pid>.json PID files via tracker-utils.getLiveSessions(). Sessions older than 3 days show an OLD badge.

Alive Detection

Check which sessions have running Claude processes:

claude-tracker-alive                     # Running + stale sessions overview
claude-tracker-alive --running           # Only sessions with active processes
claude-tracker-alive --stale             # Only sessions with no process
claude-tracker-alive --all-kinds         # Include headless/background sessions
claude-tracker-alive --json              # Machine-readable output

Source of truth is Claude Code's PID files (~/.claude/sessions/<pid>.json), verified against one ps pass via getLiveSessions(). Matching is by sessionId—a crashed session next to a live sibling in the same directory is no longer reported RUNNING. Sessions >3 days without a process show an OLD badge.

Recent Sessions (Full Metadata)

claude-tracker-recent                          # Last 10 sessions with full metadata
claude-tracker-recent --limit 20               # Last 20 sessions
claude-tracker-recent --json                   # Machine-readable JSON output
claude-tracker-recent --project myapp          # Filter by project
claude-tracker-recent --model opus             # Filter by model
claude-tracker-recent --since 7d               # Last 7 days only

Shows per session: title (custom or auto), summary, all tags (color-coded by type), project name, age, model, cost, turn count, git branch, session ID, and resume command. Add --copy to put the first resume command on the clipboard (never done by default).

Session Listing

claude-tracker                           # All recent sessions

Status badges: ACTIVE (process running, recent heartbeat), STALE (process exists but no recent activity), OLD (older than 24 hours), CRASHED (process not found, no clean exit).

When speculator is running, the session listing includes Ghostty tab count and window count in the header, plus TTY badges per session showing which Ghostty tab it occupies.

Resume in Ghostty Tab

The single terminal opener for the suite is ~/.claude/scripts/ghostty-resume.sh. It writes a tiny launcher script to ~/.claude/run/launch/ and has Ghostty run it in a new tab or split.

~/.claude/scripts/ghostty-resume.sh <session-id>
~/.claude/scripts/ghostty-resume.sh <session-id> --project ~/my-project --name "auth-fix"
~/.claude/scripts/ghostty-resume.sh <session-id> --split right       # split the current tab
~/.claude/scripts/ghostty-resume.sh <session-id> --print             # write launcher, print its path
~/.claude/scripts/ghostty-resume.sh --exec "claude -n foo" --project ~/my-project  # arbitrary command

On Ghostty >= 1.3.0, the opener uses the AppleScript dictionary (new surface configuration with initial working directory + initial input, then new tab or split)—no keystrokes, no clipboard, no focus dependency. On older builds it falls back to activate + Cmd-T + one Cmd-V paste of the launcher path (clipboard saved/restored). --split requires the scripting dictionary (>= 1.3.0); without it, the flag is ignored and a tab opens instead.

The launcher itself checks the project directory and transcript before running exec claude --resume <id>, falling back to a fresh session with a reason when either is missing. Launchers are pruned after a day; ~/.claude/run/ is gitignored. Claude Code sets tab titles itself (-n / derived name)—nothing is injected.

Exit codes: 0 opened, 1 bad arguments or unresolvable session, 2 Ghostty or Accessibility unavailable.

resume-session.sh is a thin wrapper that delegates to the opener, with --cursor to also open the project in Cursor.

New Session / Spawn

Start a new Claude Code session in a terminal tab or headless:

# Interactive session in Ghostty (default)
~/.claude/skills/claude-tracker-suite/scripts/new-session.sh ~/my-project

# With a specific model
~/.claude/skills/claude-tracker-suite/scripts/new-session.sh ~/my-project --model opus

# Prompt-driven session in Ghostty tab
~/.claude/skills/claude-tracker-suite/scripts/new-session.sh ~/my-project --prompt "fix the login bug"

# Headless — runs in current terminal, returns JSON
~/.claude/skills/claude-tracker-suite/scripts/new-session.sh ~/my-project --headless --prompt "summarize the README"

# Headless with specific model and output format
~/.claude/skills/claude-tracker-suite/scripts/new-session.sh ~/my-project --headless --prompt "fix tests" --model haiku --output-format text

Headless and prompt-driven modes use claude -p (the Agent SDK CLI). Terminal modes delegate to ghostty-resume.sh --exec.

Workflow: Find and Resume

  1. claude-tracker-search "topic" — find matching sessions
  2. claude-tracker-recent — browse last 10 sessions with full metadata
  3. claude --resume <session-id> — resume in current terminal
  4. ~/.claude/scripts/ghostty-resume.sh <session-id> — resume in a new Ghostty tab
  5. claude-tracker-resume --open — auto-resume all crashed sessions in Ghostty

Workflow: Monitor Active Work

  1. claude-tracker-alive — see what's running vs stale
  2. claude-tracker-recent --since 1d — today's sessions with titles, summaries, and cost
  3. Read ~/.claude/agent_docs/active-projects.md — curated project overview

Native Claude Code Features

Claude Code 2.1.263+ provides session management primitives that overlap with parts of this suite. Where native is sufficient, use it directly:

Claude Code's own sweep stays off: cleanupPeriodDays is 99999. Where geniza (~/.claude/scripts/geniza/) is in

use, it retires sessions older than 90 days out of projects/ once it holds a verified slim copy of each. Search

keeps finding them, since the indexer's prune spares every session geniza holds, and prints geniza read <id> in

place of a resume command. Where geniza's folder exists but its index cannot be read, the prune skips entirely.

Operations and Database

Load these only when the task needs them:

Related Systems

References

For detailed schemas and infrastructure:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.