Skip to main content

Checkpoints Module

The checkpoints module provides file-level checkpointing using a shadow git repository to track and restore file changes made by agents.

Installation

Features

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

Quick Start

Classes

CheckpointService

Main service for managing checkpoints.

Constructor

Methods

Checkpoint

Represents a single checkpoint.

Attributes

CheckpointDiff

Diff between two checkpoints.

Attributes

CheckpointConfig

Configuration for checkpoint service.

Attributes

CheckpointEvent

Events emitted by the checkpoint service.

Usage Examples

Basic Checkpointing

With Agent

Automatic Checkpointing

Excluding Files

Best Practices

  1. Initialize early - Initialize checkpoint service before agent starts
  2. Meaningful messages - Use descriptive checkpoint messages
  3. Exclude large files - Exclude logs, dependencies, build artifacts
  4. Limit checkpoints - Set max_checkpoints to prevent disk bloat
  5. Regular cleanup - Delete old checkpoints periodically
  • Agent - Using checkpoints with agents
  • Session - Session management