Shadow Git Checkpointing
The Checkpoints feature provides file-level undo/restore capabilities using a shadow git repository. This enables automatic checkpointing before file modifications, allowing you to rewind to any previous state.Quick Start
Agent-Centric Usage
Overview
Checkpoints allow you to:- Save snapshots of your workspace before changes
- Restore files to any previous checkpoint
- Diff between checkpoints to see what changed
- Track all file modifications made by agents
CLI Commands
Configuration
workspace_dir: Directory to trackstorage_dir: Where to store checkpoint data (default:~/.praisonai/checkpoints)enabled: Enable/disable checkpointsauto_checkpoint: Auto-checkpoint before file modificationsmax_checkpoints: Maximum checkpoints to keep
Data Types
Checkpoint
CheckpointDiff
Best Practices
- Checkpoint before major changes - Save before refactoring or large edits
- Use descriptive messages - Makes it easier to find the right checkpoint
- Don’t checkpoint too frequently - Balance between safety and storage
- Clean up old checkpoints - Use
deletewhen no longer needed - Check diff before restore - Verify you’re restoring to the right state
Low-level API Reference
CheckpointService Direct Usage
Methods
initialize()
Initialize the checkpoint service:save(message, allow_empty=False)
Save a checkpoint:restore(checkpoint_id)
Restore to a checkpoint:diff(from_id=None, to_id=None)
Get diff between checkpoints:list_checkpoints(limit=50)
List all checkpoints:Event Handlers
Subscribe to checkpoint events:Zero Performance Impact
The checkpoint system is designed for minimal overhead:- Lazy loading: All imports via
__getattr__ - Async operations: Non-blocking git operations
- Incremental commits: Only changed files are tracked
- Configurable limits: Control max checkpoints to manage storage

