
Safety Guard
A pre-execution safety net for when Claude is touching production systems or running autonomously. It works in three modes: Careful (intercepts destructive commands like rm -rf, git push --force, DROP TABLE and asks for confirmation), Freeze (locks edits to a specific directory), and Guard (both combined). The hook-based implementation catches dangerous operations before they execute, which is exactly what you want when an agent is running in full-auto mode and you step away from your desk. Logs blocked actions to ~/.claude/safety-guard.log so you can see what it stopped. Turn it off with /safety-guard off when you need full control back.
- skills.sh installs
- 4K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --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/everything-claude-code
- First seen
- Apr 16, 2026
More from affaan-m/everything-claude-code
All 256- Seo4K
- Agent Payment X4023.9K
- Canary Watch3.9K
- Ck3.9K
- Council3.9K
- Dart Flutter Patterns3.9K
- Healthcare Cdss Patterns3.9K
- Healthcare Emr Patterns3.9K
- Product Lens3.9K
- Token Budget Advisor3.9K
- Customer Billing Ops3.8K
- Dashboard Builder3.8K
- Healthcare Eval Harness3.8K
- Manim Video3.8K
- Ui Demo3.8K
- Agent Introspection Debugging3.7K
- Connections Optimizer3.7K
- Dotnet Patterns3.7K
- Finance Billing Ops3.7K
- Gan Style Harness3.7K
- Google Workspace Ops3.7K
- Knowledge Ops3.7K
- Lead Intelligence3.7K
- Openclaw Persona Forge3.7K