Skip to main content

Time-travel debugger and shareable replay for Claude Code sessions.

Project description

rewind

Time-travel debugger and shareable replay for Claude Code sessions.

Capture every event in a Claude Code session, scrub through the timeline, roll back the file system to any point in seconds, and export a shareable transcript. Local-first, no API keys, MIT licensed.

pip install rewindx       # PyPI package; binary is `rewind`
rewind cc setup           # wire up Claude Code hooks (idempotent)
# ...use Claude Code normally...
rewind tui                # browse the most recent session
rewind goto 31            # restore the file system to just before event #31
rewind export --format markdown --out session.md

Why

Claude Code does dozens of tool calls per session. The agent's transcripts are JSONL, hard to read, and impossible to replay. git diff shows files but not the reasoning. When the agent breaks something subtle, you have nothing to fall back on. rewind closes that loop:

  • Observability — every prompt, tool call, file edit, and cost recorded in a per-session SQLite + content-addressed blob store.
  • Recoveryrewind goto <seq> restores the file system to any prior point. Every rollback creates a checkpoint so rewind undo is one command.
  • Shareable replayrewind export renders the session as a Markdown transcript (text, GIF, and MP4 backends are scaffolded for V0.2). Privacy filters mask file contents and env-shaped secrets by default.

Status

Pre-launch alpha (v0.1.0). The core pipeline is production-grade: 131 tests, 87% branch coverage, mypy strict, ruff clean. The interactive TUI ships in V0.2; V0.1 prints the timeline and event detail to the terminal.

What it captures

Hook Stored event Snapshots
SessionStart session_start
UserPromptSubmit user_prompt
PreToolUse pre_tool before-content of every Edit / Write path
PostToolUse post_tool after-content + classification (productive / wasted / neutral)
Stop session_end totals (cost, tokens, events)

CLI

rewind --version
rewind cc {setup,uninstall,status} [--scope user|project]
rewind capture {session-start,user-prompt,pre-tool,post-tool,session-end}    # reads stdin
rewind sessions {list,show,delete}
rewind tui [SESSION_ID] [--seq N]
rewind goto SEQ [--session ID] [--cwd PATH] [--force] [--dry-run]
rewind undo
rewind stats [SESSION_ID] [--json]
rewind export [SESSION_ID] [--format text|markdown] [--out PATH] [--no-mask]

Storage layout

~/.rewind/
├── config.toml                  # optional, all fields have defaults
├── current_session.txt          # active session id
├── checkpoints/                 # one JSON per rollback (used by `rewind undo`)
└── sessions/
    └── <session_id>/
        ├── events.db            # SQLite, WAL mode, schema v1
        └── blobs/<aa>/<bb>/<sha256>

Per-session storage isolates blast radius: deleting one session is one rm -rf, nothing else is affected.

Privacy

  • Local-only: zero network calls. No telemetry. Ever.
  • rewind export masks file contents to head/tail and redacts env-shaped secrets by default. Use --no-mask to opt out explicitly.
  • .gitignore template: add .rewind/ if you keep a per-project home.

Documents

Sister projects

rewind is one corner of an ecosystem of open-source tools for Claude Code:

Project Concern Repo
spent cost tracking https://github.com/loplop-h/spent
debtx code quality https://github.com/loplop-h/debtx
mcpguard MCP security https://github.com/loplop-h/mcpguard
rewind observability + recovery (this repo)

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rewindx-0.1.0.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rewindx-0.1.0-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file rewindx-0.1.0.tar.gz.

File metadata

  • Download URL: rewindx-0.1.0.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for rewindx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 301341c2dee972aa6c76df55b389e3eb9cf32c9a9a7956d476a6f37580cfcdc7
MD5 140eadabc6c4b418c19328d99c345c09
BLAKE2b-256 facebb69982c5ced27852148811c45ea2df860e0e97ed8a4262c9502ff6cf348

See more details on using hashes here.

File details

Details for the file rewindx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rewindx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for rewindx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2273918b2733c47b5108eb0c20536ba31caf7a55a42fc31c23205c73fe4d02c6
MD5 73fd6a932b8ac2e7b1fe96e470bd17d8
BLAKE2b-256 b2b191ce8cf6b1dde936c997b971fe1df831fe96744aacb7e10660778f82057a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page