Skip to main content

agent-replay

Replay, scrub and share AI coding-agent sessions as one self-contained HTML file.

# install once (the PyPI package is called agent-reel; the command is agent-replay)
uv tool install agent-reel          # or: pipx install agent-reel / pip install agent-reel

agent-replay latest                 # replay your most recent Claude Code session
agent-replay <session-id> -o replay.html
agent-replay --list                 # recent Claude Code, Codex and Cursor sessions (10 each; --limit N)
agent-replay cursor:latest          # your latest Cursor chat
agent-replay codex:latest           # your latest Codex CLI session
agent-replay <session-id> --fork-at 42 -o context.md   # export steps 1-42 as Markdown

# or run without installing
uvx --from agent-reel agent-replay latest

agent-replay demo: scrubbing through a session, filtering to Edit calls, forking from a step

The demo is a fully synthetic session: examples/demo-session.jsonl (regenerate with python examples/make_demo_session.py). Try the real viewer on it with agent-replay examples/demo-session.jsonl --open, or open the rendered docs/index.html (GitHub Pages: serve the /docs folder).

Why

Agent runs are long, opaque and hard to share. agent-replay turns a session log into a single HTML file you can open anywhere, attach to a PR, or post in a thread: no server, no account, no network calls.

Features (v0.1)

  • Timeline + scrubber: prompts, replies, thinking, tool calls and results; play, step, or drag
  • File diffs for every Edit / MultiEdit / Write, colored inline
  • Summary header: duration, prompts, tool calls, files touched, lines +/−, tokens, errors
  • Fork from here: pick any step and export the conversation up to it as Markdown context you can paste into a new agent session (button in the viewer, or --fork-at N on the CLI)
  • Filter chips per event type and tool (Edit, Write, Bash, …), color-coded; navigation skips hidden events
  • Idle-gap markers: long pauses (resumed sessions) show as "⏸ 3 days later" and don't inflate timestamps
  • Search across the whole session; keyboard nav (←/→, j/k, space, Home/End)
  • Secret redaction on by default: API keys, tokens, private keys, URL credentials, *_PASSWORD= style assignments and high-entropy strings are masked
  • Zero dependencies, light/dark theme, works fully offline

Privacy

Cursor's database also holds your login tokens. agent-replay opens it read-only and only reads composerData: / bubbleId: keys (a test enforces this).

Sessions contain your code, prompts and sometimes secrets. Redaction is best-effort, not a guarantee: skim a replay before sharing it publicly. Use --no-redact only for your own eyes.

Supported agents

Agent Status
Claude Code (~/.claude/projects/**/*.jsonl) ✅
Aider (.aider.chat.history.md) ✅ agent-replay path/to/repo. Edits are rebuilt from SEARCH/REPLACE blocks; the log has no per-message timestamps or token counts
Codex CLI (~/.codex rollout files) ✅ agent-replay codex:latest, or codex:<id> from --list (also found via $CODEX_HOME). apply_patch becomes Edit/Write/Delete with diffs, shell calls become Bash. Built from the documented rollout format; not yet verified against many real sessions, so please open an issue if one renders wrongly
Cursor (chat database state.vscdb) ✅ agent-replay cursor:latest, or cursor:<id> from --list. Read-only; only chat keys are read. Tool names are normalized (Read/Edit/Bash/…). Subagent chats are followed: their steps appear under the Agent call, tagged subagent (and left out of --fork-at context)
Codex CLI, … 🙋 contributions welcome, see below

Claude Code's log format isn't a stable API, so the parser is lenient and skips what it doesn't understand. If a new version breaks something, please open an issue with an anonymized sample.

Architecture

logs ──▶ parsers/<agent>.py ──▶ Session/Event (models.py) ──▶ redact ──▶ analyze ──▶ render ──▶ .html

Only parsers/ knows about a specific agent. To add one, write a module that returns a Session and register it in parsers/__init__.py.

Development

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -q && ruff check .

Roadmap

  • Fork-from-step: export the conversation up to step N as Markdown context
  • Run-vs-run diff
  • Aider
  • Cursor
  • Codex CLI
  • More agents (Gemini CLI, Copilot CLI)
  • Live tailing of a running session

Contributing

Re-record the demo GIF with python scripts/make_demo_gif.py docs/index.html docs/demo.gif (needs pip install playwright pillow && playwright install chromium).

License

MIT

Metadata

Release files for agent-reel 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-reel 0.1.0
File Size Uploaded Provenance Actions
agent_reel-0.1.0.tar.gz 801.2 kB With provenance Details for agent_reel-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-reel 0.1.0
File Interpreter ABI Platform Actions
agent_reel-0.1.0-py3-none-any.whl Python 3 none any Details for agent_reel-0.1.0-py3-none-any.whl

Total release size: 841.2 kB

Release files / agent_reel-0.1.0.tar.gz

Download URL agent_reel-0.1.0.tar.gz
Size 801.2 kB
Tags Source
SHA-256 checksum
How to use checksums
33668f354d956f763ad2eb59ac52813597fa9815113267ec06e45ba93dcb9c6b
BLAKE2b-256 checksum
How to use checksums
279d9321c24213a271eb23b1f9d570b485a9f204d7ea3b76ff81622e834875d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / agent_reel-0.1.0-py3-none-any.whl

Download URL agent_reel-0.1.0-py3-none-any.whl
Size 40.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fd05b1d488095489333e1ee56141aedfdf783d40d1d7175ca0a035dcaa6d8c7
BLAKE2b-256 checksum
How to use checksums
346a2fb25c463de11f86efbcf54c8b5e1041521b851a15e71f8fded40447565d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for agent-reel 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_reel-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page