Claude Code

Safety Net: Stop Claude Deleting Your Files Before the Command Runs

A free, open-source guard for Claude Code. Before Claude runs a command or opens a file, it checks what that call would really do, and blocks hard resets, force pushes, risky rm -rf and reads of your secret keys

2min read
1prompts to copy
5numbered steps
4sections

Claude Code runs real commands on your machine. Most are harmless, but one wrong git reset --hard or rm -rf can wipe work you never committed. CC Safety Net sits in front of every tool call: it parses what the command would actually do, and if it is destructive the call never runs and Claude is told why. Safe calls such as git status run normally.

What it blocks (from the README)

  • Destructive Git: git reset --hard, git push --force.
  • Destructive file commands: rm -rf on dangerous targets.
  • The same commands hidden inside bash -c or python -c. It reads what the command does, so wrapping it or reordering flags doesn't get past it.
  • Secrets: SSH keys, .env files, ~/.aws and coding-CLI login files, from both the shell and Claude's own file tools.

Keep reading

Free, for an email.

Unlocks 3 more sections, 1 copy-paste prompt, the document version, and every other guide on the site, for free. Enter your email once to keep reading.

45,000+ follow where these guides come from.No spam. Unsubscribe in one click.

Read next