Claude Replay

io.github.constripacity由 GitHub 帳號 constripacity 發布v0.4.3更新於 Oct 24, 2026

Session checkpoint & recovery for Claude Code: resume, search, tag, and export recorded sessions.

發布方自己的服務:Claude Platform Docs

概覽

AI 產生的概覽

將 Claude Code 工作階段記錄到本機 SQLite 儲存區,讓助理搜尋、比較、標記、恢復與匯出過往工作階段。

可以做什麼
依內容、工具、結束原因、日期或專案搜尋與瀏覽已記錄的工作階段,並列出近期工作階段的狀態與時長指標。檢視單一工作階段的摘要、結束方式、錯誤率、涉及檔案與常用工具,以及跨工作階段與依專案的統計。為某個工作階段產生結構化的恢復簡報,或附註記強制建立檢查點。比較兩個工作階段的指標差異與涉及檔案,並為工作階段命名或加上標籤以便日後查找。將工作階段匯出為自包含的 HTML、JSON 或 Markdown 紀錄並回傳路徑。
適用情境
適合在多個 Claude Code 專案間工作、需要超出內建恢復與回溯能力的歷史紀錄時使用:查清過去某次工作階段做了什麼、為何結束、比較兩次執行,或把中斷工作階段的進展整理成簡報交給新的工作階段。
執行需求
以本機 Python 套件形式執行(claude-replay,可用 uvx 啟動或以 pip 安裝)。記錄功能需要把鉤子安裝到 Claude Code 的設定檔,並確保 claude-replay 指令在 PATH 中。選用的儀表板與終端介面需要本機伺服器在 8766 埠執行。CLAUDE_REPLAY_DB 變數指定 SQLite 路徑;未宣告任何身分驗證。
安裝前請注意
鉤子會把每次 Claude Code 工作階段(包括工具呼叫與檔案路徑)記錄到本機資料庫,單一事件的大型負載會截斷至 8 KB。命令列包含刪除部分或全部已記錄工作階段的破壞性指令。將伺服器綁定到所有網路介面會使儀表板與 JSON API 暴露在 localhost 之外,需謹慎設定主機與 CORS 來源。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Claude Replay,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Claude Replay

The observability layer for Claude Code sessions — search, analytics, and visualization across every project.

[PyPI] [CI] [Python] [License] [MCP]


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 sessionNative claude --continue, --resume
Undo file + conversation changes in a sessionNative /rewind
Search every past session by content, tool, or outcomeReplay search
See why a session ended + per-session metricsReplay status / replay_insights
Compare two runs side by sideReplay diff
Visualize a session timeline / browse all projectsReplay dashboard + TUI
Export a session as HTML / JSON / MarkdownReplay export --format

Think of native resume/rewind as recovery, and Replay as observability over your whole history.


Architecture

Passive hooks write to SQLite. MCP tools read from SQLite. Dashboard + TUI visualize SQLite. That's the whole system.

LayerFileRole
Storeclaude_replay/store.pyAll DB access — sessions, events, checkpoints
Hooksclaude_replay/hooks.pyRecord tool calls + auto-checkpoint, dispatched by claude-replay hook <type>
Recoveryclaude_replay/resume.pyGenerate a resume brief from a session
Exportclaude_replay/export.pyRender a session as a self-contained HTML trace
Serverclaude_replay/server.pyStarlette app — MCP SSE + JSON API + static dashboard
TUIclaude_replay/tui.py + tui_client.pyTextual session browser over the JSON API
CLIclaude_replay/cli.pyEvery subcommand

Port 8766 deliberately one above Claude Bridge's 8765, so the two siblings can run side by side without colliding.


Quickstart

1. Install

bash
pip install claude-replay

Or from a clone if you'd like to hack on it:

bash
git clone https://github.com/constripacity/Claude-Replay.gitcd Claude-Replaypip install -e .[dev]              # editable install with test/lint depspip install -e .[tui]             # add the terminal UI deps (textual, httpx)

If pip install -e fails 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.

bash
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 stop

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:

bash
claude-replay doctor
Claude 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)

bash
claude-replay serve                 # defaults: 127.0.0.1:8766claude-replay serve --port 9000     # custom portclaude-replay serve --host 0.0.0.0  # bind all interfaces
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  Claude Replay — Session checkpoint & recovery server  Version: 0.4.1  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):

bash
claude mcp add --transport sse -s user claude-replay http://localhost:8766/sse

stdio (no server process — the client launches Replay on demand):

bash
claude mcp add -s user claude-replay -- claude-replay mcp# or, without installing: uvx claude-replay mcp

Verify with claude mcp list claude-replay should show ✓ Connected. Inside an already-running session, type /mcp to re-handshake.


When a session dies

bash
# 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 resumeclaude-replay resume <session-id>
# Browse every recorded session in the terminalclaude-replay tui                   # needs `claude-replay serve` running
# Export a session as a self-contained HTML traceclaude-replay export                # → ~/.claude-replay/exports/<id>.html

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.


MCP Tools

Every connected Claude Code session gets these ten tools:

ToolDescription
replay_statusCurrent session summary objective, status, how it ended, event/checkpoint counts, last activity
replay_checkpointForce a checkpoint of the current session now, with an optional note
replay_resumeGenerate a structured resume brief for a session (default: most recent)
replay_sessionsList recent sessions with status, model, duration, checkpoint count
replay_insightsPer-session metrics: how it ended, duration, tool calls, error rate, files touched, top tools
replay_statsCross-session analytics: tool calls, error rate, why sessions end, tool mix, per-project rollups
replay_searchFull-text search across sessions with filters (tool, cause, date, project), ranked by match count
replay_diffCompare two sessions: metric deltas + which files each touched
replay_tagName a session and add/remove tags for later retrieval
replay_exportRender a session as a self-contained trace (html / json / md) and return the path

CLI Reference

CommandWhat it does
claude-replay installMerge Replay's hooks into ~/.claude/settings.json (idempotent)
claude-replay uninstallRemove only Replay's hooks
claude-replay statusCurrent/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 mcpServe 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

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 pauser  resume (copies the brief to your clipboard)e  export HTML trace?  help        q quit

The 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 varDefaultPurpose
CLAUDE_REPLAY_DB~/.claude-replay/sessions.dbSQLite store location
CLAUDE_SESSION_ID / CLAUDE_CODE_SESSION_ID—Session identity (Claude Code sets this in the hook payload); falls back to these env vars, then to a hash of the project dir
CLAUDE_REPLAY_CORS_ORIGINlocalhost onlyComma-separated extra CORS origins for the server
CLAUDE_REPLAY_NO_DASHBOARD—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

bash
pip install -e .[dev]               # or install deps directly (see install note)python -m pytest                    # full suiteruff 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.

來源:README.md,提交 46558c9

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Claude 整合