CC Safety Net logo

CC Safety Net

Visit

A PreToolUse hook that blocks destructive Git and file commands and secret access before AI coding agents run them, defeating reordered flags, shell wrappers, and one-liners.

Share:
View alternatives

CC Safety Net (Coding CLI Safety Net) is a PreToolUse hook that stands between an AI coding agent and your shell. Agent rules in CLAUDE.md or AGENTS.md can guide behavior, but they cannot enforce a hard limit, and a single rm -rf ~ or git checkout -- can wipe hours of work in one step. CC Safety Net parses what a command actually does before it runs, and blocks destructive commands and access to secrets such as SSH keys and .env files. Because it understands command intent rather than matching strings, reordering flags, shell wrappers, and interpreter one-liners cannot slip past it.

Pair it with Context Mode to keep agent context under control, and see Claude Code if you want the underlying terminal agent.

Key Features

  • PreToolUse interception: the hook runs before the tool call reaches the shell, so nothing unsafe executes.
  • Intent-aware parsing: it understands what a command does, so flag reordering, wrappers, and one-liners do not bypass the check.
  • Secret protection: SSH keys and .env files are guarded from being read or exfiltrated by an agent.
  • CI and coverage: the project ships a CI pipeline and code coverage, so the guard rules are tested rather than trusted.
  • Easy setup: an interactive selector installs it into one or more installed coding CLIs automatically.

Use Cases

Who Should Use This Tool?

  • Individuals running agents on personal machines: protect a home directory and SSH keys from a single stray command.
  • Teams that cannot afford a rollback: add a hard technical guard on top of written rules.
  • Anyone who has been burned: the project was started after an agent deleted a home directory with one command.

Problems It Solves

  1. Rules are advisory: a Markdown file can steer an agent, but it cannot enforce a shell-level limit.
  2. Command obfuscation: exact-string denylists miss reordered flags and wrapped commands.
  3. Secret leaks: agents can read keys and environment files without realizing the consequences.

Pricing

CC Safety Net is MIT licensed and entirely free. There is no hosted service or subscription; you run the hook yourself on the coding CLIs you already use.

Advantages & Unique Selling Points

  1. Semantic, not string matching: blocking is based on what the command does, making evasion much harder.
  2. Enforces technical limits: it is a real control point, not a suggestion in a prompt.
  3. Documented and tested: full docs, guides, and CI coverage support production use.

Getting Started

  1. Install Node.js 18 or later.
  2. Run the interactive selector to install CC Safety Net into one or more coding CLIs.
  3. Confirm the hook is active, then test a destructive command to see it blocked before execution.

Frequently Asked Questions

Which agents does it support?

It installs into the coding CLIs you already use, including Claude Code and similar PreToolUse-capable agents.

Can a command still bypass it?

Because it parses intent, common evasion tricks like reordering flags or adding a wrapper are caught. No guard is perfect, so keep backups.

Is it a hosted service?

No. It is a local MIT-licensed hook that you install and run yourself.

Alternatives

  • Claude Code: the terminal agent it most often guards.
  • Context Mode: manage agent context alongside the safety guard.
  • Cursor: AI-native editor for agent-assisted coding.

Tips

  1. Test the guard with a safe-looking but destructive command to confirm it fires before you trust it.
  2. Keep it installed per-CLI so every agent you run is covered.
  3. Read the security model docs to tune which commands and secrets are allowed.

Conclusion

CC Safety Net turns agent safety into a technical control rather than a written promise. If you run coding agents on a machine you care about, start at ccsafetynet.com and add an enforceable floor under your agent's feet.

Comments

No comments yet. Be the first to comment!