Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

claude-replay

> AI 编程
Open source

Convert AI coding agent sessions (Claude Code, Cursor, Codex, Gemini, OpenCode, Kimi Code) into self-contained, embeddable HTML replays

784 stars0 likes4 views
WebsiteGitHub

About

Convert AI coding agent sessions (Claude Code, Cursor, Codex, Gemini, OpenCode, Kimi Code) into self-contained, embeddable HTML replays

claude-replay

Community tool — not affiliated with or endorsed by Anthropic.

AI coding sessions are great for development, but hard to share. Screen recordings are bulky and transcripts are hard to navigate.

claude-replay turns Claude Code, Cursor, Codex CLI, Gemini CLI, OpenCode, Kimi Code, and Hermes Agent session logs into interactive, shareable HTML replays. The generated replay is a single self-contained HTML file with no external dependencies — you can email it, host it anywhere, or embed it in documentation. Use --serve --watch to monitor agent sessions live as they run.

Try it online · Live demo

Claude Code, Cursor, Codex CLI, Gemini CLI, OpenCode, Kimi Code, and Hermes Agent store conversation transcripts on disk. claude-replay auto-detects the format and converts them into visual replays suitable for blog posts, demos, and documentation.

Source Transcript location
Claude Code ~/.claude/projects//
Cursor ~/.cursor/projects//agent-transcripts//
Codex CLI ~/.codex/sessions//
Gemini CLI ~/.gemini/tmp//chats/
OpenCode Export via opencode export
Kimi Code ~/.kimi-code/sessions///agents//wire.jsonl
Hermes Agent ~/.hermes/state.db (read live via SQLite) or hermes sessions export

Features

  • Self-contained HTML output (no dependencies)
  • Interactive playback with speed control
  • Collapse/expand tool calls and thinking blocks (Claude's internal reasoning traces)
  • Bookmarks / chapters
  • Secret redaction before export
  • Multiple color themes
  • Terminal-style bottom-to-top scroll
  • File activity sidebar — see which files were touched and navigate to their tool calls
  • Embeddable via iframe
  • Live watch mode — monitor agent sessions in real time (--serve --watch)
  • Web-based editor UI for visual session editing and preview

Use cases

claude-replay is useful for:

  • Blog posts — show AI-assisted development sessions interactively
  • Documentation — embed AI debugging sessions or code walkthroughs
  • Demos — share reproducible sessions without video
  • Bug reports — attach a replay instead of long logs
  • Teaching — step through AI reasoning and tool usage
  • Live monitoring — watch agent sessions in real time on remote machines or containers

Installation

bash
npm install -g claude-replay

Or run directly with npx (zero install):

bash
npx claude-replay

Docker

bash
docker run --rm --init -p 7331:7331 \
  -v ~/.claude/projects:/root/.claude/projects:ro \
  ghcr.io/es617/claude-replay

Open http://localhost:7331 for the web editor. Session directories are mounted read-only.

For CLI usage:

bash
docker run --rm --init \
  -v ~/.claude/projects:/root/.claude/projects:ro \
  -v $(pwd):/output \
  ghcr.io/es617/claude-replay \
  /root/.claude/projects/my-project/session.jsonl -o /output/replay.html

Quick start

bash
# Launch the web editor (default)
claude-replay

# Generate a replay by session ID (auto-finds the file)
claude-replay abc123def456 -o replay.html

# Or pass the full path
claude-replay ~/.claude/projects/-Users-me-myproject/session-id.jsonl -o replay.html

# Chain multiple sessions into one replay
claude-replay session1-id session2-id -o combined.html

Running claude-replay with no arguments opens a browser-based editor that auto-discovers your Claude Code and Cursor sessions. From there you can browse, edit, preview, and export replays visually.

For CLI usage, you can pass just a session ID — claude-replay will search ~/.claude/projects/, ~/.cursor/projects/, ~/.codex/sessions/, ~/.gemini/tmp/, and the Hermes SQLite databases (~/.hermes/) to find the matching file. Or pass the full path to a session file directly.

Cursor

Cursor transcripts are also supported — the format is auto-detected. Cursor transcripts don't include timestamps, so playback uses paced timing by default (see Timing modes).

bash
claude-replay ~/.cursor/projects/*/agent-transcripts//.jsonl -o replay.html

Codex CLI

Codex CLI (OpenAI) transcripts are also supported — the format is auto-detected. Codex tool calls (exec_command, apply_patch) are mapped to their Claude Code equivalents (Bash, Edit/Write) so they render with the same diff views and command previews.

bash
claude-replay ~/.codex/sessions/2026/03/12/rollout-.jsonl -o replay.html

Gemini CLI

Gemini CLI transcripts are also supported — the format is auto-detected. Gemini stores sessions as single JSON files (not JSONL) with inline thinking blocks and tool calls. Tool names are mapped to their Claude Code equivalents (run_shell_command → Bash, read_file → Read, etc.) for consistent rendering.

bash
claude-replay ~/.gemini/tmp//chats/session-.json -o replay.html

You can also search by session ID:

bash
claude-replay  -o replay.html  # searches ~/.gemini/tmp/ automatically

OpenCode

OpenCode transcripts are supported — the format is auto-detected. OpenCode stores sessions in a SQLite database, so you'll need to export the session first using the OpenCode CLI. Thinking/reasoning blocks are rendered natively.

bash
# Export a session from OpenCode, then replay it
opencode export  > session.jsonl
claude-replay session.jsonl -o replay.html

Kimi Code

Kimi Code (Moonshot AI) transcripts are supported — the format is auto-detected. Kimi Code stores sessions as wire.jsonl under ~/.kimi-code/sessions/, with each subagent in its own agents// directory; the web editor discovers the main session alongside any subagents. Thinking blocks and tool calls are rendered natively.

Hermes Agent

Hermes Agent (Nous Research) sessions are supported two ways. On Node 22.5+, claude-replay reads the live SQLite store directly — no export needed:

bash
# By session ID (searches ~/.hermes/state.db and ~/.hermes/profiles/*/state.db)
claude-replay 20260819_142844_43efe7 -o replay.html

