Releases: arpagon/pi-rewind
v0.5.0
Changes
- Adapt to pi session event removal: Remove
session_switch/session_forkhandlers (removed upstream by @badlogicgames) - Consolidate into
session_startwithevent.reason(startup|reload|new|resume|fork) - Headless checkpoint support: Enable checkpoint creation in print mode (removed
ctx.hasUIguard from git operations, kept only for UI calls) - E2E test suite: Added
tests/e2e.sh— 16 tests covering resume checkpoints, write/edit/bash mutations, ignored file exclusion, dedup, untracked file preservation
v0.4.1
v0.4.0 — Performance: auto-prune + smart dedup
Performance fixes for large repos
Tested on 87GB / 182K files monorepo (emilia-vision):
1. Auto-prune old sessions
On session start, all checkpoints from previous sessions are deleted in the background. No more accumulating hundreds of stale refs.
- Before: 525 refs →
loadAllCheckpointstook 4,000ms at startup - After: only current session → 8ms
2. Smart checkpoint dedup
Compares worktree tree SHA after creating checkpoint. If identical to previous (read-only bash like ls, find, cat), checkpoint is deleted immediately.
- Before: every
bashtool created a checkpoint - After: only when files actually change
3. Lower default limit
DEFAULT_MAX_CHECKPOINTS: 100 → 50 per session
Benchmark numbers
| Repo size | createCheckpoint | loadAll (startup) |
|---|---|---|
| Small (20 files) | 62ms | 8ms |
| Medium (500 files) | 62ms | 8ms |
| Large (5,000 files) | 60ms | 8ms |
| Real (182K files, 87GB) | 142ms | 8ms |
createCheckpoint = ~60-142ms constant → direct latency added per turn. Imperceptible.
pi install npm:pi-rewindv0.3.2 — Smart checkpoint dedup
Checkpoints now only created when files actually change.
Before: bash: ls, bash: find, bash: cat all triggered checkpoints (false positives during planning/exploration).
After: Worktree tree SHA compared after checkpoint creation — if identical to previous, checkpoint is deleted immediately. Only real file changes create checkpoints.
Tested: 5-turn session with mix of read-only and write turns → 3 checkpoints (resume + 2 real changes) instead of 5.
v0.3.1 — Branch labels in /rewind picker
Branch name now visible in the checkpoint picker:
[feature]for same-branch checkpoints⚠️ mainfor cross-branch checkpoints (restore will be blocked)
Makes it immediately obvious which checkpoints are safe before you even select them.
v0.3.0 — Branch Safety
🛡️ Branch Safety (OpenCode Bug Fix)
Problem: Restoring a checkpoint created on branch A while on branch B silently corrupts the worktree — brings files from the wrong branch and detaches HEAD. OpenCode has this exact bug. Cline avoids it by using a separate shadow git repo.
Solution:
- Branch name is now stored in checkpoint metadata (persisted in git refs)
restoreCheckpoint()verifies branch matches before restore- Clear error message if mismatch: "Switch to X first, or this restore could corrupt your worktree"
Changes
core.ts: Addedbranchfield toCheckpointData, captured at create, validated at restoretests/core.test.ts: New test "restore blocks cross-branch restore" (20/20 passing)- Updated README, landing page, comparison tables
Install
pi install npm:pi-rewindv0.2.2 — OIDC test
Testing Trusted Publishing OIDC
v0.2.1 — CI publish test
Testing CI npm publish with Granular token
v0.2.0 — 1 checkpoint per turn, descriptive labels, diff preview
What's New
Checkpoint Strategy (research-backed)
- 1 checkpoint per turn — matches Cline's approach (researched 11 agents)
- ~23 checkpoints → ~3 per conversation
- Read-only turns skip checkpointing
Descriptive Labels
"fix the bug" → edit → src/foo.ts, bash: npm test- Persisted in git refs (survive restarts)
Diff Preview
/rewindshows diff before confirming restore
Full Features
/rewind, Esc+Esc, restore modes, redo stack, safe restore, smart filtering, resume checkpoint, footer status, auto-pruning, fork/tree integration, 19 tests, 0 deps