VS Code Extensions
Ctrl Z Terminal

Ctrl Z Terminal

by ghost-dev

Transactional undo and recovery engine for VS Code integrated terminals. Snapshot-based rollback, intelligent risk analysis, and filesystem recovery — all local-first.

Downloads

26

Rating

(0)

Version

0.1.0

Last updated

May 19, 2026

The world's first terminal undo and recovery system for VS Code. Run dangerous commands with confidence.

CI VS Code Marketplace Open VSX License: MIT


What is Ctrl Z Terminal?

Ctrl Z Terminal is a transactional recovery and undo engine for VS Code integrated terminals.

This is not command history. This is:

  • Terminal rollback — actually undo rm, mv, overwrite, and more
  • 📸 Snapshot-based recovery — incremental, compressed workspace snapshots
  • 🔴 Intelligent risk analysis — 40+ dangerous command patterns classified in real time
  • 🛡️ Safety infrastructure — warns you before destruction happens

"I can finally trust my terminal."


Features

🔴 Risk Analysis Engine

Every command you run is scored 0–100 and classified:

Level Score Examples
🟢 SAFE 0–25 ls, cat, echo, git status
🟡 WARNING 26–50 chmod, npm uninstall, kill, sed -i
🟠 DANGEROUS 51–80 rm, mv, git checkout --, docker rm
🔴 CRITICAL 81–100 rm -rf, git reset --hard, git clean -fd, dd

📸 Smart Snapshot Engine

Before dangerous commands execute, Ctrl Z Terminal:

  1. Scans your workspace
  2. Hashes every file (only copies changed files — incremental)
  3. Compresses snapshots with gzip
  4. Stores everything locally in ~/.vscode/ctrl-z-terminal/

⏮ True Undo

Hit Ctrl+Shift+Z to undo the last dangerous command. Restores:

  • Deleted files
  • Overwritten content
  • Renamed files
  • Directory structures

🖥️ Recovery Timeline

A beautiful VS Code panel showing:

  • Every command with its risk level
  • Snapshot availability indicator
  • One-click undo / restore
  • Search and filter by risk level
  • Time-ago timestamps

🔒 100% Local & Private

  • Zero telemetry
  • No cloud dependency
  • All snapshots stored locally
  • Works fully offline

Installation

From VS Code Marketplace

Search for "Ctrl Z Terminal" in the Extensions panel, or:

ext install ctrl-z-terminal.ctrl-z-terminal

From Open VSX (Cursor, VSCodium, Windsurf)

Search for "Ctrl Z Terminal" in your editor's extensions panel.

From VSIX (manual)

code --install-extension ctrl-z-terminal-0.1.0.vsix

Usage

Ctrl Z Terminal activates automatically when VS Code starts.

Keyboard Shortcuts

Shortcut Action
Ctrl+Shift+Z (Mac: Cmd+Shift+Z) Undo last command
Ctrl+Shift+T (Mac: Cmd+Shift+T) Open Recovery Timeline

Command Palette

Command Description
Ctrl Z Terminal: Undo Last Command Rollback to pre-command state
Ctrl Z Terminal: Open Timeline Open Recovery Timeline panel
Ctrl Z Terminal: Restore Snapshot Pick a snapshot to restore
Ctrl Z Terminal: Analyze Command Analyze any command
Ctrl Z Terminal: Cleanup Snapshots Enforce retention policies
Ctrl Z Terminal: Toggle Monitoring Pause/resume monitoring

Shell Support

Shell Integration Method Status
bash PROMPT_COMMAND + DEBUG trap ✅ Full
zsh add-zsh-hook preexec/precmd ✅ Full
fish fish_preexec/fish_postexec ✅ Full
PowerShell PSReadLine + prompt wrap ✅ Full
cmd.exe Best-effort output parsing ⚠️ Partial

Configuration

Open VS Code Settings (Ctrl+,) and search for ctrlZTerminal:

Setting Default Description
ctrlZTerminal.enabled true Enable/disable monitoring
ctrlZTerminal.autoSnapshot true Auto-snapshot before dangerous commands
ctrlZTerminal.riskThreshold WARNING Minimum risk level to trigger snapshot
ctrlZTerminal.requireConfirmation true Show dialog before dangerous commands
ctrlZTerminal.excludeFolders [node_modules, .git, ...] Folders excluded from snapshots
ctrlZTerminal.ignoredCommands [] Commands to skip analysis for
ctrlZTerminal.snapshotRetentionDays 7 Days to keep snapshots
ctrlZTerminal.maxStorageMB 500 Max snapshot storage in MB

How It Works

Terminal command → OSC 633 capture → Risk Engine → Safety Dialog?
                                                         ↓
                                               Snapshot Engine (if needed)
                                                         ↓
                                               Command executes
                                                         ↓
                                        Filesystem Tracker records changes
                                                         ↓
                                           Storage Engine saves record
                                                         ↓
                                          Recovery Timeline UI updated

Privacy & Security

  • ✅ All data stored in VS Code's globalStorageUri (local machine only)
  • ✅ No network requests ever made
  • ✅ No analytics, no crash reporting, no telemetry
  • ✅ Snapshots are automatically cleaned up per your retention settings
  • ✅ The telemetry setting is permanently false

Publishing

See docs/PUBLISHING.md for full publishing instructions for both:

  • VS Code Marketplace
  • Open VSX Registry

Contributing

See docs/CONTRIBUTING.md.


Architecture

See docs/ARCHITECTURE.md for the full module dependency diagram and data flow.


License

MIT © Ctrl Z Terminal Contributors. See LICENSE.

Related extensions