block-dangerous-commands

A command-line safety guard that checks shell commands before they run and blocks selected dangerous operations. A shell is the text-based interface used to run system commands.

In plain words
What is it for?
Use it to screen commands such as destructive deletes, disk formatting, fork bombs, unsafe downloads, force-pushing to the main branch, hard Git resets, and Docker volume removal, with configurable safety and approval levels.
Why use it?
It reduces the chance that an agent will delete important files, damage disks, weaken permissions, or perform other risky actions by mistake.

Plugin for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Claude Code
/plugin marketplace add karanb192/claude-code-hooks
agentmods
npx agentmods add plugins/karanb192/claude-code-hooks/block-dangerous-commands
Clone the repo
git clone --depth 1 https://github.com/karanb192/claude-code-hooks

Made for: Claude Code.

Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Security

Grade B, and why

block-dangerous-commands scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

"description": "A PreToolUse guard for Bash that blocks dangerous shell commands before they execute: rm targeting home/root/system dirs, dd to disk devices, mkfs, fork bombs, curl|sh, force push to main, git reset --har

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

"description": "A PreToolUse guard for Bash that blocks dangerous shell commands before they execute: rm targeting home/root/system dirs, dd to disk devices, mkfs, fork bombs, curl|sh, force push to main, git reset --har
plugins/block-dangerous-commands/.claude-plugin/plugin.json · 21 lines

What it actually says

{
  "name": "block-dangerous-commands",
  "description": "A PreToolUse guard for Bash that blocks dangerous shell commands before they execute: rm targeting home/root/system dirs, dd to disk devices, mkfs, fork bombs, curl|sh, force push to main, git reset --hard, chmod 777, docker volume rm, and more. Three safety levels (critical/high/strict, picked via HOOK_SAFETY_LEVEL) control how much is blocked, and per-level ask mode (HOOK_ASK_*) turns a hard deny into a prompt you approve or reject. Every block is logged with the pattern id and reason.",
  "version": "1.0.0",
  "author": {
    "name": "Karan Bansal",
    "url": "https://github.com/karanb192"
  },
  "homepage": "https://github.com/karanb192/claude-code-hooks",
  "license": "MIT",
  "keywords": [
    "claude-code",
    "hooks",
    "security",
    "safety",
    "guardrails",
    "bash",
    "pretooluse"
  ]
}
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 21 lines scan B 43e04c40b1c9

Subscribe to this mod's changes

block-dangerous-commands is a plugin published in the GitHub repository karanb192/claude-code-hooks (494 stars, last pushed 9d ago), licensed MIT. Its token cost is not measured: this kind of file is read by the harness, not the model. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other plugins, from other repositories

memory-kit

Persistent memory for Claude Code agents: a hot cache injected every session and held under three size caps, per-session handoffs, and agent-audited promotion into knowledge articles and rules. Carries the builder's layers too — executor/recon/idea-validator agents, session review, second opinion, agent QA and a…

awrshift/claude-memory-kit · not measured

promptly-prompt

Clarity gate for prompts: intercepts unclear requests and forces AI to restate intent to align with the user, then diagnose the root cause and reuse the domain's mature, established practices before proceeding.

ViryaZheng/promptly-prompt · not measured

air marketplace

Plugin marketplace listing 2 plugins: voiceprint, time-sense.

gyozanisonline/air-powerups · not measured

time-sense

Claude always knows the real date and time. A tiny hook stamps every message with the current clock, so it stops guessing 'tonight' at noon.

gyozanisonline/air-powerups · not measured

voiceprint

Capture anyone's writing voice from real samples, then draft anything in it. No more generic AI drafts.

gyozanisonline/air-powerups · not measured

claude-ops

Claude Code operations toolkit. Twelve skills: audit-skill-visibility (audit whether each installed skill is actually VISIBLE to the model, and diagnose why most of a fleet never gets used — a skill is invisible when its description is dropped by Claude Code's skill-listing context budget, which sheds descriptions…

melodic-software/claude-code-plugins · not measured