checkpoints-and-rewind
Skill11 starsChanged 5 months agoMITView on GitHub
Use before making irreversible changes (deleting files, destructive git operations, large refactors). Use when you need the ability to roll back if something goes wrong. Use at the start of any task that modifies multiple files.
- Deletes or force-pushes
In this repository26 other files it gives its agents.
- agent-capability-comparison-methodologySkill
- autonomous-work-signalingSkill
- batch-skill-description-standardizationSkill
- context-aware-task-decompositionSkill
- context-compaction-verification-and-recoverySkill
- cross-session-execution-frameworkSkill
- hermes-agentSkill
- hermes-improvement-multiphase-planSkill
- hermes-tweetSkill
- multi-agent-browser-text-extractionSkill
- multi-role-synthesis-frameworkSkill
- openclaw-hermes-archSkill
- open-source-adaptation-patternSkill
- planSkill
- requesting-code-reviewSkill
- router-learning-systemSkill
- security-hardening-checklistSkill
- self-regulation-brake-systemSkill
- skill-slimming-strategySkill
- spec-driven-developmentSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- think-toolSkill
- token-efficiencySkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Before making risky or irreversible changes, create a checkpoint.
- Distinctive: line 35
Core principle: Every multi-file change starts with a safety net.
- Distinctive: line 118
When you need to undo:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Checkpoints & Rewind
Overview
Before making risky or irreversible changes, create a checkpoint. If things go wrong, rewind to the checkpoint. This gives you the confidence to experiment without fear of breaking things.
Core principle: Every multi-file change starts with a safety net.
When to Use
- Before large refactors — Moving code, renaming files, changing architecture
- Before deleting anything — Files, directories, database data
- Before destructive git operations —
git reset,git rebase,git clean - Before trying experimental approaches — "Let's see if this works"
- At the start of any task that modifies 3+ files
- Before running auto-fix in code review (Step 7 of requesting-code-review)
Do NOT use for: Single-file edits, reading files, running tests, or any operation that's trivially undoable.
How to Create a Checkpoint
Method 1: Git Commit (Recommended)
# Before making changes
git add -A && git commit -m "[checkpoint] before <description>"
# Make your changes...
# If things go wrong:
git reset --hard HEAD~1
# If things go right:
# Keep the checkpoint commit, or squash it laterMethod 2: Git Stash (For Experiments)
# Before making changes
git stash push -m "checkpoint: <description>"
# Make your changes... (starting from clean state)
# If things go wrong:
git stash pop # restore the checkpoint (undoes your changes)
# If things go right:
git stash drop # discard the checkpointMethod 3: Manual Backup (No Git)
# Before making changes
cp -r important_file.ts important_file.ts.checkpoint
# Make your changes...
# If things go wrong:
cp important_file.ts.checkpoint important_file.ts
# Clean up after success:
rm important_file.ts.checkpointNaming Convention
Always include:
[checkpoint]prefix (easy to search in git log)- What you're about to do
- Date/time if helpful
Good:
[checkpoint] before refactoring ChantingHall to adapter pattern
[checkpoint] before trying experimental rendering approach
[checkpoint] before deleting old story-data.jsBad:
[checkpoint] save
[checkpoint] before changes
wipRewind Process
When you need to undo:
Step 1: Assess the Damage
# See what changed
git status
git diff --stat
# See recent commits
git log --oneline -5Step 2: Choose Rewind Method
Scenario A: Just checkpointed, no other commits in between
git reset --hard HEAD~1Scenario B: Checkpoint was several commits ago
# Find the checkpoint commit
git log --oneline --grep="\[checkpoint\]"
# Revert to it
git reset --hard <commit-hash>Scenario C: Need to keep some changes, undo others
# Reset specific files
git checkout <commit-hash> -- path/to/file.ts
# Or use interactive reset
git reset -p HEAD~1Scenario D: Already pushed to remote
# DON'T force push. Instead:
git revert <commit-hash>
# This creates a new commit that undoes the changes (safe for shared repos)Step 3: Verify the Rewind
# Check the project still works
npm test -- --passWithNoTests 2>&1 | tail -5
# Or
npm run build 2>&1 | tail -5Integration with Other Skills
- think-tool — Use Think Tool before deciding whether to checkpoint
- subagent-driven-development — Each subagent should checkpoint before starting its task
- requesting-code-review — Auto-fix loop (Step 7) should checkpoint before attempting fixes
- spec-driven-development — Checkpoint before Phase 4 (Implement)
Best Practices
- Checkpoint early, checkpoint often — Better to have too many than too few
- Use descriptive messages — "before refactor" not "save"
- Don't rely on the undo buffer — Editor undo only works within the same session
- Clean up old checkpoints — After a successful task, squash or drop checkpoint commits
- Combine with Think Tool — Think first, then checkpoint, then act
Common Mistakes
- Not checkpointing before destructive operations — "I'll just be careful" is not a strategy
- Checkpointing after starting changes — The checkpoint must be BEFORE, not during
- Forgetting to clean up — Old checkpoint files and commits accumulate
- Skipping verification — Always verify after rewind to make sure it worked
Quick Reference
| Action | Command | When |
| Git checkpoint | git add -A && git commit -m "[checkpoint] ..." | Before changes |
| Stash checkpoint | git stash push -m "checkpoint: ..." | Before experiments |
| File backup | cp file file.checkpoint | No git / single file |
| Rewind (last commit) | git reset --hard HEAD~1 | Undo all changes |
| Rewind (specific) | git reset --hard <hash> | Undo to specific point |
| Selective undo | git checkout <hash> -- <file> | Undo specific file |
| Safe undo (pushed) | git revert <hash> | Don't force push |
| Clean checkpoint commit | git rebase -i HEAD~N | Squash during cleanup |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

