Skip to content

Chapter 16: Checkpoints


Checkpoint Concepts

Checkpoints allow you to save and restore Claude Code's state, like game saves.

Uses:

  • Save work progress
  • Rollback to previous state
  • Branch experiments
  • Collaboration sharing

Save and Restore

Create Checkpoint

16.2 保存与恢复

bash
You: /checkpoint save feature-complete

 Checkpoint saved: feature-complete
  Location: ~/.claude-code/checkpoints/feature-complete
  Files: 12 tracked
  Context: 2,450 tokens

Restore Checkpoint

bash
You: /checkpoint restore feature-complete

 This will restore to checkpoint 'feature-complete'
  Created: 2026-01-21 10:30
  Files will be restored: 12
  Current changes will be backed up

Continue? (yes/no)
You: yes

 Checkpoint restored
  Backed up current state to: backup-20260121-143000

List Checkpoints

bash
You: /checkpoint list

Saved checkpoints:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 feature-complete
   2026-01-21 10:30 | 12 files

📌 before-refactor
   2026-01-20 15:00 | 8 files

📌 working-auth
   2026-01-19 09:15 | 15 files
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Best Practices

When to Create Checkpoints:

  • ✅ Before completing major features
  • ✅ Before large refactorings
  • ✅ Before experimental changes
  • ✅ At end of workday

Naming Conventions:

  • Use descriptive names
  • Include date or version
  • Examples: auth-feature-v1, pre-refactor-20260121

Summary

In this chapter, we learned:

  • ✅ Checkpoint concepts and uses
  • ✅ Save, restore, list checkpoints
  • ✅ Best practices

Next Step: Chapter 17 is the Plugin Reference!


Content is for learning and research only.