Block Destructive Commands
npx claude-code-templates@latest --mod security/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.
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 AccessAgent Snooping · README.md:16
- Tool Parameter Abuse ×3Tool 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 DefaultsTool Misuse · hooks/block-destructive-commands.ts:41
Learn more about NVIDIA SkillSpector.
Content
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:
{ "pluginConfigs": { "block-destructive-commands@skills-dir": { "options": { } } } }Install
npx claude-code-templates@latest --mod security/block-destructive-commands
claudeIt 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