git status and restore only the paths it lists as deleted, for example git restore -- src/app.js. Do not run git restore .: it also throws away uncommitted edits in files that survived. Committed work is in git reflog.rm does not use the Trash.A line in CLAUDE.md is a request the model can forget. A PreToolUse hook runs before every command and can refuse it. This is what ThumbGate's hook answers when the agent tries rm -rf ~ (default install, recorded Dec 2, 2026, reasoning lines cut):
{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "deny", "permissionDecisionReason": "[GATE:rm-rf-home-or-root] Broad rm -rf against root, home or a top-level home folder is blocked. Name the folder you mean, at least two levels under home."}}
rm -rf on your home folder or the root is Denied on a default install, the first time. A delete inside your project (for example rm -rf ./src) gets a Warning by default. Give that one a thumbs-down and the same command is Denied the next time, with your reason.
Adds the hook to Claude Code. No account; the checks run on your machine.
A reworded delete is not caught: after a thumbs-down on rm -rf ./src, python3 -c "shutil.rmtree('src')" still runs. ThumbGate is a check before the command, not a sandbox.
Free keeps 3 learned rules active. Pro keeps all of them.