rewind
Time-travel debugger and shareable replay for Claude Code sessions.
pip install rewindx # PyPI package; binary is `rewind`
rewind cc setup # wires up Claude Code hooks (idempotent)
# ...use Claude Code normally...
rewind tui # browse the most recent session
rewind goto 6 # restore the file system to just before event #6
rewind export --format markdown --out session.md
Local-first, no API keys, MIT licensed.
What it does
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 event store with content-addressed blobs.
-
Recovery —
rewind goto <seq>restores the file system to any prior point. Each rollback creates a checkpoint sorewind undois one command: -
Shareable replay —
rewind exportrenders the session as a privacy-masked Markdown or text transcript. (GIF and MP4 backends ship in 0.2.)
Status
Pre-launch alpha (v0.1.0). The core pipeline is production-grade: 131 tests, 87% branch coverage, mypy strict, ruff clean, multi-OS / multi-Py CI. The non-interactive TUI is what you see above; full scrubbable TUI lands in 0.2.
What it captures
| Hook | Stored event | Snapshots |
|---|---|---|
| SessionStart | session_start |
— |
| UserPromptSubmit | user_prompt |
— |
| PreToolUse | pre_tool |
before-content of every Edit / Write / MultiEdit 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 sensible 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 exportmasks file contents to head/tail and redacts env-shaped secrets by default. Pass--no-maskto opt out explicitly.- Add
.rewind/to.gitignoreif you keep a per-project home.
Documents
- PLAN.md — product plan and pitch
- docs/ARCHITECTURE.md — schemas, data flow, modules
- docs/ROADMAP.md — six-phase roadmap
- docs/LAUNCH.md — pre-launch + launch playbook
- docs/DECISIONS.md — ADRs
- docs/NAMING.md — name candidates and verification
- CHANGELOG.md
- CONTRIBUTING.md
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.
Release files for rewindx 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rewindx-0.1.4.tar.gz | 40.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rewindx-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.9 kB
Release files / rewindx-0.1.4.tar.gz
| Download URL | rewindx-0.1.4.tar.gz |
|---|---|
| Size | 40.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88ae9121455fd4e3e0eba3e144896b23b70267311e40731dc2954d12e1432621
|
|
BLAKE2b-256 checksum How to use checksums |
6c7c67e59fc692c8c054fe6c06332f21600ec29861560c4e8fafcf089eaa25c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / rewindx-0.1.4-py3-none-any.whl
| Download URL | rewindx-0.1.4-py3-none-any.whl |
|---|---|
| Size | 45.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f969b80d0979ed6ef04336af5c7e262e2d82f78f3ccfe30b7bc3ad1606d5a20e
|
|
BLAKE2b-256 checksum How to use checksums |
eb4786c9bd8fc934e5da26c4421437cc9959bf75b810460ced3f6c83da8cfac2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|