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.


  1. Automatic backups: Every time Command Code edits a file, it backs up the original content first
  2. Checkpoint creation: A checkpoint snapshot is created on each user message
  3. 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:

ModeWhat It Does
Conversation onlyRemoves all messages after the checkpoint. Code remains unchanged.
Code onlyRestores all code to its state at the checkpoint. Conversation remains intact.
BothRestores 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)

LimitationDetails
Max file sizeFiles larger than 10MB are not backed up
Session scopeCheckpoints are per-session only
Disk spaceIf disk is full, checkpointing pauses (you'll see a notice)

Restores are designed to be safe:

  1. Verify first: Before restoring, Command Code verifies all backup files exist and are readable
  2. All or nothing: If any file can't be restored, the entire operation is aborted
  3. 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

  1. Ensure you've sent at least one message in the session
  2. Check if checkpointing is paused (disk full notice)
  3. Verify the session has file modifications

Restore failed

  1. Check the error message for which file failed
  2. Ensure backup files haven't been manually deleted from ~/.commandcode/file-history/
  3. Verify you have write permissions to the target files

Double-Esc not working

  1. Press Esc twice within 500ms
  2. Ensure focus is on the Command Code input
  3. Try using /rewind command instead

  • Try creating a checkpoint by asking Command Code to modify a file
  • Join our Discord community for support