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-code

Installs 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

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs