Back to Mods

Block Destructive Commands

Install Command
npx claude-code-templates@latest --mod security/block-destructive-commands
View on GitHub
claude-code — block-destructive-commands

Scanned by NVIDIA SkillSpector

Automated static analysis (no LLM) · v2.12.0 · 2026-10-17

Partial analysis: some checks could not run on this component.

6 observations
scanner score 88/100

SkillSpector looks for patterns such as shell commands, credential access, network calls or unpinned dependencies. An observation is something worth reading in the files before you install, not a confirmed vulnerability. Components that run code locally, like hooks, MCP servers and security tooling, naturally show more of them.

  • Agent Config Directory Access
    Agent Snooping · README.md:16
  • Tool Parameter Abuse ×3
    Tool Misuse · tests/block-destructive-commands.test.ts:21
  • MCP server referenced without pinned version: 'npx claude-code-templates'.
    MCP Rug Pull · README.md:25
  • Unsafe Defaults
    Tool Misuse · hooks/block-destructive-commands.ts:41

Learn more about NVIDIA SkillSpector.

Content

Claude Mod. A mod is a complete Claude Code plugin built on function hooks (Anthropic's mods/ layout); it is on by default in Claude Code 2.1.287+. Hooks module: hooks/block-destructive-commands.ts. Options: patterns (set in user or managed settings pluginConfigs, or /config). Run claude plugin validate on the installed folder to see every event it hooks and every $ call it makes.

block-destructive-commands

Denies Bash commands that match destructive patterns before they run. A tool.call hook under a { tool: "Bash" } matcher: on a match it returns { deny } without calling next, so nothing beneath (other plugins, PreToolUse shell hooks, the tool itself) runs; otherwise it passes through.

If the check itself fails (it throws or runs out of its time budget), the command is denied, never let through unchecked.

Options

  patterns: string  extra regex sources, comma-separated, e.g. "\\bkubectl\\s+delete\\b"

Declared in .claude-plugin/plugin.json (userConfig). Set them in /config, in user settings (~/.claude/settings.json, not project settings), with --settings <file> or in managed settings:

json
{ "pluginConfigs": { "block-destructive-commands@skills-dir": { "options": { } } } }

Install

sh
npx claude-code-templates@latest --mod security/block-destructive-commands
claude

It is written to .claude/skills/block-destructive-commands/, which Claude Code auto-loads as block-destructive-commands@skills-dir. For one session with hot reload: claude --plugin-dir .claude/skills/block-destructive-commands. claude plugin validate .claude/skills/block-destructive-commands prints every event it hooks and every $ call it makes.

Requirements. Mods are on by default in Claude Code 2.1.287+. Typed against Anthropic's declarations: https://github.com/anthropics/claude-code/tree/main/mods

Stack Builder

0 components

Your stack is empty

Browse components and click the + button to add them to your stack for easy installation.