Agent Trash Guard
Keep coding-agent deletes recoverable.
Block recognized permanent deletes from coding agents. Move a file to local trash, inspect its entry, and restore it by ID.
$ agent-trash put "draft.md"
$ agent-trash list
$ agent-trash restore <ENTRY_ID>What it changes
For recognized shell deletes — rm, unlink, shred, rmdir, find -delete, and git clean -f — the hook stops the command and tells the agent to use agent-trash put. Entries can be listed and restored locally.
It does not automatically move files on its own. An agent must use the trash command after the guard blocks a recognized delete.
Use the supported hosts
$ claude plugin marketplace add hermes-labs-ai/agent-trash-guard && claude plugin install agent-trash-guard@hermes-labs
$ codex plugin marketplace add hermes-labs-ai/agent-trash-guard && codex plugin add agent-trash-guard@hermes-labs
Run it through Codex's Bash tool after the explicit /hooks trust review.
$ gemini extensions install https://github.com/hermes-labs-ai/agent-trash-guard --ref main
Restart Gemini CLI, then use its run_shell_command tool.
Documentation route. Read installation, verification, updates, and troubleshooting.
What it does not cover
The guard handles recognized shell delete patterns only. It does not automatically move files, cover overwrites or truncations, protect cloud or API deletion, or replace a backup. It fails open if it cannot parse a hook event.