Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>UndoFuNew to Visual Studio Code? Get it now.
UndoFu

UndoFu

Mythlogic Studios

|
4 installs
| (1) | Free
A low-resource proprietary safety net for AI file deletions and modifications.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

UndoFu 🥋

"Because AI said 'I got this' — and then deleted your database."

UndoFu is the last line of defense between your codebase and the confident, well-intentioned, absolutely catastrophic decisions of your AI coding assistant. It silently watches every file in your workspace, snapshots changes before they happen, and gives you surgical precision tools to undo exactly what went wrong — whether that's one line, a snippet, a bulk rewrite, or the complete annihilation of a file that took you three months to build.

No more git stash. No more crying. Just UndoFu.


Why UndoFu Exists

AI agents are incredible. They write boilerplate, refactor functions, scaffold entire features, and occasionally — with the confidence of someone who has never once been wrong — delete your production database schema, your migration files, your seed data, and then helpfully commit the empty folder.

This has happened. At real companies. With real engineers. Staring at a real empty db/ directory wondering if they can expense therapy.

UndoFu was built so that never happens to you. Or if it does, you press one button and it un-happens.


Quick Start

  1. Install UndoFu from the Marketplace.
  2. Open the UndoFu icon in your Activity Bar.
  3. Keep coding. Your changes are being snapshotted silently in the background.
  4. If something breaks, open the UndoFu sidebar and click Restore.

Features

🛡️ Always-On Passive Archive

UndoFu activates the moment VS Code opens and immediately begins watching your entire workspace. There is nothing to configure, no commands to run, no "start recording" button to forget. It primes a baseline content cache for every file in your project at startup and silently snapshots the before state of any file before it changes.

  • Activates on every workspace open ("activationEvents": ["*"])
  • Primes a full file-system baseline cache at startup
  • Watches editor saves, external writes, terminal scripts, shell tasks, and file-system events simultaneously
  • Zero interaction required — it's always on, always watching, always ready

✏️ Single Line Restoration

AI changed one line and now your app won't compile? UndoFu's Surgical Line-by-Line Staging mode lets you cherry-pick individual lines from any archived snapshot and inject them back into the current file — without touching anything else.

  • Computes a full line-level diff between the archived snapshot and the current file
  • Presents every changed line in a multi-select Quick Pick panel
  • You toggle exactly which lines to restore — nothing more, nothing less
  • The rest of your file stays exactly as it is

This is the scalpel. Use it when the AI changed one thing and broke everything.


🔬 Snippet & Partial Restore via Split Diff View

Not sure what changed? Launch the Split Diff View directly from the archive panel. UndoFu opens VS Code's native diff editor with the archived snapshot on the left and your current file on the right — red lines removed, green lines added, full side-by-side comparison.

  • Uses VS Code's built-in vscode.diff command for a native, familiar experience
  • Archived snapshot is served via a custom undofu-archive: URI scheme — no temp files cluttering your workspace
  • Labeled with the exact timestamp of the snapshot so you know precisely when it was captured
  • Works even if the current file has been deleted — the diff opens against an untitled placeholder

Use this when you need to see exactly what the AI touched before deciding how much of it to keep.


📦 Bulk Edit Capture & Full File Restore

When an AI agent rewrites an entire file — or when a terminal script blows through 40 files in 3 seconds — UndoFu captures every single one. Each changed file gets its own archived snapshot with full content, line delta stats, attribution, and timestamp.

Complete Overwrite (Force) restore mode writes the archived snapshot directly back to disk, recreating the directory structure if necessary. One click. Done.

  • Captures bulk rewrites from editor saves, external file-system watchers, and terminal/shell execution
  • Stores the full pre-change content as a binary-safe buffer
  • Recreates missing parent directories on restore
  • Removes the archive entry after a successful restore to keep the panel clean

This is the sledgehammer. Use it when the AI "improved" a file that was already perfect.


🗑️ Complete File Deletion Recovery

This is the one that matters most. UndoFu intercepts VS Code's onWillDeleteFiles event — before the file is gone — reads the full content, and archives it. For deletions that happen outside the editor (terminal rm, scripts, AI tool calls), the external file-system watcher catches the onDidDelete event and uses the cached baseline content to reconstruct the archive entry.

  • Pre-deletion capture via onWillDeleteFiles for editor-initiated deletes
  • Post-deletion recovery via baseline cache for external/terminal deletes
  • Metadata-only entries created when content wasn't cached, so the deletion is still logged
  • Full path, timestamp, attribution, and line count preserved for every deleted file