# Or by virtual path
claude-replay ~/.hermes/state.db#session: -o replay.html

Exported files also work: hermes sessions export --session-id --format jsonl out.jsonl, then replay out.jsonl (auto-detected). Tool names (terminal, patch, read_file, etc.) are mapped to Claude Code equivalents for consistent rendering; reasoning blocks are shown as thinking. The web editor lists Hermes sessions grouped by profile.

Web Editor

The default experience. Launch it by running claude-replay with no arguments:

bash
claude-replay
claude-replay --port 8080

The editor provides:

  • Session browser — auto-discovers sessions from ~/.claude/projects/, ~/.cursor/projects/, ~/.codex/sessions/, ~/.gemini/tmp/, and the Hermes SQLite databases (~/.hermes/), plus a folder navigator for session files stored elsewhere
  • Turn editor — include/exclude turns, edit user prompts, expand assistant blocks (read-only), add bookmarks
  • Options panel — theme, speed, thinking/tool call toggles, redaction rules, labels
  • Live preview — updates as you edit, renders the same output as the CLI
  • Export — download the final HTML replay

The editor runs a local server on 127.0.0.1 (localhost only, not exposed to the network). It never modifies your original JSONL files — all edits are held in memory and only affect the exported output.

Usage

claude-replay [--port N]                        Launch the web editor (default)
claude-replay  [input2...] [options]     Generate replay from CLI
claude-replay extract  [-o output.jsonl] [--format jsonl|json]

Each `` can be a session file path or a session ID. If it is not an existing file path, it is treated as a session ID. claude-replay searches ~/.claude/projects/, ~/.cursor/projects/, ~/.codex/sessions/, ~/.gemini/tmp/, and the Hermes SQLite databases (~/.hermes/) for a matching session file. You can find your current session ID in Claude Code by running /status.

Multiple inputs are concatenated into a single replay (up to 20). When all sessions have timestamps, turns are sorted chronologically; otherwise command-line order is used. This is useful when accepting a plan creates a new session — chain the sessions to get the full story in one replay.

Commands

editor [file|session-id]

Launches the web-based replay editor. Optionally pass a file path or session ID to auto-load it on startup. See Web Editor above.

bash
claude-replay editor                              # empty editor
claude-replay editor ~/.claude/projects/.../session.jsonl  # auto-load file
claude-replay editor abc123                       # auto-load by session ID

extract

Extract the embedded turn data from a previously generated replay HTML file. Outputs JSONL by default (one turn per line, bookmarks embedded). Use --format json for the legacy JSON format.

bash
claude-replay extract replay.html -o session.jsonl            # JSONL (default)
claude-replay extract replay.html -o data.json --format json  # JSON

# Round-trip: extract, then regenerate with different options
claude-replay extract replay.html -o session.jsonl
claude-replay session.jsonl -o new-replay.html --theme dracula

The extracted JSONL can be fed back into claude-replay to regenerate with different options. Bookmarks are preserved as a bookmark field on each turn.

Options

Flag Description
-o, --output FILE Output HTML file (default: stdout)
--turns N-M Only include turns N through M
--exclude-turns N,N,... Exclude specific turns by index
--from TIMESTAMP Start time filter (ISO 8601)
--to TIMESTAMP End time filter (ISO 8601)
--speed N Initial playback speed, e.g. 2.0 (default: 1.0)
--no-thinking Hide thinking blocks by default
--no-tool-calls Hide tool call blocks by default
--font-size SIZE Font size: small, normal, large (default: normal)
--mark "N:Label" Add a bookmark/chapter at turn N (repeatable)
--bookmarks FILE JSON file with bookmarks [{turn, label}]
--no-auto-redact Disable automatic secret redaction
--redact "text" Replace all occurrences of text with [REDACTED] (repeatable)
--redact "text=repl" Replace all occurrences of text with custom replacement (repeatable)
--title TEXT Page title (default: derived from input path)
--description TEXT Meta description for link previews (default: Interactive AI session replay)
--og-image URL OG image URL for link previews (default: hosted default). A default image is always included; to use your own, host it and pass the URL.
--user-label NAME Label for user messages (default: User)
--assistant-label NAME Label for assistant messages (default: auto-detected)
--timing MODE Timestamp mode: auto, real, paced (default: auto)
--pacing MODE paced reveal mode: sections or paced-wording (default: sections); requires --timing paced
--reading-wpm N Base paced-wording rate from 80–600 WPM (default: 238); requires --pacing paced-wording
--theme NAME Built-in theme (default: tokyo-night)
--theme-file FILE Custom theme JSON file (overrides --theme)
--no-minify Use unminified template (default: minified if available)
--no-compress Embed raw JSON instead of compressed data (for older browsers)
--open Open the generated HTML in the default browser
--serve Serve the replay on a local HTTP server instead of writing to file
--watch Watch input files for changes and auto-regenerate
--list-themes List available built-in themes and exit
--port N Port for the editor/serve server (default: 7331 editor, 7332 serve)

Examples

…

Timing modes

Th

Issues· 2 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptagentsclaude-codecodexcursor

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.