claude-replay
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-replaysearch for sessions about database migration"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Claude Replay
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.
Claude Code session
|
hooks (PreToolUse · PostToolUse · Stop)
|
v
~/.claude-replay/sessions.db ← events + checkpoints
|
+----+--------------------+
| | |
MCP tools Dashboard TUI
(resume) :8766 (browse)Passive hooks write. MCP tools, the web dashboard, and the terminal UI read. Nothing leaves your machine.
How this complements native Claude Code
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 |
Undo file + conversation changes in a session | Native |
Search every past session by content, tool, or outcome | Replay |
See why a session ended + per-session metrics | Replay |
Compare two runs side by side | Replay |
Visualize a session timeline / browse all projects | Replay dashboard + TUI |
Export a session as HTML / JSON / Markdown | Replay |
Think of native resume/rewind as recovery, and Replay as observability over your whole history.
Related MCP server: claude-code-mcp
Architecture
Passive hooks write to SQLite. MCP tools read from SQLite. Dashboard + TUI visualize SQLite. That's the whole system.
Layer | File | Role |
Store |
| All DB access — sessions, events, checkpoints |
Hooks |
| Record tool calls + auto-checkpoint, dispatched by |
Recovery |
| Generate a resume brief from a session |
Export |
| Render a session as a self-contained HTML trace |
Server |
| Starlette app — MCP SSE + JSON API + static dashboard |
TUI |
| Textual session browser over the JSON API |
CLI |
| Every subcommand |
Port 8766 deliberately one above Claude Bridge's 8765, so the two siblings can run side by side without colliding.
Quickstart
1. Install
pip install claude-replayOr from a clone if you'd like to hack on it:
git clone https://github.com/constripacity/Claude-Replay.git
cd Claude-Replay
pip install -e .[dev] # editable install with test/lint deps
pip install -e .[tui] # add the terminal UI deps (textual, httpx)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.
2. Install the hooks
This wires Replay into Claude Code by merging three hooks into ~/.claude/settings.json. It's idempotent and leaves any other tools' hooks untouched.
claude-replay install✓ Installed Claude Replay hooks into ~/.claude/settings.json
PreToolUse → claude-replay hook pre-tool
PostToolUse → claude-replay hook post-tool
Stop → claude-replay hook stopFrom 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:
claude-replay doctorClaude Replay — doctor
✓ Hooks installed: PreToolUse / PostToolUse / Stop are in settings.json
✓ Hook command on PATH: claude-replay → …/claude-replay
✓ Database: ~/.claude-replay/sessions.db
✓ Sessions recorded: 3 sessions; most recent 5m ago
All good — Replay is installed and recording. ✓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.
3. Start the server (dashboard + MCP tools)
claude-replay serve # defaults: 127.0.0.1:8766
claude-replay serve --port 9000 # custom port
claude-replay serve --host 0.0.0.0 # bind all interfaces━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Claude Replay — Session checkpoint & recovery server
Version: 0.3.0
DB: ~/.claude-replay/sessions.db
http://localhost:8766/ ← Dashboard
http://localhost:8766/sse ← MCP config
http://localhost:8766/api/state ← JSON state
http://localhost:8766/status ← Health check
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━4. (Optional) Register the MCP tools with Claude Code
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):
claude mcp add --transport sse -s user claude-replay http://localhost:8766/ssestdio (no server process — the client launches Replay on demand):
claude mcp add -s user claude-replay -- claude-replay mcp
# or, without installing: uvx claude-replay mcpVerify with claude mcp list claude-replay should show ✓ Connected. Inside an already-running session, type /mcp to re-handshake.
When a session dies
# What's the state of the last session?
claude-replay status
# Print a paste-ready resume brief (most recent session, or pass an id)
claude-replay resume
claude-replay resume <session-id>
# Browse every recorded session in the terminal
claude-replay tui # needs `claude-replay serve` running
# Export a session as a self-contained HTML trace
claude-replay export # → ~/.claude-replay/exports/<id>.htmlPaste 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.
MCP Tools
Every connected Claude Code session gets these ten tools:
Tool | Description |
| Current session summary objective, status, how it ended, event/checkpoint counts, last activity |
| Force a checkpoint of the current session now, with an optional note |
| Generate a structured resume brief for a session (default: most recent) |
| List recent sessions with status, model, duration, checkpoint count |
| Per-session metrics: how it ended, duration, tool calls, error rate, files touched, top tools |
| Cross-session analytics: tool calls, error rate, why sessions end, tool mix, per-project rollups |
| Full-text search across sessions with filters (tool, cause, date, project), ranked by match count |
| Compare two sessions: metric deltas + which files each touched |
| Name a session and add/remove tags for later retrieval |
| Render a session as a self-contained trace (html / json / md) and return the path |
CLI Reference
Command | What it does |
| Merge Replay's hooks into |
| Remove only Replay's hooks |
| Current/last session at a glance, with insight metrics |
| List recent sessions (with names + tags) |
| Full-text search with filters (omit query to browse by filter) |
| Compare two sessions side by side |
| Print a resume brief (default: most recent) |
| Render a trace |
| Name or tag a session |
| Delete sessions with no recent activity (destructive) |
| Start the MCP + dashboard server (port 8766) |
| Serve the MCP tools over stdio (for |
| Launch the terminal session browser |
| Delete all recorded sessions (destructive) |
| Internal — invoked by Claude Code's hooks |
Dashboard & TUI
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.
Terminal UI (claude-replay tui) a Textual browser in the same dark theme. A session sidebar, a live event feed, and a detail inspector showing how the session ended, its tags, the latest checkpoint, and files touched. Keys:
↑↓ navigate Tab switch panel Space pause
r resume (copies the brief to your clipboard)
e export HTML trace
? help q quitThe TUI talks to the server over HTTP start claude-replay serve first (defaults to http://127.0.0.1:8766; point elsewhere with --url).
Configuration
Env var | Default | Purpose |
|
| SQLite store location |
| — | Session identity (Claude Code sets this in the hook payload); falls back to these env vars, then to a hash of the project dir |
| localhost only | Comma-separated extra CORS origins for the server |
| — | Set to disable the static dashboard mount (MCP/JSON only) |
The hook path is offline-first by design: it makes no network calls and completes in well under 50 ms just the one SQLite write. Large tool payloads are truncated at 8 KB per event so the DB stays lean.
Development
pip install -e .[dev] # or install deps directly (see install note)
python -m pytest # full suite
ruff check .Tests use an isolated tmp_path SQLite database (the fresh_db fixture) — they never touch your real ~/.claude-replay/sessions.db. See CONTRIBUTING.md for the scope and the coding rules.
License
MIT see LICENSE.
Sibling to Claude Bridge. Built under the Constripacity banner.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityAmaintenanceEnables searching and retrieving Claude Code conversation history that would otherwise expire after 30 days. Supports full-text search, semantic search, and session management with automatic backup of all conversations.Last updated1828MIT
- AlicenseAqualityDmaintenanceWraps Claude Code as tools for MCP clients, enabling autonomous coding tasks via a 4-tool lifecycle with session management, async polling, and permission controls.Last updated45315MIT
- Alicense-qualityBmaintenanceBrowse, search, rename, split, and clean up Claude Code sessions via MCP, Web UI, or VSCode extension.Last updated2319MIT
- AlicenseAqualityCmaintenanceExposes analytics from Claude Code transcripts as MCP tools, enabling cost, audit, safety, and efficiency queries through natural language.Last updated4MIT
Related MCP Connectors
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/constripacity/Claude-Replay'
If you have feedback or need assistance with the MCP directory API, please join our Discord server