CC Safety Net installs as a plugin or hook directly inside your AI coding agent — no separate process or daemon required, and there is no global npm i -g cc-safety-net step. It runs on Windows, macOS, and Linux, detecting the host OS for correct path handling and command resolution (for example, case-insensitive paths on Windows, and cmd.exe/PowerShell resolution via COMSPEC/PATHEXT). Node.js 18 or higher must be available on your system before you begin (this is why examples use npx/bunx for CLI subcommands). Choose your agent below to see the exact steps.
Claude Code
OpenCode
Kimi Code
Pi
Gemini CLI
Copilot CLI
Codex
Run these three commands inside Claude Code to install from the plugin marketplace:/plugin marketplace add kenryu42/cc-marketplace
/plugin install safety-net@cc-marketplace
/reload-plugins
Enable auto-updatesTo keep CC Safety Net up to date automatically, run /plugin, navigate to Marketplaces, select cc-marketplace, and enable auto-update. Install CC Safety Net with OpenCode’s native plugin command:opencode plugin -g cc-safety-net
OpenCode can sometimes keep using a stale cached plugin version. To force OpenCode to reinstall cc-safety-net, remove its cached package and reinstall:rm -rf ~/.cache/opencode/packages/cc-safety-net@latest
opencode plugin -g -f cc-safety-net@latest
If you prefer pinning a specific version:rm -rf ~/.cache/opencode/packages/cc-safety-net@latest
opencode plugin -g -f cc-safety-net@<version>
Restart OpenCode after updating so the plugin is loaded from the refreshed cache. Install CC Safety Net into your Kimi Code config:npx -y cc-safety-net hook install --kimi-code
This writes a [[hooks]] block to ~/.kimi-code/config.toml (or $KIMI_CODE_HOME/config.toml) that runs npx -y cc-safety-net hook --kimi-code on each PreToolUse Bash call. The command is idempotent, so running it again is safe. To remove it later, run npx -y cc-safety-net hook uninstall --kimi-code.Optionally install the /cc-safety-net skill so you can author rules interactively inside Kimi Code:npx skill add kenryu42/cc-safety-net
Install CC Safety Net with Pi’s package installer:pi install npm:cc-safety-net
Pi loads CC Safety Net as an in-process extension (declared via the pi.extensions field in the package), not as a subprocess hook. The extension intercepts the bash tool and custom Shell tools (for example pi-grok-cli), resolving each call’s working directory, and it also registers a /cc-safety-net builtin command for managing rulebooks. See Integration Architecture for details. Install the Gemini Safety Net extension with a single command, run from outside an interactive Gemini session:gemini extensions install https://github.com/kenryu42/gemini-safety-net
Restart Gemini CLI (or start a new session) after installing so the extension and its hook are loaded. Run the following inside GitHub Copilot CLI:/plugin install kenryu42/copilot-safety-net
Restart Copilot CLI after installing the plugin for it to take effect.
Hook support in Copilot CLI is version-gated. Inline hook definitions in Copilot config files require Copilot CLI 1.0.8 or later, and user hook files under ~/.copilot/hooks require 0.0.422 or later. The copilot-safety-net plugin handles this for you; if you configure hooks manually and hit issues, run npx cc-safety-net doctor — it reports the detected Copilot version and which hook sources are supported. Codex requires a few extra steps to enable plugin hook support before installing.Step 1 — Enable plugin hooksAdd the following to ~/.codex/config.toml:[features]
plugin_hooks = true
Step 2 — Add the marketplacecodex plugin marketplace add kenryu42/cc-marketplace
Step 3 — Install the plugin via the TUIStart Codex, then run /plugins in the TUI. Use the arrow keys to select [cc-marketplace] and press Enter to install.Step 4 — Trust the hookRun /hooks in the TUI, select the safety-net PreToolUse hook, and press t to trust it.
Verify Your Installation
After installing, run the doctor command to confirm CC Safety Net is wired up correctly and blocking commands as expected:
npx cc-safety-net doctor
# or with bun
bunx cc-safety-net doctor
doctor runs a full health check across every supported agent — hook integration, a self-test that confirms blocking works, custom-rule validation, active mode flags, recent activity, system versions, and an update check. See the doctor command reference for what each check does and the flags available.
If any check fails, the output includes a description of the problem and suggested remediation steps. Last modified on June 27, 2026