Claude Code hook
CC Safety Net
Pre-execution guard hook that blocks dangerous git and filesystem commands issued by coding agents.
Install
/plugin marketplace add kenryu42/cc-safety-netgit clone https://github.com/kenryu42/cc-safety-net.gitFrom the README
English · 简体中文 · 日本語
https://github.com/user-attachments/assets/353c1441-9156-483c-b8e5-32fce7905a83
CC Safety Net (Coding CLI Safety Net) blocks destructive commands and access to secrets such as SSH keys and .env files before the tool call runs. It parses what the command does. Wrapping the command or reordering flags does not hide it. A broken config file falls back to safe defaults instead of stopping your agent. It is not a sandbox: it does not contain processes, set filesystem permissions, or watch network egress.
Full documentation → covers installation, configuration, reference material, guides, and the security model. This README is the short version.
How it works
Supported coding CLIs
CC Safety Net supports these coding agent CLIs on Windows, macOS, and Linux.
Amp Code
Antigravity CLI
Claude Code
Codex
Cursor
DeepSeek Harness
Devin CLI
Factory Droid
Gemini CLI
GitHub Copilot CLI
Grok Build
Hermes Agent
Kimi Code
OpenClaw
OpenCode
Pi
Features
- Blocks destructive commands such as git reset --hard, git push --force, and rm -rf on dangerous targets, and install scripts piped from the internet (curl … | bash), even inside bash -c or python -c. See Blocked commands.
- Blocks secret access to SSH keys, .env files, ~/.aws, and coding-CLI credentials, from the shell and from the agent's file tools. See Secret protection.
- Tunes the policy in a GUI. Run npx cc-safety-net gui to pick the Standard, Strict, or Paranoid preset and turn rules on or off. See Dashboard.
- Adds blocks through rulebooks: official packs for Terraform, AWS, gcloud, and Azure, or your own JSON. See Official rulebooks.
- Shares policy through git. Commit .cc-safety-net/ so clones and cloud sessions get the same rules. See…How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- kenryu42/cc-safety-net
- Type
- Hooks
- Website
- ccsafetynet.com
- Language
- TypeScript
- License
- MIT
- Last updated
- 3 November 2026
- Topics
- ai-agentsai-safetyantigravityclaudeclaude-codeclaude-code-plugincodexcodex-clicoding-agentcursordeveloper-toolsdsh
FAQ
What is CC Safety Net?
Pre-execution guard hook that blocks dangerous git and filesystem commands issued by coding agents. It is a hook for Claude Code, from kenryu42/cc-safety-net on GitHub.
How do I install CC Safety Net?
Run /plugin marketplace add kenryu42/cc-safety-net inside Claude Code, then follow the setup in the README.
Is CC Safety Net popular?
kenryu42/cc-safety-net has 1,907 GitHub stars and 88 forks. It was last updated on 3 November 2026.
More hooks
Claude Code Prompt Improver
2kseverity1/claude-code-prompt-improver
Intelligent prompt improver hook for Claude Code. Type vibes, ship precision.
Everything Claude Code Zh
2kxu-xiang/everything-claude-code-zh
everything-claude-code 中文翻译项目:完整的 Claude Code 配置集合(agents, skills, hooks, commands, rules, MCPs)。源自 Anthropic 黑客松获胜者的实战配置,助力中文工程师高效理解与使用 Claude Code。
Claude Memory Compiler
1.3kcoleam00/claude-memory-compiler
Hooks that capture sessions and compile them into evolving project memory for Claude Code.
claude-code-hooks
572karanb192/claude-code-hooks
Collection of safety, cost, observability and productivity hooks, also installable as a plugin marketplace.
Skillshare
2.9krunkids/skillshare
Sync skills, agents, MCP, plugins to all AI CLI tools with one command and simplify team sharing.
Kubb
1.8kkubb-labs/kubb
Turn your API spec into type-safe code. Generate TypeScript types, API clients, hooks, validators and mocks from a spec such as OpenAPI.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.