Session checkpoint & recovery for Claude Code: resume, search, tag, and export recorded sessions.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
The observability layer for Claude Code sessions β search, analytics, and visualization across every project.
Claude Code's --resume/--continue and /rewind recover the session you're in. Claude Replay does the part they don't: it hooks passively into every session, records what happened to a local SQLite store, and makes every past session β across every project β searchable, comparable, measurable, and exportable. Full-text search, per-session insight metrics, death-cause classification (why a session ended), session diffing, a web dashboard, and a terminal UI β none of which Claude Code has natively.
Passive hooks write. MCP tools, the web dashboard, and the terminal UI read. Nothing leaves your machine.
Claude Replay is additive β it layers on top of the built-ins, it doesn't replace them.
| You want to⦠| Use |
|---|---|
| Resume / continue the current session | Native claude --continue, --resume |
| Undo file + conversation changes in a session | Native /rewind |
| Search every past session by content, tool, or outcome | Replay search |
| See why a session ended + per-session metrics | Replay status / replay_insights |
| Compare two runs side by side | Replay diff |
| Visualize a session timeline / browse all projects | Replay dashboard + TUI |
| Export a session as HTML / JSON / Markdown | Replay export --format |
Think of native resume/rewind as recovery, and Replay as observability over your whole history.
Passive hooks write to SQLite. MCP tools read from SQLite. Dashboard + TUI visualize SQLite. That's the whole system.
| Layer | File | Role |
|---|---|---|
| Store | claude_replay/store.py | All DB access β sessions, events, checkpoints |
| Hooks | claude_replay/hooks.py | Record tool calls + auto-checkpoint, dispatched by claude-replay hook <type> |
| Recovery | claude_replay/resume.py | Generate a resume brief from a session |
| Export | claude_replay/export.py | Render a session as a self-contained HTML trace |
| Server | claude_replay/server.py | Starlette app β MCP SSE + JSON API + static dashboard |
| TUI | claude_replay/tui.py + tui_client.py | Textual session browser over the JSON API |
| CLI | claude_replay/cli.py | Every subcommand |
Port 8766 deliberately one above Claude Bridge's 8765, so the two siblings can run side by side without colliding.
Or from a clone if you'd like to hack on it:
If
pip install -efails on your environment (a known hatchling editable-install quirk on some setups), install the deps directly instead:pip install mcp starlette uvicorn anyio textual httpx.
This wires Replay into Claude Code by merging three hooks into ~/.claude/settings.json. It's idempotent and leaves any other tools' hooks untouched.
From now on, every Claude Code session is recorded automatically. Remove the hooks any time with claude-replay uninstall (it removes only Replay's hooks).
Confirm it's actually wired up β the one check that matters:
If doctor warns that claude-replay isn't on PATH, the hooks can't run and nothing is recorded β put your install directory on PATH and re-run it.
So a running Claude Code session can call replay_resume, replay_checkpoint, etc. directly. Two ways:
SSE (alongside the dashboard β needs claude-replay serve running):
stdio (no server process β the client launches Replay on demand):
Verify with claude mcp list claude-replay should show β Connected. Inside an already-running session, type /mcp to re-handshake.
Paste the resume output into a fresh Claude Code session and it picks up where the dead one left off objective, what was done, what's next, and which files were touched.
Every connected Claude Code session gets these ten tools:
| Tool | Description |
|---|---|
replay_status | Current session summary objective, status, how it ended, event/checkpoint counts, last activity |
replay_checkpoint | Force a checkpoint of the current session now, with an optional note |
replay_resume | Generate a structured resume brief for a session (default: most recent) |
replay_sessions | List recent sessions with status, model, duration, checkpoint count |
replay_insights | Per-session metrics: how it ended, duration, tool calls, error rate, files touched, top tools |
replay_stats | Cross-session analytics: tool calls, error rate, why sessions end, tool mix, per-project rollups |
replay_search | Full-text search across sessions with filters (tool, cause, date, project), ranked by match count |
replay_diff | Compare two sessions: metric deltas + which files each touched |
replay_tag | Name a session and add/remove tags for later retrieval |
replay_export | Render a session as a self-contained trace (html / json / md) and return the path |
| Command | What it does |
|---|---|
claude-replay install | Merge Replay's hooks into ~/.claude/settings.json (idempotent) |
claude-replay uninstall | Remove only Replay's hooks |
claude-replay status | Current/last session at a glance, with insight metrics |
claude-replay sessions [--limit N] | List recent sessions (with names + tags) |
claude-replay search <query> [--tool T] [--cause C] [--since 7d] [--project P] | Full-text search with filters (omit query to browse by filter) |
claude-replay diff <session-a> <session-b> | Compare two sessions side by side |
claude-replay resume [session_id] | Print a resume brief (default: most recent) |
claude-replay export [session_id] [--output DIR] [--format html|json|md] | Render a trace |
claude-replay tag [session_id] [--name N] [--add a,b] [--remove c] [--clear] | Name or tag a session |
claude-replay prune [--older-than 30d] [--yes] | Delete sessions with no recent activity (destructive) |
claude-replay serve [--host H] [--port P] | Start the MCP + dashboard server (port 8766) |
claude-replay mcp | Serve the MCP tools over stdio (for uvx claude-replay mcp / MCP clients) |
claude-replay tui [--url URL] | Launch the terminal session browser |
claude-replay reset [--yes] | Delete all recorded sessions (destructive) |
claude-replay hook <pre-tool|post-tool|stop> | Internal β invoked by Claude Code's hooks |
Web dashboard (claude-replay serve, then open http://localhost:8766/) a vanilla-JS view that polls every 2 s: session list (with how-it-ended badge + tags), a live search box, per-session timeline, and one-click "Copy Resume Brief" / "Export HTML". No CDN, no build step.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/claude-replay)<a href="https://allmcps.com/mcp/claude-replay"><img src="https://allmcps.com/api/badge/claude-replay?style=directory" alt="Claude Replay on AllMCPs" /></a>