destructive-command-protection

Block destructive system and database commands via a Bash tool use hook.

1|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/hypeJunction/ai-assistant-starter --skill destructive-command-protection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: destructive-command-protection
Source: https://github.com/hypeJunction/ai-assistant-starter/tree/main/skills/destructive-command-protection
Command: npx skills add https://github.com/hypeJunction/ai-assistant-starter --skill destructive-command-protection

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents accidental or malicious execution of commands that could lead to irreversible data loss, system instability, or security breaches.

Core Features & Use Cases

  • Proactive Blocking: Intercepts and blocks dangerous commands before they are executed.
  • Comprehensive Coverage: Protects against filesystem destruction, database wipes, critical system operations, and more.
  • Use Case: An AI assistant attempting to run rm -rf / or DROP DATABASE production would be automatically blocked, preventing catastrophic data loss.

Quick Start

Ensure the hook is configured in your Claude Code settings to automatically protect your system.

Frequently Asked Questions about destructive-command-protection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I block destructive bash commands before they execute?

You block destructive bash commands by configuring a JavaScript hook script that intercepts tool use, analyzing command patterns against a predefined list of dangerous operations to prevent irreversible filesystem deletion and data corruption.

What is the best way to prevent an AI assistant from running rm -rf or DROP DATABASE?

The best way to prevent an AI assistant from running commands like rm -rf or DROP DATABASE is proactive runtime enforcement that intercepts and blocks dangerous operations before execution, safeguarding against catastrophic data loss.

How does command blocking protect against unauthorized resource modification?

Command blocking protects against unauthorized resource modification by requiring a JavaScript hook to analyze command patterns at runtime, identifying and preventing irreversible operations such as filesystem destruction and database wipes before they are executed.

Do I need specific environment settings to enable command blocking guardrails?

You need to ensure the JavaScript hook script is configured in your Claude Code settings to enable command blocking guardrails, requiring no additional dependencies to automatically protect your system.

What types of dangerous operations does this command blocking approach cover?

This command blocking approach covers comprehensive dangerous operations including filesystem destruction, database wipes, critical system operations, and unauthorized resource modification that could lead to irreversible data loss or security breaches.