Recover from Claude Code Mistakes
Claude Code broke your project? Here's how to recover and set up automatic protection for next time.
If You Have mrq Running
Recovery is immediate:
$ mrq history
Recent Snapshots
────────────────────────────────────────────────────
15:42:18 abc123 Restructured API routes
+234 lines, -189 lines across 8 files
15:38:45 def456 Added error handling
+67 lines, -12 lines across 3 files
────────────────────────────────────────────────────
$ mrq restore def456
✓ Restored to snapshot def456 Done. Your project is back to a working state. Your current state is automatically backed up before restore.
You can also browse your history visually in the dashboard and copy the restore command from there.
Don't have mrq yet? Skip to setup to prevent this from happening again.
If You Don't Have mrq Yet
Your options are limited:
Check Git Status
git status
git diff If you have uncommitted changes you want to discard:
git checkout -- .
git clean -fd # Warning: removes untracked files The Problem with Git
Claude Code works fast, often touching 10+ files before you have a chance to review. If you haven't been committing after each change, git won't help.
You might try:
- Check your IDE's local history (VS Code: right-click file → "Open Timeline")
- Look for backup files your editor might have created
- Check your OS trash for deleted files
These are unreliable. IDE history doesn't capture all files, and deleted files don't always go to trash.
Set Up mrq (30 Seconds)
Don't go through this again. mrq captures state continuously in the background:
npm install -g mrq-cli@latest
mrq login
mrq watch Now every meaningful change is captured automatically. Next time Claude Code does something unexpected, recovery is one command.
The Claude Code Problem
Claude Code's agentic mode is designed to work autonomously. You give it a task, and it figures out how to accomplish it. This often means modifying multiple files, deleting code it considers unnecessary, and making architectural decisions on its own.
Most of the time this works well. But when it doesn't, the damage can be significant:
- Files deleted because Claude thought they were unused
- Working code replaced with something that doesn't compile
- Subtle bugs introduced that aren't immediately obvious
- Configuration changed in ways that break deployment
The speed at which this happens makes manual tracking impossible. You need automated state capture.
Related Resources
- Full Claude Code integration guide
- mrq vs Git: When to use each
- Documentation
- General AI recovery guide
Never lose work to Claude Code again
Automatic snapshots. Instant recovery. Set up in 30 seconds.
Get Started Free →