7.3 Checkpointing
Course: Claude Code - Power User Section: Session Management Video Length: 2-5 minutes Presenter: Daniel Treasure
Opening Hook
Checkpointing is your safety net. Save snapshots of your work, try risky changes, and rewind to a known-good state instantly if something goes wrong.
Key Talking Points
1. What is Checkpointing?
- Checkpointing saves a snapshot of your conversation state at a specific point in time
- Captures full conversation context, referenced files, and all decisions made up to that point
- Allows you to revert files and conversation history without losing work
- Useful before making risky changes, refactoring, or experimenting
What to say: "Checkpointing is like creating a savepoint in a game. You can take a risky path, and if it doesn't work, reload to your last checkpoint without losing progress."
What to show on screen: Show a Claude Code conversation with several messages. Highlight where a user might want to create a checkpoint (before a complex refactor, before experimental code).
2. Creating Checkpoints in VS Code Extension
- Hover over any message in the conversation thread
- Click the rewind icon that appears
- Three checkpoint options appear
- Takes about 1 second to create
What to say: "Creating a checkpoint is one click. Just hover over a message and click the rewind button. Claude immediately saves that state."
What to show on screen: Demonstrate hovering over a message in Claude Code. Show the rewind options appearing. Click to create a checkpoint and show confirmation.
3. Rewind Code Option
- "Rewind code" reverts modified files to the state at that checkpoint
- Keeps your conversation history intact
- Lets you see what Claude suggested but revert to a safe version
- Useful when code changes are problematic but the conversation is valuable
What to say: "Rewind code lets you undo changes to your files while keeping the conversation. You can reference what was discussed, but the code goes back."
What to show on screen: Make a code change via Claude Code. Then hover over an earlier message and select "Rewind code". Show the files reverting while the conversation remains.
4. Fork Conversation Option
- "Fork conversation" creates a new session branch from that point
- Code changes stay applied
- New messages branch off separately
- Original conversation path is preserved
What to say: "Forking lets you explore a new direction without losing your original path. It's like a git branch for your conversation."
What to show on screen: Demonstrate forking by hovering over a past message, selecting "Fork conversation", and showing the new session starting from that point.
5. Fork and Rewind Option
- "Fork and rewind" combines both actions
- Creates new session AND reverts files
- Best of both worlds—explore with safety
- Original conversation + files stay safe
What to say: "Fork and rewind is the safest way to experiment. You get a fresh session to explore, but your original state is completely untouched."
What to show on screen: Make changes, then fork and rewind from an earlier message. Show both the original and forked session running side-by-side (if possible), demonstrating they're independent.
6. CLI Checkpointing with Git
- Claude creates automatic checkpoints before major changes
- Checkpoints tied to git commits in the background
- Use
git logto see checkpoint history - Desktop app has "Rewind code (checkpoints)" setting in /config
What to say: "On the CLI, checkpoints are tied to git. Claude automatically creates safe points before major operations, so you're protected even without manual checkpointing."
What to show on screen: Show git log output highlighting automatic commits created by Claude Code. Explain that each represents a checkpoint Claude made.
Demo Plan
-
Create a simple task (30 seconds) — Start a Claude conversation asking Claude to modify a file (e.g., add a function to a script).
-
Make initial changes (45 seconds) — Show Claude generating code and applying changes. Point out where you might want a checkpoint (before the next step).
-
Create a checkpoint (30 seconds) — Hover over a message, show the rewind options, and click to create a checkpoint.
-
Introduce a bad change (45 seconds) — Ask Claude to make a risky modification (e.g., refactor in a confusing way). Apply the changes.
-
Demonstrate rewind code (45 seconds) — Go back to the checkpoint, select "Rewind code", and show files reverting to the safe state while conversation stays intact.
-
Show fork and rewind (30 seconds) — From another checkpoint, demonstrate forking and rewinding to create a safe branch for experimentation.
Code Examples & Commands
Create Checkpoint in VS Code
[Hover over any message]
[Click rewind icon]
[Select: Rewind code / Fork conversation / Fork and rewind]
View Checkpoint History via Git
git log --oneline
# Shows commits created by Claude at checkpoint moments
Configure Rewind Behavior (Desktop App)
/config
# Find "Rewind code (checkpoints)" setting
# Toggle to enable/disable checkpoint creation
Example Git Log Output (CLI Checkpoints)
a1b2c3d Checkpoint: Before refactoring payment module
d4e5f6g Checkpoint: After adding authentication
h7i8j9k Initial conversation start
Gotchas & Tips
-
Checkpoints in VS Code are quick, CLI requires git — The VS Code extension has instant visual checkpointing. The CLI relies on git commits, so you need a git repo for checkpoints to work.
-
Rewind code only reverts files, not Claude's history — When you "rewind code," you're reverting .ts, .js, .py files, etc., but not the conversation. You can still see what Claude suggested.
-
Forking creates a new session with a new ID — When you fork, you get a separate session. You can switch back and forth with
/resume, but they're independent contexts. -
Checkpoint sizes grow with conversation length — Longer conversations = larger checkpoints. They're still small (usually KB), but very long conversations will eventually use more disk space.
-
You can checkpoint at any point — You don't need to wait until something breaks. Create checkpoints before trying experimental code, major refactors, or exploring new architectures.
-
Automatic checkpoints on CLI are conservative — Claude only auto-creates checkpoints before what it considers "major" changes. Manual checkpointing is more granular.
Lead-out
Checkpointing gives you safety within a session. Our final video shows how to run multiple independent sessions in parallel using git worktrees—true multi-tasking with Claude Code.
Reference URLs
- Git branching and worktrees: https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
- Git worktrees deep dive: https://git-scm.com/docs/git-worktree
Prep Reading
- Understand your typical workflow and where checkpoints would help
- Familiarize yourself with git basics if using CLI checkpointing
- Think about risky operations in your projects where you'd want safety nets
Notes for Daniel: Emphasize that checkpointing removes the fear of experimentation. You can say things like "Try it and see what happens—if it doesn't work, we'll rewind." This is a mindset shift. Show the visual rewind options prominently; they're the most accessible feature. Keep the CLI explanation brief unless the audience is heavy command-line users.