Skip to content
pi-c Rewind: file history and restores
Login

Rewind: file history and restores

Status: built 2026-11-22 (ticket 29). Tier: core (src/filelog.c: the record and the restore) and bundled (src/rewind.c: what to restore and when to refuse). Clock: durability. Record: pic_file_change per write or edit and per restored file, pic_blob for kept bytes, pic_restore per restore. Default: on, rewindMaxBytes 1 MiB.

What it is

Claude Code's checkpoints, over pic's journal: go back to before a user message and restore the conversation, the files, or both. The user-facing description is rewind; the commit points are in durability.

Core records and enforces

What is left to chance

The component decides

rewind.c picks the files (every write and edit on the conversation's path after the message), the target of each (the earliest such call's pre-image), the refusals (the file is not what the conversation last left there, counting its own restores; one of those changes found the file other than the change before left it, so something outside pic wrote in between; its earlier bytes were not kept; its call never finished), and whether to go on past them (--force-partial, or a yes in the terminal). The conversation half is pic_fork at the message's parent, as /fork does. Undo restores the pre-images of the latest restore's restored files.

Decisions