> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# checkpoints • AI Agent SDK

> Checkpoints Module for PraisonAI Agents.

# checkpoints

<Badge color="blue">AI Agent</Badge>

Checkpoints Module for PraisonAI Agents.

Provides file-level checkpointing using a shadow git repository to track
and restore file changes made by agents. This enables:

* Automatic checkpointing before file modifications
* Rewind to any previous checkpoint
* Diff between checkpoints
* Restore files and conversation state together

Zero Performance Impact:

* All imports are lazy loaded via **getattr**
* Checkpoints only created when enabled
* No overhead when checkpoints are disabled

Usage:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.checkpoints import CheckpointService

# Create checkpoint service
service = CheckpointService(
    workspace_dir="/path/to/project",
    storage_dir="~/.praisonai/checkpoints"
)

# Initialize shadow git
await service.initialize()

# Save a checkpoint
checkpoint_id = await service.save("Before refactoring")

# Restore to a checkpoint
await service.restore(checkpoint_id)

# Get diff between checkpoints
diff = await service.diff(from_id, to_id)
```

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import checkpoints
```
