UndoFu
A low-resource safety net for when AI gets overconfident with your files. UndoFu silently archives edits, catches deletions, tracks attribution, and gives you precise recovery tools before a bad agent run turns into a bad week.
Install directly from the Visual Studio Marketplace and keep it quietly guarding your workspace in the background.
Disaster Recovery, Inside VS Code
UndoFu is built for the exact moment an AI assistant says "fixed it" and your workspace suddenly looks nothing like it did 30 seconds ago.
Always-On Passive Archive
Activates on workspace open, primes a baseline cache, and snapshots the before-state of files automatically with no manual recording step.
Surgical Line Restoration
Restore only the exact changed lines you want instead of clobbering the whole file when one overhelpful edit caused the real damage.
Native Diff Inspection
Launch a side-by-side diff view from an archived snapshot using a custom `undofu-archive:` URI, without temp-file junk in your repo.
Deletion Recovery
Captures VS Code deletes before they happen and reconstructs external or terminal deletions from the cached baseline when possible.
AI Agent Attribution
Tags archive entries with the likely responsible agent so Copilot, Continue, Roo Code, Cursor, or another autonomous tool leaves a traceable trail.
Chaos-Tested Reliability
Backed by smoke tests and rapid mixed-operation chaos tests so recovery survives the same kind of bursty file event storms AI tools create.
Three Recovery Paths for Three Kinds of Damage
UndoFu is strong because it does not force one blunt restore workflow onto every mistake. It gives you the right tool for a single bad line, a suspicious rewrite, or total file destruction.
The Scalpel
Surgical Line-by-Line Staging shows the exact differing lines between the archived snapshot and the current file so you can restore only the broken pieces.
The Diff Lens
Split Diff View opens the archived snapshot against the current file so you can inspect what changed before deciding whether to restore, keep, or manually edit.
The Sledgehammer
Complete Overwrite (Force) writes the archived file back to disk, recreates missing directories, and gets you out of full-file catastrophe mode quickly.
Operational Detail, Not Just Marketing Claims
The extension is careful about the boring hard parts that make recovery trustworthy: persistence state, event races, noisy path suppression, session grouping, and external file change capture.
Database Saver Panel
Live persistence-state feedback tells you whether the archive index is idle, saving, saved, or failed, instead of hiding durability behind wishful thinking.
Live Telemetry Dashboard
Sidebar telemetry shows bulk edits, deletions, line delta stats, timestamps, and original file paths so you can triage damage fast.
Smart Ignore Layers
Hard-blocked paths, runtime archive guards, `.gitignore` support, custom regex ignores, and workspace config suppression help keep the archive useful instead of noisy.
External Watcher Coverage
Captures changes from editor saves, terminal scripts, shell tasks, and direct file-system writes so the archive still works when the damage did not come through normal editor edits.
Race Condition Protection
A promise-chained `FileLockManager` serializes concurrent operations on the same file path so rapid AI runs do not corrupt the very safety net meant to protect you.
Accurate Line Delta Math
Uses LCS-based removed/added line computation for trustworthy edit stats, with a fallback for huge files to keep the UI responsive.
Serious Control Without Config Bloat
UndoFu stays mostly automatic, but it still exposes the right controls when you need to tune how aggressively it watches, groups, or filters workspace activity.
| Command | Purpose |
|---|---|
UndoFu: Restore File |
Choose between complete overwrite, surgical line staging, or native diff view for one archived file. |
UndoFu: Undo All Session Changes |
Roll back every file captured inside one AI activity burst or refactor session. |
UndoFu: View Visual Changes |
Open a side-by-side diff comparing the archived snapshot with the current file state. |
UndoFu: Clear from Archive |
Permanently remove an archive entry when you no longer need it. |
| Setting | Default | Purpose |
|---|---|---|
undofu.captureAll |
true |
Deep Audit mode that captures everything instead of honoring `.gitignore` and custom patterns. |
undofu.sessionWindowMs |
20000 |
Controls how long UndoFu waits before starting a new grouped activity session. |
undofu.editorSaveCoalesceMs |
0 |
Lets rapid consecutive saves merge into one capture to avoid noisy duplicate archive entries. |
undofu.captureExternalChanges |
true |
Extends coverage beyond the editor to terminal, scripts, and tool-driven file writes. |
undofu.externalWatcherGlob |
**/* |
Narrows or widens the external file-system watcher scope. |
undofu.ignoredPatterns |
["\\.log$", "\\.tmp$", ...] |
Supports custom regex suppression for paths you never want archived. |
Install the Workspace Safety Net
UndoFu exists for the exact category of damage modern AI coding workflows make more common: fast, confident, high-surface-area mistakes. Install it once, forget it is there, and be grateful when you need it.
✉ Open UndoFu on the VS Code MarketplaceAlso see: Dude, Where’s My RAM? for live memory visibility inside VS Code.