Checkpoints
Command Code automatically creates checkpoints before modifying files, allowing you to restore your project to any previous state. Think of it as undo on steroids - you can rewind both your files and conversation history.
- Automatic backups: Every time Command Code edits a file, it backs up the original content first
- Checkpoint creation: A checkpoint snapshot is created on each user message
- Instant restore: Rewind to any checkpoint to restore files, conversation, or both
Keyboard Shortcut
Press Esc twice quickly (double-tap) to open the checkpoint selector.
Slash Command
/rewind
When you select a checkpoint, choose what to restore:
| Mode | What It Does |
|---|---|
| Conversation only | Removes all messages after the checkpoint. Code remains unchanged. |
| Code only | Restores all code to its state at the checkpoint. Conversation remains intact. |
| Both | Restores both code and conversation to the checkpoint state. |
Code
- Code files modified after the checkpoint are restored to their original content
- Files created after the checkpoint are deleted
- Files that existed at the checkpoint but were deleted are restored
Conversation
- All messages after the selected checkpoint are removed
- The checkpoint itself is removed (you're rewinding to before that message)
- Context token count is updated to reflect the shorter conversation
Each checkpoint shows:
- Timestamp: When the checkpoint was created
- Your message: Preview of what you asked (truncated to 60 chars)
- Files changed: Number of files that were modified in that checkpoint
- Code changes: Indicates if code was modified (used to filter restore options)
| Limitation | Details |
|---|---|
| Max file size | Files larger than 10MB are not backed up |
| Session scope | Checkpoints are per-session only |
| Disk space | If disk is full, checkpointing pauses (you'll see a notice) |
Restores are designed to be safe:
- Verify first: Before restoring, Command Code verifies all backup files exist and are readable
- All or nothing: If any file can't be restored, the entire operation is aborted
- Clear errors: You'll see exactly which files couldn't be restored and why
New Files
If Command Code created a new file after a checkpoint and you restore to before that point:
- Code only or Both: The new file is deleted
- Conversation only: The file remains
Disk Full
If your disk runs out of space:
- Checkpointing pauses automatically
- You'll see a notice in the UI
- Existing checkpoints remain usable
- Once space is freed, checkpointing resumes
Binary Files
Binary files (images, compiled files, etc.) are backed up the same as text files. No special handling needed.
Checkpoints not appearing
- Ensure you've sent at least one message in the session
- Check if checkpointing is paused (disk full notice)
- Verify the session has file modifications
Restore failed
- Check the error message for which file failed
- Ensure backup files haven't been manually deleted from
~/.commandcode/file-history/ - Verify you have write permissions to the target files
Double-Esc not working
- Press Esc twice within 500ms
- Ensure focus is on the Command Code input
- Try using
/rewindcommand instead
- Try creating a checkpoint by asking Command Code to modify a file
- Join our Discord community for support