claude-watch

Browse, search, and permanently preserve your Claude Code conversation history. Nothing lost to /compact.

Install View on GitHub
One-line install (macOS / Linux · amd64 / arm64)
$ curl -fsSL https://github.com/rishi-anand/claude-watch/releases/latest/download/install.sh | bash
The problem

Claude Code forgets. On purpose.

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.

Without claude-watch Before

Sessions live in a growing pile of .jsonl files under ~/.claude/projects/…. After a compaction, the summary replaces the original messages. There's no search, no timeline, no way to resume a conversation from three weeks ago.

With claude-watch After

Every session is captured in real time via Claude Code hooks — including the moment right before /compact runs. History lands in plain .md files with an FTS5 index. Nothing is ever lost. Search everything.

What you get

Everything, kept.

One small Go binary. No CGO, no Docker, no database server. Plain-text storage, searchable index, and a local web UI at localhost:7823.

Survives /compact

The PreCompact hook fires just before summarization, giving us the full transcript before it's destroyed.

Fast full-text search

SQLite FTS5. All words must match (implicit AND). Hyphens and apostrophes are treated as word separators.

Plain markdown files

Sessions stored as human-readable .md files. No proprietary format. Version-control them if you like.

CLI, no SQLite needed

Use list, export, and search straight against Claude's JSONL — no server, no index required.

Local web UI

Browse sessions, filter by project, read a full conversation with markdown, tool calls, and compaction markers rendered.

Agent-aware

install-skill teaches Claude Code, Codex, and Cursor to route "what was that session where…" through claude-watch.

Dark & light theme

Auto-follows your system, and a toggle in the header remembers your preference across sessions.

Transparent setup

Shows exactly what will be written to ~/.claude/settings.json before touching a byte.

Command reference

Small surface. Real power.

One binary, seven subcommands. Full details are in the README.

claude-watch serveStart the local server and open the web UI at localhost:7823.
claude-watch listList sessions across all projects (reads JSONL directly — no SQLite needed).
claude-watch search <query>Full-text search every captured conversation. Same FTS5 index as the web UI.
claude-watch export --session-id <id>Export any conversation to a clean markdown file. Add --include-tool-msg for full detail.
claude-watch install-skillShip the agent skill file to Claude Code, Codex, and Cursor so they use claude-watch for history lookups.
claude-watch hook <event>Process a Claude Code hook event. Wired automatically on first serve.
claude-watch rebuildForce rebuild the SQLite FTS5 index from your .md session files.
How it works

Event-driven, no polling.

Claude Code fires hook events at key points. Each hook pipes JSON into the claude-watch binary, which syncs the exact JSONL file it points at — no filesystem scanning, no ticker.

SessionStart

Records the new session and creates an empty markdown stub for it.

UserPromptSubmit · Stop

Incremental sync of the transcript into markdown, then updates the SQLite FTS5 index.

PreCompact — the critical one

Fires before Claude compacts the context. We flush the full transcript to disk right here, so nothing is lost when summarization runs.

SessionEnd

Final sync of the transcript. Session is now preserved in full for search and export.