⌘

Blast Radius

v2.0.4🛡️Tier 1 Security AuditedCLI v2.1.287+ Verified

Pre-execution AST blast radius auditor for Claude Code CLI. Intercepts bash commands, dangerous file deletions, env leaks, and unexpected AST mutations before local execution.

@security-craft•★3,420 stars•↓14,240 active installs•MIT License
View Source ↗
⚡Installation Specifier
$/plugin install blast-radius@marketplace

Problem Solved & Architectural Motivation

Anthropic’s Claude Code CLI runs with ambient host terminal authority. When Claude plans high-velocity refactors, it can execute cascading recursive shell operations like `rm -rf`, execute unverified package scripts, or inadvertently rewrite environment credential stores (`.env.production`). Blast Radius injects a zero-latency Tree-sitter AST scanner before `tool.call` dispatch to evaluate blast radius score (0-100), blocking dangerous commands and prompting developer confirmation for medium-risk modifications.

Before Execution

Zero-Time AST Interception

Evaluates tool payloads prior to kernel fork.

Scoring Model

0-100 Impact Index

Weighted heuristic scoring: files touched, git dirty state, env scope.

Non-Intrusive

Native CLI Hook

Zero proxy daemon required; hooks straight into Claude tool calls.

Lifecycle Architecture & Hook Flow

POSIX Event Engine
Step 01
Claude Plan
Prompt Inference
→
Step 02
Tool Call
tool.call Payload
→
HOOK INTERCEPT
blast-radius
<18ms Heuristic
→
Step 04
OS Execution
Kernel Fork

Manifest Schema (plugin.json)

{
  "$schema": "https://claudemods.org/schemas/plugin.v2.json",
  "name": "blast-radius",
  "version": "2.0.4",
  "publisher": "@security-craft",
  "entrypoint": "dist/register.js",
  "hooks": [
    {
      "event": "tool.call:execute_bash",
      "priority": 100,
      "blocking": true
    },
    {
      "event": "tool.call:fs.write",
      "priority": 90,
      "blocking": true
    }
  ],
  "permissions": {
    "fs.read": [
      "."
    ],
    "fs.write": [],
    "network": "none",
    "env.read": [
      "PWD",
      "CLAUDE_SESSION_ID"
    ]
  },
  "configSchema": {
    "maxRiskScore": {
      "type": "number",
      "default": 65
    },
    "allowRules": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}

Hook Implementation (register.js)

TypeScript SDK
import { defineMod, registerHook } from '@claude/code-plugin-sdk';
import { analyzeAST } from './tree-sitter-guard.js';

export default defineMod({
  name: 'blast-radius',
  version: '2.0.4',
  setup({ on }) {
    on('tool.call:execute_bash', async (ctx) => {
      const { command } = ctx.payload;
      const score = await analyzeAST(command);
      
      if (score >= 65) {
        return ctx.abort(`Blast Radius exceeded threshold (${score}/100): command blocked for safety.`);
      }
      if (score >= 35) {
        const approved = await ctx.promptConfirm(`High blast radius (${score}/100): Execute "${command}"?`);
        if (!approved) return ctx.abort('Cancelled by developer.');
      }
      return ctx.proceed();
    });
  }
});
Security Audit98/100
Network EgressNone (Zero Socket Egress)
Filesystem ScopeBounded to Workspace
Credential Exposure0 Leaks Detected
Sandbox IsolationHost User Privilege

Technical Specifications

Min CLI Versionv2.1.287+
Categorytool-guards
Runtime Overhead< 18ms AST
LicenseMIT
Mod Publisher