npx -y cc-safety-net@latest install --agy-cli. It adds a managed PreToolUse hook to ~/.gemini/config/hooks.json that runs npx -y cc-safety-net hook --agy-cli on each tool call. The hook checks shell commands from run_command and input sent to running tasks through manage_task. Then run npx cc-safety-net doctor to confirm the hook is active.
Install CC Safety Net in Antigravity CLI
1
Run the installer
2
Confirm the hook is active
doctor output reads Detected and Configured. It reads Detected and Not configured when the hook definition has enabled: false.
To use the /cc-safety-net skill in Antigravity CLI, add it separately. See The /cc-safety-net skill.
What the Antigravity CLI install changes
The installer writes to~/.gemini/config/hooks.json, because Antigravity shares the .gemini directory. The managed entry is named cc-safety-net. It registers a PreToolUse command hook that runs npx -y cc-safety-net hook --agy-cli with a 30-second timeout. Install creates the file if it is absent and re-enables a disabled managed entry.
What the Antigravity CLI hook checks
- The hook analyzes a
run_commandcall as a shell command. - The hook also analyzes a
manage_taskcall whoseActionissend_inputand whoseInputis a non-empty string. That text goes to a task that is already running. The hook analyzesInputas a shell command and detects its shell dialect. - The hook treats other
manage_taskactions as tool calls that run no command.
What happens when the Antigravity CLI check fails
Antigravity CLI blocks the tool call when the hook fails. A crash or non-zero exit, a timeout (30 seconds), a missingnpx, and output that is not valid JSON all stop the call. The project observed this on Antigravity CLI 1.4.5 on macOS in October 2026. Antigravity does not publish this as a contract.
Uninstall CC Safety Net from Antigravity CLI
~/.gemini/config/hooks.json alone.
Troubleshoot Antigravity CLI
doctorreportsError (Antigravity CLI): Failed to parse Antigravity hooks config <path>: <reason>.~/.gemini/config/hooks.jsonis not valid JSON, sodoctorcounts Antigravity CLI as not configured and exits1. Fix the JSON, then run the install again. See Hook config parse errors.- You edited the managed entry by hand.
doctorruns no drift checks for Antigravity CLI, so it does not warn when the entry changes. Install also leaves an active managed entry as it is. To restore the default entry, rununinstall --agy-cli, then run the install again.