Blast Radius
v2.0.4🛡️Tier 1 Security AuditedCLI v2.1.287+ VerifiedPre-execution AST blast radius auditor for Claude Code CLI. Intercepts bash commands, dangerous file deletions, env leaks, and unexpected AST mutations before local execution.
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.
Zero-Time AST Interception
Evaluates tool payloads prior to kernel fork.
0-100 Impact Index
Weighted heuristic scoring: files touched, git dirty state, env scope.
Native CLI Hook
Zero proxy daemon required; hooks straight into Claude tool calls.
Lifecycle Architecture & Hook Flow
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)
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();
});
}
});Technical Specifications
Related tool-guards Mods
Automatic API key, SSH credential, and secret redaction proxy for terminal outputs and tool requests.
Zero-trust policy engine and human-in-the-loop escalation guardrail for sensitive terminal commands.
POSIX command sanitizer preventing accidental recursive deletes, fork bombs, and sudo privilege escalation.