Claude Code hook

CC Safety Net

Pre-execution guard hook that blocks dangerous git and filesystem commands issued by coding agents.

1,907 stars 88 forksHooks Plugin marketplace Source

Install

Inside Claude Code
/plugin marketplace add kenryu42/cc-safety-net
From source
git clone https://github.com/kenryu42/cc-safety-net.git

From 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…
Read the full README on GitHub

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.
Claude Code docs

Details

Type
Hooks
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

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.