> ## 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.

# snapshot • AI Agent SDK

> Snapshot Module for PraisonAI Agents.

# snapshot

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

Snapshot Module for PraisonAI Agents.

Provides file change tracking using a shadow git repository,
enabling undo/restore capabilities without affecting the user's
actual git repository.

Features:

* Shadow git repository for tracking changes
* File diff generation
* Snapshot creation and restoration
* Session-based change tracking
* Zero interference with user's git repos

Usage:
from praisonaiagents.snapshot import FileSnapshot

# Initialize for a project

snapshot = FileSnapshot("/path/to/project")

# Track current state

hash = snapshot.track()

# Get diff from a snapshot

diff = snapshot.diff(hash)

# Restore to a snapshot

snapshot.restore(hash)

## Import

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