Files
ruflo/docs/examples/CHECKPOINT_SYSTEM_DEMO.md
T

2.6 KiB

🎯 Git Checkpoint System - Working Demo

✅ System is Working!

The checkpoint system is now fully operational. Here's what just happened:

1. Created Files and Checkpoints

# Created demo.txt
echo "Hello World" > demo.txt
./.claude/helpers/checkpoint-hooks.sh post-edit '{"file_path": "demo.txt"}'
✅ Created checkpoint: checkpoint-20250730-201138

# Created example-file.js
# checkpoint-20250730-201233

# Modified example-file.js (added farewell function)
# checkpoint-20250730-201250

2. Current Checkpoints

Git Tags:
- checkpoint-20250730-201250 (latest - added farewell function)
- checkpoint-20250730-201233 (created example-file.js)
- checkpoint-20250730-201138 (created demo.txt)

3. View Changes Between Checkpoints

# See what changed since creating example-file.js
./.claude/helpers/checkpoint-manager.sh diff checkpoint-20250730-201233

# Shows: Added farewell function

4. Rollback Examples

Safe Rollback (Create Branch)

# Create a new branch from checkpoint
./.claude/helpers/checkpoint-manager.sh rollback checkpoint-20250730-201233 --branch

File-Specific Rollback

# Restore just one file from checkpoint
git checkout checkpoint-20250730-201233 -- example-file.js

Hard Reset (Careful!)

# Reset entire repo to checkpoint (destructive)
./.claude/helpers/checkpoint-manager.sh rollback checkpoint-20250730-201233 --reset

🚀 Using with Claude Code

Option 1: Simple Configuration

# Copy simple settings
cp .claude/settings-checkpoint-simple.json .claude/settings.json

Option 2: Advanced Configuration

# Use setup script
./.claude/helpers/setup-checkpoints.sh
# Choose option 1 or 2

📋 Quick Reference

Create Manual Checkpoint

# For any file
./.claude/helpers/checkpoint-hooks.sh post-edit '{"file_path": "path/to/file"}'

# For task start
./.claude/helpers/checkpoint-hooks.sh task "Description of task"

# For session end
./.claude/helpers/checkpoint-hooks.sh session-end

List & Manage

# List all checkpoints
./.claude/helpers/checkpoint-manager.sh list

# Show specific checkpoint
./.claude/helpers/checkpoint-manager.sh show checkpoint-YYYYMMDD-HHMMSS

# Compare with checkpoint
./.claude/helpers/checkpoint-manager.sh diff checkpoint-YYYYMMDD-HHMMSS

# Clean old checkpoints
./.claude/helpers/checkpoint-manager.sh clean 7  # older than 7 days

🎉 Success!

The checkpoint system is now:

  • ✅ Creating tags correctly
  • ✅ Storing metadata
  • ✅ Tracking changes
  • ✅ Providing rollback options
  • ✅ Ready for Claude Code integration

Start using it to never lose work again!