npx claudepluginhub roli-lpci/agent-trash-guardBlocks permanent-delete shell commands in Claude Code and redirects agents to a recoverable trash workflow.
Recoverable deletion for coding agents: move files to trash, list them, and restore them with agent-trash.
7-day visitors to each marketplace page
A safety net for coding-agent sessions: block permanent deletes and keep recovery within reach.
Agent Trash Guard is developed by Hermes Labs.
Hermes Labs is an agentic infrastructure company building the reliability layer for autonomous systems.
Install · What gets blocked · Recovery workflow · How it works · Tests
Native guards for Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, and Pi, backed by one detector and an inspectable agent-trash workflow.
Agents are good at cleaning up. Sometimes they clean up the wrong thing, and
rm has no undo. This project provides native pre-tool adapters for Claude
Code, Codex, Cursor, Gemini CLI, OpenClaw, and Pi, backed by one detector and the agent-trash CLI.
Recognized guarded delete commands are blocked before execution; use
agent-trash put to make the recoverable move you can inspect and reverse.
agent-trash gc reclaims the space those moves accumulate without ever
reclaiming work that git cannot prove is safe to lose.
The project was originally published as claude-trash-guard. GitHub redirects
that historical repository URL, and claude-trash remains as a compatibility
command. New integrations and documentation use the platform-neutral
agent-trash-guard name.
No dependencies beyond Python 3 (stdlib only) and bash.
No plugin, no host setup. This runs the real hook and the real CLI against a throwaway directory and proves the whole loop — block, trash, list, restore — byte-for-byte:
git clone https://github.com/hermes-labs-ai/agent-trash-guard.git
cd agent-trash-guard
./tests/recoverability-demo.sh
You'll see a rm -rf get blocked cold (hook exit 2, file untouched), then
agent-trash put / list / restore move the file out and back with a
matching SHA-256. Under a second on most machines, and it never touches your
files or your real trash directory.
git clone https://github.com/hermes-labs-ai/agent-trash-guard.git
cd agent-trash-guard
./install.sh
install.sh symlinks agent-trash (plus the legacy claude-trash alias)
into ~/.local/bin and registers the Claude adapter in
~/.claude/settings.json. A timestamped backup of settings.json is written
before any change, existing settings and other hooks are preserved, and the
edit is idempotent. If ~/.local/bin is not on your PATH, install.sh prints
the exact export PATH=... line to run for the current shell. Restart any
running Claude Code session afterwards.
It comes off just as cleanly: ./uninstall.sh restores settings.json from
the backup and removes the symlinks, leaving your trash directory intact.
The repository root is one portable Agent Plugin (plugin.json, Agent Plugins
1.0.0) with one canonical skill, skills/agent-trash-guard/SKILL.md. Choose a
host route that loads the executable guard. A skill-only install teaches the
workflow but cannot intercept shell commands.
Matt Pocock's skills for real engineering, as an installable Claude Code plugin.
Anthropic's Claude Code plugins, installed from the claude-plugins-official repository
Official marketplace for gstack — AI engineering workflow skills, code review, QA browser automation, and shipping tools for Claude Code.