npx -y cc-safety-net@latest install --cursor. It adds one preToolUse hook to your global Cursor hooks config, ~/.cursor/hooks.json, so the hook protects Cursor IDE and Cursor CLI sessions in every project. Then run npx cc-safety-net doctor to confirm the hook is active. The hook fails closed, which means Cursor denies a tool call when the hook cannot reach a decision.
Install CC Safety Net in Cursor
1
Run the installer
2
Confirm the hook is active
doctor output reads Detected, Configured, and Verified.
What the Cursor install changes
The installer writes this entry underhooks.preToolUse in ~/.cursor/hooks.json, inside a "version": 1 document:
What the Cursor hook checks
The hook checks Cursor’sShell tool calls and analyzes each command before it runs. Cursor’s working_directory must be inside the workspace roots. The hook denies the call when the field is declared but missing, or when it points outside the roots.
What happens when the Cursor check fails
The entry setsfailClosed: true, so Cursor denies a tool call the hook could not decide. The hook has a 30-second timeout.
Uninstall CC Safety Net from Cursor
~/.cursor/hooks.json alone.
If a native Cursor plugin is on disk, uninstall also removes it. It runs cursor-agent plugin marketplace remove cc-safety-net, deletes the plugin’s files under ~/.cursor/plugins/, and adds this to its report:
Other ways Cursor can run CC Safety Net
Cursor can run CC Safety Net through two more routes.install --cursor sets up neither of them. If one of them runs while the hook is also in place, Cursor checks every tool call twice. doctor reports both routes, but it cannot tell whether Cursor runs them.
Cursor through the Claude Code plugin
The Claude Code plugin also includes a Cursor plugin with the samefailClosed hook. Cursor runs it when it imports Claude Code plugins. Cursor imports them only from <home>/.claude, so this route ignores CLAUDE_CONFIG_DIR and CLAUDE_CODE_PLUGIN_CACHE_DIR.
When the install --cursor hook is also configured, doctor prints:
doctor counts Cursor as Configured and warns that Cursor runs the plugin only while it imports Claude Code plugins. If Cursor stops importing them, run install --cursor. In this case update does not add the npx hook, and the install selector shows Cursor as already installed.
Cursor through a native Cursor plugin
You can also add CC Safety Net to Cursor as a native Cursor plugin throughcursor-agent, which registers it on your Cursor account as a personal marketplace. Cursor pins a marketplace plugin to the commit it was added at, so cc-safety-net update cannot move it to a newer release. The npx hook resolves the current release on every call.
doctor counts the plugin when its downloaded files are under ~/.cursor/plugins/cache/cc-safety-net. Cursor keeps those files after you uninstall the plugin, so they do not prove the plugin still runs. When the install --cursor hook is also configured, doctor prints:
doctor counts Cursor as Configured. It still warns that it cannot check whether the plugin is enabled and that update cannot update the plugin. If /plugins in cursor-agent does not list CC Safety Net as installed, run install --cursor. In this case update does not add the npx hook.
Troubleshoot the Cursor hook
doctorwarns about a hook entry that changed. You or another tool edited the managed entry, for example itstimeoutorfailClosed. Runinstall --cursoragain to rewrite it. Managed hook drift lists the warnings.doctorreportsFailed to parse Cursor hooks config.~/.cursor/hooks.jsonis not valid JSON. Fix the file, then run the install again. See Hook config parse errors.- The selector shows Cursor as
CLI not installed. The selector runscursor --version, thencursor-agent --versionif that fails. Put one of the two on yourPATH.