Checkpoints for programs
Syntic Code keeps a backup of each file its file tools change, so a session’s edits can be undone. This page explains what that covers when a program runs the agent, and where the limits are.
Interactive sessions record checkpoints; print runs do not
An interactive session records a checkpoint of each file before its file tools change it. A -p run does not record them, so a program cannot undo a print run’s file changes through syntic.
For a session that has checkpoints, a script can restore the files without opening it: syntic --resume <session-id> --rewind-files <message-id> puts every file the agent changed at or after that message back, removes files it created, and exits. The conversation is not changed.
If a program needs to undo changes, use one of these:
- Run the task in a git worktree or on a branch, and discard it with git.
- Make the change on a copy of the folder, and copy the result back only if the checks pass.
- Commit before the run, so
git restoreorgit checkoutcan return the files.
Checkpoints are a quick undo, not version control. Commit to git before a run for anything you want to keep.
What is covered
Rewind restores files changed by the file tools: Write, Edit, MultiEdit and NotebookEdit. A file the agent created is deleted again on restore.
It does not undo:
- changes made by shell commands, such as
rm,mv, code generators, package installs or database migrations; - anything outside the working folders;
- edits made outside Syntic Code, while or after the run;
- remote effects such as pushed commits or deployed services.
Edits made by hand are protected
When a run ends, Syntic Code notes how it left each file it changed. If the file changes afterwards, a restore stops before touching anything and names the files. A restore never overwrites a person’s own edit unless it is told to.
Restoring in the interactive CLI
The CLI has a rewind picker and a set of /rewind commands for browsing and restoring checkpoints. These are described in the checkpoints reference.
What a program can rely on
- A file the agent changed during an interactive session can be restored to its state before a given message.
- A file changed by a print run cannot be restored with
/rewind. Use version control for it. syntic --resume <id> --rewind-files <message-id>restores an interactive session’s files from a shell command.