Skip to content

code_checkpoint

code_checkpoint saves the current state of the project graph to a named snapshot, or restores a previously saved snapshot. Use it before large refactors so you can return to a known-good state if needed.

code_checkpoint(action="save")
code_checkpoint(action="restore")
ParameterTypeDefaultDescription
action"save" | "restore"requiredOperation to perform
  • Before a large-scale refactor — save a checkpoint, work, restore if something goes wrong
  • Before running automated code generation that will change many files
  • When experimenting with significant architectural changes
  • Checkpoints capture the graph index state, not the source files themselves
  • Use version control (git) to snapshot file state; use code_checkpoint to snapshot the graph
  • In long sessions, saving a checkpoint before /clear lets you restore context efficiently with code_checkpoint(action="restore") in the new session