Skip to content
Open source · local pre-tool guardv0.1.3 · MIT · Python 3 + bash

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.

Trash and restore a filereplace ENTRY_ID from list
$ agent-trash put "draft.md"
$ agent-trash list
$ agent-trash restore <ENTRY_ID>

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.

CLAUDE CODEInstall the portable plugin
$ claude plugin marketplace add hermes-labs-ai/agent-trash-guard && claude plugin install agent-trash-guard@hermes-labs
CODEX CLI · 0.145+Install the Codex adapter
$ 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 CLIInstall the repository extension
$ 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.

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.