Install
openclaw skills install ctrlzClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
AI Operation Undo System. When user executes /ctrlZ or says "undo last step", automatically revert all file modifications, installations, etc. from the recent conversation round. Default keeps 1 undo unit, configurable to 3 or 5.
openclaw skills install ctrlzCtrlZ is a Git-like undo system that records all "create/update/delete" operations performed by AI in each conversation round, allowing users to revert with one command.
/ctrlZ # Undo the most recent conversation round
/ctrlZ 3 # Undo the last 3 conversation rounds
/ctrlZ list # List undoable operation records
/ctrlZ stack 5 # Set stack size to 5 undo units
1. Start Session (at conversation beginning)
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh start <session_key> "<description>"
2. Record each operation (before modification)
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh record <session_id> <type> <path> [metadata]
Operation types:
file_write - Write/overwrite filefile_edit - Edit existing filefile_delete - Delete filedir_create - Create directoryexec_install - Install package/dependencyexec_download - Download file3. Execute actual operation
4. End Session (automatic at conversation end)
# 1. Start session
SESSION=$(bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh start "Modify config" | jq -r '.session_id')
# 2. Record config.json modification
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh record $SESSION file_edit "/path/to/config.json"
# 3. Execute actual modification
edit /path/to/config.json ...
# 4. Record package installation
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh record $SESSION exec_install "npm:lodash"
# 5. Execute installation
exec "npm install lodash"
When user says "undo":
# Undo the most recent 1 session
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh undo
# Undo the last 3 sessions
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh undo 3
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh get-stack
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh set-stack 5
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh stats
bash ~/.openclaw/skills/ctrlz/scripts/ctrlz.sh list
Location: ~/.openclaw/skills/ctrlz/undo.db
Tables:
undo_sessions - Each undo unit (conversation round)undo_operations - Specific operation recordssettings - Configuration (stack size, etc.)Backup Location: ~/.openclaw/skills/ctrlz/backups/
ctrlz clearWhen undoing operations that include package installations:
📦 The following package installations cannot be auto-undone:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. npm:lodash
2. npm:express
3. pip:requests
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 To remove, manually execute:
npm uninstall lodash
npm uninstall express
pip uninstall requests
Recommended to auto-start session at conversation begin and auto-cleanup at end. Can add logic to SOUL.md or AGENTS.md.
# Quick demo
bash ~/.openclaw/skills/ctrlz/scripts/demo.sh
# Or run full test cases
bash ~/.openclaw/skills/ctrlz/scripts/test_ctrlz.sh