SkillsMay 14, 2026·2 min read

Claude Code Safety Net — Block Destructive Commands

cc-safety-net adds a safety gate for Claude Code tool calls: explain/score risky commands (rm -rf, git resets) and validate custom rules (1,330★).

Agent ready

Review-first install path

This asset needs a review step. The copied prompt tells the agent to dry-run, show the writes, then proceed only after confirmation.

Needs Confirmation · 66/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Asset
Review-first command
npx -y tokrepo@latest install 9894f476-bf15-511f-bac9-37c1724d040d --target codex

Dry-run first, confirm the writes, then run this command.

Intro

cc-safety-net adds a safety gate for Claude Code tool calls: explain/score risky commands (rm -rf, git resets) and validate custom rules (1,330★).

Best for: Teams letting agents run shell commands but needing guardrails, auditability, and consistent “deny by default” rules

Works with: Claude Code native hooks/plugins, npx-based installs, and JSON outputs for automated gating

Setup time: 5-12 minutes

Main

  • Command risk UX: provides explainers for destructive commands before execution.
  • Custom rules: supports defining policy rules (block global npm installs, dangerous docker actions, etc.).
  • Validation gate: documents a --verify-config step so config changes are checked before you rely on them.
  • Agent-friendly outputs: includes JSON mode so an agent runner can decide allow/deny deterministically.

FAQ

  • Is this only for Claude Code?: It is designed around Claude Code hooks/commands, but the patterns are reusable for other agent runners.
  • How do I start safely?: Run doctor, then try explain on a few commands you commonly see in agent sessions.
  • Why validate configs?: A broken rule file can silently disable protections; validation keeps the gate trustworthy.
🙏

Source & Thanks

Source: https://github.com/kenryu42/claude-code-safety-net > License: MIT > GitHub stars: 1330 · forks: 62

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets