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
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
Scanned by
NVIDIA SkillSpector
Automated static analysis (no LLM) · v2.12.0 · 2026-11-19
Partial analysis: some checks could not run on this component.
7 observations in 3 categories
- Tool Misuse 4
- Agent Snooping 2
- MCP Rug Pull 1
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. Open one to see the lines it points at.
Agent Config Directory AccessAgent Snooping · README.md:16
| 14 | ``` |
| 15 | |
| 16 | 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: |
| 17 | |
| 18 | ```json |
Tool Parameter Abuse ×3Tool Misuse · tests/block-destructive-commands.test.ts:21
| 19 | const w = { ran: [] as string[] } |
| 20 | fakeEngine(on, w) |
| 21 | const r = await bash($, 'rm -rf ~/') |
| 22 | expect(r.deny).toContain('recursive delete') |
| 23 | expect(w.ran).toEqual([]) |
Skill EnumerationAgent Snooping · README.md:29
| 27 | ``` |
| 28 | |
| 29 | 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`. `claud |
| 30 | |
| 31 | **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 |
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.MCP Rug Pull · README.md:25
| 23 | |
| 24 | ```sh |
| 25 | npx claude-code-templates@latest --mod security/block-destructive-commands |
| 26 | claude |
| 27 | ``` |
Unsafe DefaultsTool Misuse · hooks/block-destructive-commands.ts:41
| 39 | { pattern: /\bmkfs(\.|\s)/, reason: 'filesystem format' }, |
| 40 | { pattern: /\bdd\s+.*\bof=["']?\/dev\//, reason: 'raw disk write' }, |
| 41 | { pattern: /\bchmod\s+(-R\s+)?777\b/, reason: 'world-writable permissions' }, |
| 42 | ] |
| 43 |
Learn more about NVIDIA SkillSpector or how components are reviewed.