Safe remove command wrapper for AI coding agents
npx claudepluginhub texmeijin/safe-rm-claude-pluginSafe remove command wrapper for AI coding agents. Prevents accidental deletion of important files by enforcing safety checks on dotfiles, git-managed files, directories outside cwd, and special directories.
Catch 99% of accidental deletions with one simple install.
Stop AI agents from accidentally deleting .env files, git-tracked code, or critical system files. This plugin adds automatic safety checks to every rm command in Claude Code sessions.
Zero configuration. Zero learning curve. Just install and forget.
AI agents are powerful, but they can make costly mistakes:
# Claude executes: rm .env
# 💥 Your API keys are gone
# Claude executes: rm -rf ../important-project
# 💥 Wrong directory deleted
# Claude executes: rm src/config.ts
# 💥 Git-tracked file removed without confirmation
One accidental deletion can cost hours of recovery work.
A lightweight safety layer you can "just install and forget":
You might be using these common approaches to protect your files:
rm in settings.json{
"permissions": {
"deny": ["Bash(rm *)"]
}
}
Problem: Pattern matching is fragile and can be bypassed:
rm file.txt → ❌ Blockedrm file.txt (extra space) → ✅ Bypassed/bin/rm file.txt → ✅ BypassedIMPORTANT: Never use the rm command to delete files.
Problem: LLM instructions are unreliable:
This plugin works at the shell execution layer — below the LLM:
User Request → Claude (LLM) → Shell Command → [🛡️ THIS PLUGIN] → System
Why it works reliably:
rmrm variants — direct interception, not pattern matchingNote: This doesn't protect against other deletion methods (like find -delete), but it handles 99% of accidental AI deletions with zero productivity cost.
# Add the marketplace
/plugin marketplace add TeXmeijin/safe-rm-claude-plugin
# Install the plugin
/plugin install safe-rm@safe-rm-marketplace
That's it! Your Claude Code sessions now catch most accidental deletions automatically.
After installation, all rm commands in Claude Code are transparently protected:
# You use rm normally
rm .env
# But the plugin automatically blocks dangerous operations
# ❌ FORBIDDEN: You are trying to remove dotfile: .env
# You must ask your leader to run manually: rm /path/to/.env
You don't need to learn new commands or change your workflow. The protection works invisibly in the background.
Unlike silent blocking, this plugin provides actionable feedback that helps Claude understand what went wrong and what to do next:
rm -r large-directory/ # contains 50+ files
# ❌ Error output:
# FORBIDDEN: Directory contains 50 files (limit: 10)
# Directory: /Users/you/project/large-directory
# NEXT ACTION👉: You MUST ask your manager to run manually: rm -rf /path/to/directory
This prevents AI runaway behavior:
The plugin enforces 6 critical safety checks:
| Protection | What It Does |
|---|---|
| 🔒 Dotfiles | Blocks deletion of configuration files (.env, .gitignore, etc.) |
| 🔒 Git-managed files | Requires confirmation before removing tracked files |
| 🔒 Outside project scope | Prevents deleting files outside your current directory |
| 🔒 System directories | Blocks removal of /, ~, and other critical paths |
| 🔒 Gitignored files | Protects important files like node_modules, build outputs |
| 🔒 Large directories | Limits recursive deletion to 10 files (configurable) |
# ❌ Blocked: Dotfile
rm .env
# FORBIDDEN: You are trying to remove dotfile: .env
# You must ask your leader to run manually: rm /path/to/.env
# → Claude learns: "I should ask the user for permission"
Claude Code marketplace entries for the plugin-safe Antigravity Awesome Skills library and its compatible editorial bundles.
Production-ready workflow orchestration with 84 marketplace plugins, 192 local specialized agents, and 156 local skills - optimized for granular installation and minimal token usage
Directory of popular Claude Code extensions including development tools, productivity plugins, and MCP integrations