Skip to content

Releases: arpagon/pi-rewind

v0.5.0

31 Mar 19:05

Choose a tag to compare

Changes

  • Adapt to pi session event removal: Remove session_switch/session_fork handlers (removed upstream by @badlogicgames)
  • Consolidate into session_start with event.reason (startup|reload|new|resume|fork)
  • Headless checkpoint support: Enable checkpoint creation in print mode (removed ctx.hasUI guard 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

12 Mar 02:52

Choose a tag to compare

chore: add pi-package to npm keywords

v0.4.0 — Performance: auto-prune + smart dedup

03 Mar 21:12

Choose a tag to compare

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 → loadAllCheckpoints took 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 bash tool 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-rewind

v0.3.2 — Smart checkpoint dedup

03 Mar 18:30

Choose a tag to compare

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

24 Feb 19:57

Choose a tag to compare

Branch name now visible in the checkpoint picker:

  • [feature] for same-branch checkpoints
  • ⚠️ main for 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

24 Feb 19:24

Choose a tag to compare

🛡️ 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: Added branch field to CheckpointData, captured at create, validated at restore
  • tests/core.test.ts: New test "restore blocks cross-branch restore" (20/20 passing)
  • Updated README, landing page, comparison tables

Install

pi install npm:pi-rewind

v0.2.2 — OIDC test

24 Feb 18:31

Choose a tag to compare

Testing Trusted Publishing OIDC

v0.2.1 — CI publish test

24 Feb 18:23

Choose a tag to compare

Testing CI npm publish with Granular token

v0.2.0 — 1 checkpoint per turn, descriptive labels, diff preview

24 Feb 18:19

Choose a tag to compare

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

  • /rewind shows 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