Thomaszhou22

Danger Guard Plugin — Development skill for Claude Code

Development community

Deterministic pre-exec interception of destructive shell commands for OpenClaw agents.

How to install Danger Guard Plugin

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Thomaszhou22/danger-guard-plugin and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Danger Guard Plugin does

Deterministic pre-exec interception of destructive shell commands for OpenClaw agents. Gateway-level pattern matching, not prompt-level.

Alternatives in Development

  • Careful — Activate destructive command warnings for the session 2.8k ★
  • Exec Summary — Compress a document or update into a crisp executive summary 1.3k ★
  • /codex-exec - Execute Codex CLI Commands — Easy wrapper for running Codex CLI commands from Claude Code with proper syntax 618 ★

README

Danger Guard Plugin

Deterministic pre-exec interception of destructive shell commands for OpenClaw agents. The block decision is made by code in the Gateway — not by the model — so it cannot be forgotten, distracted, or prompt-injected away.

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![OpenClaw Plugin](https://img.shields.io/badge/OpenClaw-plugin-blue)](https://openclaw.ai) [![ClawHub](https://img.shields.io/badge/ClawHub-danger--guard-red)](https://clawhub.ai) [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org)

[English](./README.md) | [中文](./README_CN.md)


Why a plugin, when the skill exists?

The [Danger Guard skill](https://github.com/Thomaszhou22/danger-guard-skill) teaches the agent to intercept dangerous commands. Its weakness — verified in real use — is that a skill is instructions the model must remember to follow. One day the context is long, the command is incomplete, and the skill never fires. The failure that inspired Skill Compass was exactly this: `rm -rf` went through, and the fix was editing the skill description. That fixes a prompt, not the architecture.

This plugin moves the check into the Gateway with the `before_tool_call` hook:

Agent decides to run a command
        ↓
Gateway pre-exec hook (code, not prompts)
        ↓
├── no match        → execute, agent never notices
├── Level 2 match   → approval required (warning)
└── Level 1 match   → blocked pending owner approval (critical)
                        /approve from the human, or deny

Pattern matching happens outside the model. The agent cannot bypass it, forget it, or be tricked around it.

Install

openclaw plugins install clawhub:danger-guard-plugin

Or from source:

git clone https://github.com/Thomaszhou22/danger-guard-plugin.git
cd danger-guard-plugin
npm install && npm run build
openclaw plugins install --link . --force
openclaw plugins enable danger-gu