rewind
Roll back all file changes to a previous conversation turn. Tracks every
file modification made by the agent (edits, writes) and creates lightweight
git snapshots at turn boundaries. When you run /rewind, a turn selector
lets you pick a rollback point, and the working tree is restored to that
state.
/rewindShows a list of conversation turns with their modified files, most recent first. Select a turn to roll back to, confirm, and all files are restored to that point. Files created after the selected turn are deleted.
How it works
Section titled “How it works”- File tracking — Intercepts
tool_resultevents foreditandwritetools to record which files were modified each turn. - Git snapshots — At each turn boundary (
turn_end), creates a lightweight git ref viagit stash create+git update-ref. This captures the full working tree state including bash side effects. - Restore — Uses
git checkout <ref> -- .to atomically restore tracked files, then deletes files that were created after the snapshot.
Requirements
Section titled “Requirements”- Git repository — The working directory must be inside a git repo. The extension silently disables in non-git directories.
- Git in PATH — Standard git commands must be available.
Snapshot storage
Section titled “Snapshot storage”Refs are stored at refs/tallow/rewind/<session-id>/turn-<N> to avoid
collision with user refs, stashes, or other tools. Snapshot metadata is
persisted in the session via custom entries, surviving session reloads and
compaction.
Why git refs?
Section titled “Why git refs?”- Random access — Unlike stashes (LIFO), refs give O(1) access to any turn’s snapshot.
- Memory efficient — Git deduplicates file content; no in-memory copies.
- Persistent — Refs survive crashes; in-memory state doesn’t.
- Atomic —
git checkout <ref> -- .is atomic per-file.
Extension metadata
Section titled “Extension metadata”| Field | Value |
|---|---|
| Category | tool |
| Requires | git-status |