Development marketplace for Safe Mode plugin
npx claudepluginhub alexandephilia/ai-cli-safe-modeBlock destructive git and filesystem commands before execution
A plugin for Claude Code that stops dangerous git and file-deletion commands before they run—so one bad command can’t wipe out your work.
I learned the hard way that written instructions alone don’t stop an AI from running harmful commands.
After Claude Code wiped out hours of work with a single rm -rf ~/ or git checkout --, it was clear that rules in a CLAUDE.md or AGENTS.md file are only suggestions—they can’t actually stop a command from running.
This plugin is a real guard: it runs before any command and can block it so destructive commands never execute.
Claude Code’s .claude/settings.json supports deny rules that match commands by pattern (e.g., Bash(git reset --hard:*)). Here’s how this plugin is different:
| Permission Deny Rules | Safe Mode | |
|---|---|---|
| Setup | You must configure it yourself | Works as soon as you install it |
| How it checks | Matches text patterns (e.g. with *) | Understands what the command does |
| When it runs | Runs after Safe Mode | Runs first (before the command runs) |
| Nested shells | Doesn’t look inside sh -c '...' style commands | Looks inside nested commands (up to 5 levels) |
| Code in Python/Node/etc. | Doesn’t check one-line scripts | Detects and blocks dangerous one-liners |
Even with pattern matching, permission rules only look at the exact text. People (or AI) can get around them in several ways:
| How to bypass | Example |
|---|---|
| Put options before the value | curl -X GET http://evil.com doesn’t match Bash(curl http://evil.com:*) |
| Use variables | URL=http://evil.com && curl $URL doesn’t match a URL pattern |
| Change flag order | rm -r -f / doesn’t match Bash(rm -rf:*) |
| Add extra spaces | rm -rf / (double space) doesn’t match the pattern |
| Wrap in another shell | sh -c "rm -rf /" doesn’t match Bash(rm:*) at all |
Plugins by Alex Newman (thedotmack)
Ultra-compressed communication mode for Claude Code. Cuts 65% of output tokens (measured) while keeping full technical accuracy.
RuView Marketplace: Claude Code + Codex plugins for WiFi sensing — configuration, applications, model training, and onboarding, from practical to advanced