Yes, this includes your database files. Yes, this is specifically because AI agents keep deleting database files. We're not naming names. You know who you are, Copilot.

(We're kidding. Mostly.)


💾 Database Saver — Active Archive Persistence Monitor

The Database Saver panel lives at the bottom of the UndoFu sidebar and is the most important 2 inches of screen real estate in your IDE. It monitors the archive index write cycle in real time and gives you live visual feedback on the persistence state of your safety net.

  • Idle (green): Archive index is persisted. You're safe.
  • Saving (amber/red): Index write in progress. Hold tight.
  • Saved (green): Write confirmed. Breathe.
  • Failed (red): Write error. Something is wrong. Pay attention.

The archive index is written with a 500ms debounce — rapid-fire events are coalesced into a single write rather than hammering the disk. The Database Saver reflects every state transition so you always know whether your archive is durable.

The panel is collapsible and remembers its state between sessions via localStorage. Because even your safety net deserves a clean UI.


🤖 AI Agent Attribution

Every archive entry is tagged with the AI agent that caused it. UndoFu scans active VS Code extensions at capture time and identifies the responsible party:

Detected Extension Attribution Label
github.copilot GitHub Copilot
continue.continue Continue AI
saoudrizwan.claude-dev Roo Code
cursor.cursor Cursor AI
(anything else) Autonomous Agent

Sessions are grouped in the sidebar by agent attribution, so when you open the archive panel after a coding session and see 47 entries all attributed to "GitHub Copilot", you'll know exactly who to blame. Lovingly. They're trying their best.


📊 Session Grouping & Bulk Session Restore

UndoFu groups archive entries into sessions based on a configurable idle timeout (default: 20 seconds). Every burst of AI activity — a refactor, a scaffold run, a "let me just clean this up real quick" — lands in its own session group.

From the sidebar you can:

  • Restore All — rolls back every file in a session to its pre-change state in one click
  • Clear Session — removes all entries for a session from the archive without restoring
  • See per-session counts of Bulk Edits and Deletions at a glance

This is the time machine. Use it when you let the AI "just do a quick refactor" and came back to find your entire src/ directory restructured.


📈 Live Telemetry Dashboard

The top of the UndoFu sidebar shows a live telemetry panel with:

  • Total Bulk Edits captured this session
  • Total Deletions captured this session
  • Per-file line delta stats: lines removed (red) and lines added (green)
  • Timestamps on every entry, color-coded AM/PM for quick scanning
  • Full original file path for every entry

Toggle between Compact and Expanded view modes. Compact hides file paths and line stats for a minimal footprint. Expanded shows everything. The mode is persisted across reloads via VS Code's webview state API.


🔍 Smart Ignore System

UndoFu is aggressive about capturing changes, but it's not reckless. A layered ignore system ensures you're never archiving noise:

  1. Hard-blocked paths — node_modules/, .git/, dist/, build/, out/, .cache/, .vscode-test/, VS Code internal output channels, and UndoFu's own archive storage (no feedback loops)
  2. Runtime archive guard — UndoFu's own globalStorage path is dynamically injected at activation and blocked at the path prefix level
  3. .gitignore integration — when captureAll is disabled, UndoFu respects your .gitignore rules and reloads them automatically when the file changes
  4. Custom regex patterns — define your own ignore patterns via undofu.ignoredPatterns in settings
  5. Workspace config file suppression — optionally ignore .vscode/settings.json, launch.json, tasks.json, and extensions.json to reduce settings-churn noise

Deep Audit mode (captureAll: true, the default) bypasses .gitignore and custom patterns entirely — every file event is captured, no exceptions. Use this when you need a complete audit trail.


⚡ External File-System Watcher

AI agents don't always work through the VS Code editor. They run terminal commands. They execute scripts. They call tools that write directly to disk. UndoFu's external file-system watcher catches all of it.

  • Creates a vscode.FileSystemWatcher per workspace folder using a configurable glob (default: **/*)
  • Primes a full baseline content cache at startup so the "before" state is always available
  • Captures onCreate, onChange, and onDelete events from any source — editor, terminal, script, or AI tool call
  • Uses a FileLockManager with promise-chained locks to prevent race conditions on concurrent file events
  • Attributes external changes as Terminal Execution / Shell Task

Disable with captureExternalChanges: false if you need the absolute minimum runtime overhead. Narrow the watcher glob with externalWatcherGlob if you want coverage without watching every file.


🔒 Race Condition Protection

High-frequency AI operations can trigger dozens of file events per second. UndoFu handles this with a purpose-built FileLockManager that serializes concurrent operations on the same file path using promise-chained locks.

  • Per-file lock queue prevents interleaved reads and writes on the same path
  • Locks are automatically released and cleaned up after each operation
  • Pending save captures are coalesced via editorSaveCoalesceMs to prevent duplicate archive entries from rapid consecutive saves
  • All pending captures are flushed synchronously on extension deactivation so nothing is lost on workspace close

🧮 LCS-Based Line Delta Computation

Every archive entry shows exactly how many lines were removed and added. This isn't a naive line count — it's a proper Longest Common Subsequence diff algorithm that computes the true edit distance between the before and after states.

  • O(n×m) LCS implementation for accurate removed/added counts
  • Automatic fallback to length-delta estimation for very large files (>1,000,000 cell matrix) to keep the UI responsive
  • Line stats are stored on the archive entry at capture time so the sidebar renders instantly without re-reading files

🧹 Automatic 48-Hour Cleanup

The archive doesn't grow forever. When the UndoFu sidebar is first opened in a session, it runs an automatic cleanup pass that removes any archive entries older than 48 hours — both the index entry and the archived file on disk.

This keeps the archive lean, the sidebar fast, and your globalStorage from quietly accumulating gigabytes of old snapshots.


🧪 Chaos-Tested Reliability

UndoFu ships with two test suites:

  • Smoke tests — validates editor saves, external writes, renames, and deletions all produce correct archive entries end-to-end
  • Chaos tests — hammers the extension with 10 rapid mixed operations (writes, renames, deletes, recreates) across 5 files simultaneously and verifies the archive survives intact

If it can survive the chaos suite, it can survive your AI agent.


Configuration Reference

Setting Default Description
undofu.captureAll true Deep Audit mode — captures everything, ignores .gitignore and custom patterns
undofu.sessionWindowMs 20000 Idle timeout (ms) before a new session group is started (5000–120000)
undofu.editorSaveCoalesceMs 0 Window (ms) to merge rapid consecutive saves of the same file into one snapshot
undofu.captureExternalChanges true Enable file-system watcher for terminal/script/tool changes outside the editor
undofu.externalWatcherGlob **/* Glob pattern for the external file-system watcher
undofu.ignoreWorkspaceConfigFiles false Suppress .vscode/ config file events to reduce noise
undofu.ignoredPatterns ["\\.log$", "\\.tmp$", ...] Custom regex patterns for paths UndoFu should not track
undofu.debugLogging false Emit diagnostic logs to the UndoFu output channel

Commands

Command Description
UndoFu: Restore File Restore an archived file with choice of Complete Overwrite, Surgical Line Staging, or Diff View
UndoFu: Undo All Session Changes Roll back every file in a session group to its pre-change state
UndoFu: View Visual Changes Open a split diff view comparing the archived snapshot to the current file
UndoFu: Clear from Archive Permanently remove an entry from the archive

Restore Modes

When restoring a file, UndoFu gives you three options:

Complete Overwrite (Force) Writes the archived snapshot directly back to disk. Recreates missing directories. Removes the archive entry on success. Use this when the whole file is wrong.

Surgical Line-by-Line Staging Shows every line that differs between the snapshot and the current file. You select exactly which lines to restore. Everything else stays. Use this when one function is wrong and the rest is fine.

Launch Split Diff View Opens the native VS Code diff editor. You review the changes visually and decide what to do. Use this when you're not sure yet.


The Bottom Line

Your AI assistant is powerful, fast, and occasionally has the file-system awareness of a golden retriever with a delete key. UndoFu doesn't slow it down — it just makes sure that when it confidently removes the wrong thing, you can get it back in under 10 seconds.

Install it. Forget it's there. Thank it later.

UndoFu. Because git reflog shouldn't be your disaster recovery plan.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft