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")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
action | "save" | "restore" | required | Operation to perform |
When to use
Section titled “When to use”- 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; usecode_checkpointto snapshot the graph - In long sessions, saving a checkpoint before
/clearlets you restore context efficiently withcode_checkpoint(action="restore")in the new session