CC Safety Net: Block Destructive Commands in Claude Code
CC Safety Net is a Claude Code plugin hook that blocks destructive commands like git reset --hard and rm -rf, plus access to secrets, before a tool call runs.
By Claudekit Team Published 1 min read
- Type
- Plugin
- Pricing
- Open Source
- Repository
- github.com
- GitHub stars
- 1,768
- Website
- ccsafetynet.com
CC Safety Net (Coding CLI Safety Net) is a guardrail that installs into Claude Code as a plugin hook. Before each tool call it checks what the command will actually do and blocks destructive operations and secret access, such as git reset --hard, git push --force, risky rm -rf or reading .env files and SSH keys.
Checked 24 Oct 2026 against the repo README, plugin.json (version 2.6.19) and the project’s Claude Code install docs. MIT licensed.
Who it is for
Anyone who runs Claude Code with broad permissions or in auto modes and wants a hard stop for the handful of commands that can destroy work or leak credentials.
Install
From the project’s Claude Code install docs (Node.js 18+):
npx -y cc-safety-net@latest install --claude-code
npx cc-safety-net doctor
The installer adds the cc-marketplace marketplace and installs the cc-safety-net@cc-marketplace plugin. The README’s general command, npx -y cc-safety-net@latest install, installs into every supported coding CLI on the machine.
What it does
- Runs
cc-safety-net hook --coding-clion Claude Code’s PreToolUse event. - Blocks destructive git and filesystem commands, and piped install scripts like
curl ... | bash, even insidebash -corpython -c. - Blocks access to SSH keys,
.envfiles,~/.awsand coding-CLI credentials from both the shell and file tools. - Falls back to safe defaults if its config file is broken.
- Team policy can be committed in
.cc-safety-net/so every clone gets the same rules.
Pros
- Parses commands instead of matching strings, so simple tricks do not slip through.
- Presets and a GUI make tuning easy.
- Works with many coding CLIs, not just Claude Code.
Cons and caveats
- Not a sandbox; pair it with a real sandbox if you need isolation.
- Third-party plugin auto-update is off by default; the docs show how to enable it.
- Strict presets may block commands you actually want, so expect some tuning.
Links
- Repo: kenryu42/cc-safety-net
- Docs: ccsafetynet.com/docs
- Related: Hookify, Security Guidance, hooks guide
Frequently asked questions
Is it a sandbox?
No. The README says it does not contain processes, set filesystem permissions or watch network egress. It checks commands and file access before tool calls run.
Can wrapping a command bypass it?
The README says it parses what the command does, so wrapping it in bash -c or python -c, or reordering flags, does not hide it.
How do I change what it blocks?
Run npx cc-safety-net gui to pick the Standard, Strict or Paranoid preset and toggle rules, or add rulebooks for Terraform, AWS, gcloud, Azure or your own JSON.
What does it need?
Node.js 18 or higher.