
Safety Guard
This is the kind of thing you turn on before letting Claude run in full-auto mode on a production system. It intercepts destructive commands like `rm -rf`, `git push --force`, and `DROP TABLE` before they execute, then warns you and suggests safer alternatives. You can also freeze edits to a specific directory so an autonomous agent can't touch code outside its scope. Three modes: careful (blocks dangerous commands), freeze (locks edits to one path), or guard (both). It hooks into the tool execution layer and catches things at the Bash, Write, and Edit level. Logs everything it blocks to a file so you can review what would have happened.
- skills.sh installs
- 5.5K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill safety-guard --agent claude-codeInstalls into .claude/skills of the current project.
Files
Safety Guard — Prevent Destructive Operations
When to Use
- When working on production systems
- When agents are running autonomously (full-auto mode)
- When you want to restrict edits to a specific directory
- During sensitive operations (migrations, deploys, data changes)
How It Works
Three modes of protection. They are instructions the agent follows, not enforced blocks (see Enforcement).
Mode 1: Careful Mode
Before it runs a destructive command, the agent stops and warns:
Watched patterns:
- rm -rf (especially /, ~, or project root)
- git push --force
- git reset --hard
- git checkout . (discard all changes)
- DROP TABLE / DROP DATABASE
- docker system prune
- kubectl delete
- chmod 777
- sudo rm
- npm publish (accidental publishes)
- Any command with --no-verify
When detected: shows what the command does, asks for confirmation, suggests safer alternative.
Mode 2: Freeze Mode
Locks file edits to a specific directory tree, for example: "freeze edits to src/components/".
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Csharp Testing5.5K
- Skill Scout5.5K
- Customs Trade Compliance5.5K
- Research Ops5.5K
- Crosspost5.5K
- Videodb5.5K
- Click Path Audit5.5K
- Skill Comply5.5K
- Hipaa Compliance5.5K
- Angular Developer5.5K
- Regex Vs Llm Structured Text5.5K
- Investor Outreach5.5K
- Homelab Wireguard Vpn5.5K
- Repo Scan5.5K
- Agent Payment X4025.5K
- Ck5.5K
- Clickhouse Io5.5K
- Terminal Ops5.4K
- Knowledge Ops5.4K
- Nutrient Document Processing5.4K
- Kotlin Exposed Patterns5.4K
- Claude Devfleet5.4K
- Finance Billing Ops5.4K
- Healthcare Cdss Patterns5.4K