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
.envfiles 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
- Rules are advisory: a Markdown file can steer an agent, but it cannot enforce a shell-level limit.
- Command obfuscation: exact-string denylists miss reordered flags and wrapped commands.
- 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
- Semantic, not string matching: blocking is based on what the command does, making evasion much harder.
- Enforces technical limits: it is a real control point, not a suggestion in a prompt.
- Documented and tested: full docs, guides, and CI coverage support production use.
Getting Started
- Install Node.js 18 or later.
- Run the interactive selector to install CC Safety Net into one or more coding CLIs.
- 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
- Test the guard with a safe-looking but destructive command to confirm it fires before you trust it.
- Keep it installed per-CLI so every agent you run is covered.
- 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!
Related Tools
Herdr
herdr.dev
Open-source runtime that keeps your coding agents alive: real terminal sessions on a background server, so Claude Code, Codex, and opencode keep working when.
cmux
cmux.com
Open-source Ghostty-based macOS terminal built for coding agents: vertical tabs, notification rings when agents need attention, split panes, an in-app browse.
Superset
superset.sh
Source-available desktop app (Elastic License 2.0) to run an army of CLI coding agents in parallel — Claude Code, Codex, OpenCode, and more — each in its own.
Related Insights
Seven AI Coding CLIs, Six Months: No Matter How Strong the Model, Work Needs Supervision
Claude Code, Codex, opencode, pi, omp and DeepSeek Harness all have personalities. After six months of deep use I run a division of labor: pi for the fastest cheapest reviews, omp for complex PRs, DeepSeek Harness on V4 Flash for high-frequency low-cost review, and Claude Code, Qoder and Cursor for writing. No matter how strong the model, work needs supervision — ideally from an independent third party.
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.
Claudesidian: Transform Obsidian into an AI-Powered Second Brain
Discover Claudesidian, an open-source project that perfectly integrates Obsidian with Claude Code. Built-in PARA method, custom commands, and automated workflows for a complete idea-to-implementation solution.