Damage Control

Block dangerous commands and protect sensitive files via PreToolUse hooks in Claude Code.

Updated Oct 20, 2025
One-click install
npx skills add https://github.com/bjornallvin/cc-plugins --skill damage-control-bjornallvin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Damage Control
Source: https://github.com/bjornallvin/cc-plugins/tree/main/secure-env/skills/damage-control
Command: npx skills add https://github.com/bjornallvin/cc-plugins --skill damage-control-bjornallvin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml.

What problem does it solve?

Protects Claude Code from executing dangerous commands and accessing sensitive files by enforcing a defense-in-depth security system.

Core Features & Use Cases

  • Command pattern blocking: intercepts harmful bash commands (rm -rf, git reset --hard, etc.) before they run.
  • Path-based protection: zeroAccessPaths, readOnlyPaths, and noDeletePaths guard sensitive data and system areas.
  • Confirmation prompts: ask patterns trigger explicit user confirmation for risky operations.
  • Easy integration: ships with YAML patterns and reusable hook implementations (Python/TypeScript) that load at runtime.
  • Use Case: enforce guardrails in shared Claude Code environments to prevent inadvertent data loss or security breaches.

Quick Start

Install and enable the Damage Control hooks, then customize patterns.yaml to cover your team's critical paths and commands.

Frequently Asked Questions about Damage Control

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

FAQPage Schema
How do I block dangerous bash commands in Claude Code before they execute?

You can block dangerous bash commands in Claude Code by implementing PreToolUse hooks that intercept harmful patterns like rm -rf or git reset --hard before execution. Damage Control loads configurable patterns.yaml files at runtime to enforce these command restrictions automatically.

Can I protect sensitive files and directories from being modified by Claude Code?

Yes, you can protect sensitive files in Claude Code by configuring path-based permissions. Damage Control uses zeroAccessPaths, readOnlyPaths, and noDeletePaths configurations to guard sensitive data and system areas from unintended modification or deletion.

How do I require user confirmation for risky operations in Claude Code?

To require user confirmation for risky operations in Claude Code, define ask patterns in your configuration. Damage Control triggers explicit confirmation prompts when Claude Code attempts operations matching these patterns, preventing inadvertent data loss or security breaches.

Do I need Python or Bun to run security hooks in Claude Code?

You need either Python UV or Bun to run security hooks in Claude Code. Damage Control ships with reusable hook implementations in both languages that load patterns.yaml at runtime, enforcing PreToolUse and permission hooks during command execution.

How do I set up security guardrails for shared Claude Code environments?

To set up security guardrails for shared Claude Code environments, install Damage Control hooks globally or at the project level, then customize patterns.yaml to cover your team's critical paths and commands. This defense-in-depth system prevents inadvertent data loss across shared setups.

What is a PreToolUse hook and when do I need it for Claude Code security?

A PreToolUse hook is an interception mechanism that runs before Claude Code executes commands. You need it for Claude Code security when enforcing command pattern blocking, path-based protection, and confirmation prompts to prevent dangerous operations from running.