Checkpointing System
The checkpointing system provides a safe way to experiment with code changes and easily rollback to previous working states. It creates Git snapshots of your workspace before modifications, allowing you to restore to any checkpoint with full conversation history preservation.
Overviewβ
Checkpoints are automatically created during workflow execution before file modifications, and can also be manually triggered by agents. Each checkpoint captures the complete state of your workspace at a specific point in time, stored in a shadow Git repository.
Key Featuresβ
- Automatic Checkpointing: Checkpoints are created automatically before workflow steps
- Manual Checkpointing: Agents can trigger checkpoints via behavior.json
- Easy Restoration: Restore your workspace to any checkpoint with a single command
- Conversation History: Full context is preserved across checkpoint restores
- Shadow Repository: Checkpoints are stored separately from your main Git repository
CLI Usageβ
Listing Checkpointsβ
View all available checkpoints:
rad checkpoint list
Output example:
ID Commit Description Timestamp
---------------------------------------------------------------------------------------------------------
checkpoint-abc123def456 1a2b3c4d5e6f Before refactoring 2025-12-06 11:30:00
checkpoint-def456ghi789 7g8h9i0j1k2l After API changes 2025-12-06 11:35:00
Get JSON output for scripting:
rad checkpoint list --json
Restoring Checkpointsβ
Restore your workspace to a specific checkpoint:
rad checkpoint restore checkpoint-abc123def456
This will:
- Restore all files to their state at the checkpoint
- Preserve conversation history
- Display a confirmation message
Note: After restoration, you may need to re-propose tool calls if you were in the middle of agent execution.
Example Workflowβ
# Start working on a feature
rad craft REQ-001
# Checkpoints are automatically created before each step
# List checkpoints to see what's available
rad checkpoint list
# If something goes wrong, restore to a previous checkpoint
rad checkpoint restore checkpoint-abc123def456
# Continue working from the restored state
TUI Usageβ
The TUI provides a visual interface for managing checkpoints.
Opening the Checkpoint Modalβ
The checkpoint modal can be accessed during workflow execution or from the main TUI interface. It displays:
- Checkpoint List: All available checkpoints with visual indicators
- Details Panel: Information about the selected checkpoint
- Help Text: Available keyboard shortcuts
Keyboard Shortcutsβ
- β/β: Navigate through checkpoint list
- Enter: Restore selected checkpoint
- Esc: Close the modal
Visual Indicatorsβ
- β: Checkpoint is restorable
- β: Checkpoint cannot be restored (grayed out)
Checkpoint Detailsβ
The details panel shows:
- Checkpoint ID
- Checkpoint name/description
- Step number (if created during workflow)
- Restorable status
Automatic Checkpointingβ
Checkpoints are automatically created during workflow execution:
- Before Workflow Steps: A checkpoint is created before each workflow step that modifies files
- Workflow Integration: The checkpoint manager is initialized from the workspace
- State Tracking: Checkpoint metadata includes workflow ID, task ID, and agent ID
Example: Automatic Checkpoint Flowβ
User: rad craft REQ-001
β Workflow executor detects file modification step
β CheckpointManager creates Git snapshot
β Checkpoint metadata stored with unique ID
β Workflow step executes
β User can restore if needed
Manual Checkpointingβ
Agents can trigger checkpoints manually by writing a checkpoint action to behavior.json:
{
"action": "checkpoint",
"reason": "Manual review required before proceeding"
}
When an agent writes this action:
- The workflow executor detects the checkpoint behavior
- A checkpoint is created with the provided reason
- The workflow pauses for user review
- The user can restore or continue
Example: Agent-Initiated Checkpointβ
// behavior.json
{
"action": "checkpoint",
"reason": "Need to verify database schema changes before migration"
}
Shadow Repositoryβ
Checkpoints are stored in a shadow Git repository located at:
<workspace-root>/.radium/_internals/checkpoints/
This is a bare Git repository that:
- Stores all checkpoint snapshots
- Uses Git tags to identify checkpoints (format:
checkpoint-<uuid>) - Is separate from your main Git repository
- Automatically initialized on first checkpoint creation
Repository Structureβ
.radium/_internals/checkpoints/
βββ HEAD # Current branch reference
βββ config # Git configuration
βββ objects/ # Git objects (commits, trees, blobs)
βββ refs/
β βββ heads/ # Branch references
β βββ tags/ # Checkpoint tags (checkpoint-*)
βββ ...
Checkpoint Metadataβ
Each checkpoint includes:
- ID: Unique identifier (format:
checkpoint-<uuid>) - Commit Hash: Git commit hash of the snapshot
- Agent ID: ID of the agent that created the checkpoint (if applicable)
- Timestamp: Unix timestamp of creation
- Description: Optional user-provided description
- Task ID: Associated task ID (for recovery)
- Workflow ID: Associated workflow ID (for recovery)
Troubleshootingβ
"Workspace is not a git repository"β
Checkpoints require your workspace to be a Git repository. Initialize Git first:
git init
git add .
git commit -m "Initial commit"
"No checkpoints found"β
This is normal if:
- No workflows have been executed yet
- No checkpoints have been manually created
- The shadow repository hasn't been initialized
Checkpoints are created automatically during workflow execution.
"Failed to restore checkpoint"β
Possible causes:
- Checkpoint ID doesn't exist (verify with
rad checkpoint list) - Shadow repository is corrupted
- Git is not available in PATH
Try:
- Verify checkpoint exists:
rad checkpoint list - Check Git availability:
git --version - Re-initialize shadow repo (will lose existing checkpoints)
Shadow Repository Issuesβ
If the shadow repository becomes corrupted:
-
Backup existing checkpoints (if needed):
cp -r .radium/_internals/checkpoints .radium/_internals/checkpoints.backup -
Remove corrupted repository:
rm -rf .radium/_internals/checkpoints -
New checkpoints will be created automatically on next workflow execution
Best Practicesβ
-
Regular Checkpoints: Checkpoints are created automatically, but you can verify they exist with
rad checkpoint list -
Descriptive Checkpoints: When manually creating checkpoints, use descriptive reasons in behavior.json
-
Checkpoint Before Major Changes: Agents automatically create checkpoints, but you can manually trigger them before risky operations
-
Monitor Shadow Repository: The shadow repository can grow over time. Consider cleanup if disk space is a concern (cleanup functionality coming soon)
-
Version Control: The shadow repository is local-only and not tracked by Git. Don't commit
.radium/_internals/to your repository
Related Featuresβ
- Workflow Execution - How workflows create checkpoints
- Agent Behaviors - How agents trigger checkpoints
- Checkpoint Architecture - Technical implementation details
See Alsoβ
- Architecture Documentation - For developers
- CLI Commands - Complete CLI reference
- TUI Guide - Complete TUI documentation