local-first · reads your ~/.claude · single go binary
/compact.
claude-watch captures every Claude Code session in real time — before
compaction erases it. Plain markdown files, a searchable SQLite index, and a local web UI
at localhost:7823. One Go binary. Zero dependencies.
install — macOS · linux · amd64 · arm64
curl -fsSL https://github.com/rishi-anand/claude-watch/releases/latest/download/install.sh | bash
the problem
When your context window fills up, Claude Code runs /compact — summarizing and
discarding old messages to free tokens. That transcript is gone. If you want to look up what
you actually said three sessions ago, you can't.
A growing pile of .jsonl files under ~/.claude/projects/… with
no search, no timeline, and no way to distinguish a live session from a compacted one.
/compact.
claude-watch listens for the PreCompact hook that fires just before summarization
runs, syncs the full transcript to a plain .md file, and updates a SQLite FTS5
index. Nothing is lost.
Type words. Get answers. Same index the web UI uses, available in the CLI too.
what you get
No CGO. No Docker. No database server. Plain-text storage, a searchable index, and a local
web UI at localhost:7823 — that's the whole surface.
The PreCompact hook fires before summarization, giving us the full transcript before it's destroyed.
SQLite FTS5. Implicit AND across words. Hyphens and apostrophes split into parts.
Sessions land as human-readable .md. No proprietary format. Version-control them if you want.
list, export, and search work straight against Claude's JSONL. No server needed.
Browse sessions by project, read full conversations with markdown, tool calls, and compaction markers rendered.
install-skill teaches Claude Code, Codex, and Cursor to route history lookups through the CLI.
Built for the terminal-adjacent life. Web UI auto-follows the system and remembers your toggle.
Shows exactly what will be written to ~/.claude/settings.json before touching a byte.
command reference
One binary, seven subcommands. Full details, flags, and JSON output in the README.
localhost:7823. First run installs Claude Code hooks after you confirm.--json for scripting.--include-tool-msg for full detail.serve..md session files.how it works
Claude Code fires hook events
at key points. Each hook pipes JSON straight into the claude-watch binary, which
syncs the exact JSONL file it points at — no filesystem scanning, no ticker.
Records the new session and creates an empty markdown stub. Session metadata lands in SQLite immediately.
Incremental sync of the transcript into markdown, then updates the SQLite FTS5 index. Fires on every prompt and every assistant stop.
Fires before Claude compacts the context. claude-watch flushes the full transcript to disk right here — so nothing is lost when summarization runs.
Final sync of the transcript. The session is now preserved in full and available for search, export, and browsing.
memento omnia
remember everything