Checkpoints and rewind
Before any turn that is allowed to change files actually runs, tCode snapshots your entire working tree into a git commit, so that turn's changes can always be undone afterward even after you have already approved them.
- How checkpoints are stored without touching your own git state
- If the folder is not a git repository yet
- Undoing with /rewind
- Which turns actually get a checkpoint
- Why checkpoints happen before a turn, not after
- Checkpoints are local to the machine and folder
- Why a checkpoint captures the whole tree
- Why this makes approving low-stakes
How checkpoints are stored
These checkpoint commits are stored using git's own object model, but deliberately kept out of your way: they are created with a temporary, throwaway index file rather than your project's real staging area, so a checkpoint never interferes with anything you are doing with git yourself in the same repository at the same time, a change you have staged, a branch you are mid-rebase on, none of it is touched.
If the folder is not a git repository yet
If the folder you are working in is not already a git repository, tCode offers to initialize one the first time it starts there, specifically so checkpoints have somewhere to live.
Undoing with /rewind
This restores your working tree to exactly how it was before that turn started: anything the turn created is deleted, anything it edited or deleted is restored to its prior contents.
Which turns actually get a checkpoint
Only turns that were actually allowed to change something get a checkpoint.
Why checkpoints happen before a turn, not after
A checkpoint is created before a turn runs, not after, which is deliberate: it protects against the turn's changes themselves, not just against tCode crashing partway through.
Checkpoints are local to the machine and folder
Checkpoints are local to the machine and the folder they were created in; they are not synced anywhere and do not depend on network access to restore from, since they are ordinary commit objects sitting in your own repository's git database.
Why a checkpoint captures the whole tree
A checkpoint captures the entire working tree at that moment, not just the files a given turn is expected to touch, which is what makes /rewind reliable even when a turn ends up editing something unexpected partway through.
Why this makes approving low-stakes
It is worth internalizing that checkpoints exist specifically because approval at the permission prompt is not meant to be a high-stakes, unrecoverable decision.