npx cc-safety-net or bunx cc-safety-net.
doctor
Thedoctor command runs a full health check of your CC Safety Net installation and prints a summary of what it finds.
| Check | Description |
|---|---|
| Hook Integration | Verifies the plugin is properly configured for each supported platform |
| Self-Test | Runs sample commands to confirm blocking works correctly |
| Configuration | Validates custom rules in user and project configs |
| Environment | Shows status of mode flags (CC_SAFETY_NET_STRICT, CC_SAFETY_NET_PARANOID, etc.; legacy SAFETY_NET_* also listed when set) |
| Recent Activity | Summarizes blocked commands from the last 7 days |
| System Info | Displays versions of all relevant tools |
| Update Check | Checks if a newer version is available |
| Flag | Description |
|---|---|
--json | Output in JSON format (useful for sharing in bug reports) |
--skip-update-check | Skip the npm version check |
explain
Theexplain command traces how CC Safety Net analyzes a command step-by-step. Use it to debug why a command is blocked or allowed, or to understand how a custom rule applies.
| Flag | Description |
|---|---|
--json | Output the analysis as JSON |
--cwd <path> | Use a custom working directory for analysis |
statusline
Thestatusline command outputs CC Safety Net’s current status in a format suitable for your agent’s status line. It shows whether protection is active and which modes are enabled.
hook install
Install CC Safety Net’s PreToolUse hook directly into a supported agent’s config:--kimi-cli). See Installation for the recommended approach per agent.
rule
Therule command manages rulebook-based custom rules. See Custom Rules for the full authoring guide.
rule init
Create a starter project rule config and rulebook in the current directory:--global to create the user-scope config at ~/.cc-safety-net/rules/rule.json instead:
rule sync
Rebuild the lock and cache for configured rulebook sources. Run after adding or changing entries inrule.json:
rule verify
Validate the structure of all active rulebooks and rule definitions. Use this in CI or whenever you edit a rulebook by hand:0 if everything is valid, or non-zero if errors are found.
rule test
Run every fixture defined in every active rulebook and confirm rules block and allow as expected:rule migrate
Convert legacy inline config files (.safety-net.json, ~/.cc-safety-net/config.json) into the new rulebook layout:
--cleanup to delete the legacy files after the migrated rules are verified:
rule doc
Print a machine-readable document describing the rulebook schema. Pipe the output to your agent to let it help author or validate rulebooks interactively:—version and —help
You can check the installed version or get usage information at any time. The--version flag has a -V short alias, and --help has a -h short alias.
help <command> or <command> --help to see usage for a specific subcommand:
