Block destructive commands before your AI agent runs them.
Don't rely on guidelines to stop a bad command. CC Safety Net hooks into your coding agent and blocks destructive git and filesystem operations before they run.
$ git reset --hard HEAD
✖ BLOCKED by CC Safety Net
Reason: destroys all uncommitted changes. Use 'git stash' first.
If this operation is truly needed, ask the user for explicit permission and have them run the command manually.
$ git checkout -b feature/auth
✔ allowed
Destructive intent gets a hard stop.
These are a few examples of destructive git and filesystem operations CC Safety Net catches before your AI coding agent can run them. Read the docs for the full list of blocked operations and matching behavior.
$ git reset --hard
blocked
Reason: discards every uncommitted change in the current branch.
$ git restore .
blocked
Reason: discards tracked file changes in the working tree.
$ git clean -fd
blocked
Reason: deletes untracked files and directories from the workspace.
$ git push --force
blocked
Reason: overwrites remote branch history without lease protection.
$ rm -rf ~
blocked
Reason: recursively removes the home directory.
$ rm -rf .
blocked
Reason: recursively removes the current project directory.
How CC Safety Net works
It sits in the command path for your coding agent, checks the bash command before it runs, and returns a clear denial when the command would destroy local state.
Agent proposes a command
Codex, Claude Code, OpenCode, or another supported CLI prepares a shell command for your workspace.
The hook inspects it first
CC Safety Net runs before execution and analyzes the command intent instead of relying on brittle text patterns.
Destructive intent is blocked
Dangerous git and filesystem operations are denied, including supported shell wrapper forms like bash -c.
Make your own custom rules
Tell your coding agent what your team wants blocked. The CC Safety Net skill can inspect your project, draft the rulebook, verify it, and fix errors without making you hand-write JSON.
$ /cc-safety-net read my package.json and suggest blocking rules
$ /cc-safety-net set up rules to block all terraform destroy commands
$ /cc-safety-net verify my rules and fix any errors
Works with every major coding agent
One install protects every shell command. Use it with Codex, Claude Code, Copilot CLI, Gemini CLI, Kimi Code, OpenCode, and Pi.
~/cc-safety-net/install
# set plugin_hooks = true under [features] in ~/.codex/config.toml
$ codex plugin marketplace add kenryu42/cc-marketplace
# in Codex: /plugins → select cc-marketplace → install safety-net, then /hooks → trust safety-net
✔ safety net active
Destructive commands are now blocked before they execute.
$