affaan-m avatar

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-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/ecc
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263

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