Damage Control

Block dangerous commands and restrict sensitive path access in Claude Code.

Updated Jan 15, 2025
One-click install
npx skills add https://github.com/TobiasBak/dotfiles --skill damage-control-tobiasbak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Damage Control
Source: https://github.com/TobiasBak/dotfiles/tree/main/agent-files/skills/damage-control
Command: npx skills add https://github.com/TobiasBak/dotfiles --skill damage-control-tobiasbak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Damage Control defends Claude Code by intercepting tool calls before execution, blocking dangerous commands and protecting sensitive files via PreToolUse hooks. It also enforces guarded operations with Ask patterns and strict path protections to prevent unintended or destructive actions.

Core Features & Use Cases

  • Command Pattern Blocking: Blocks dangerous bash commands (rm -rf, git reset --hard, etc.) before they run.
  • Ask Patterns: Triggers confirmation dialogs for risky-but-valid operations (when needed).
  • Path Protection Levels: Defines zeroAccessPaths, readOnlyPaths, and noDeletePaths to control access to secrets and critical files.
  • Runtime Flexibility: Supports Python (UV) or TypeScript (Bun) implementations for executing hooks.
  • Project Scoping: Works at Global, Project, and Project Personal levels for flexible deployment.

Quick Start

Install Damage Control, then choose a protection level and add patterns to block dangerous 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 commands like rm -rf before they execute in Claude Code?

PreToolUse hooks intercept and block dangerous bash commands like rm -rf before execution in Claude Code. Damage Control enforces this by loading a patterns.yaml file to deterministically match and prevent destructive command patterns.

What is a PreToolUse hook for AI agent security and how does it work?

A PreToolUse hook intercepts tool calls before execution to enforce security policies. It loads runtime templates and patterns.yaml to validate commands and path access, deterministically blocking dangerous actions before they run.

How do I protect sensitive file paths from being modified or deleted by an AI coding assistant?

Path protection levels secure sensitive files by defining zeroAccessPaths, readOnlyPaths, and noDeletePaths. This constrains the AI coding assistant's file access, preventing unintended modifications or deletions to critical project directories.

Can I scope command blocking and path protection rules globally and per project?

Command blocking and path protection rules apply across global, project, and project-personal contexts. This scoping flexibility allows you to enforce broad baseline security policies while customizing specific protections for individual projects.

Does Damage Control support both Python and TypeScript runtimes for executing security hooks?

Damage Control supports both Python UV and TypeScript Bun runtimes for executing security hooks. This runtime flexibility allows integration into diverse development environments without forcing a specific language dependency.

What is the best way to enforce confirmation dialogs for risky but valid bash commands?

Ask patterns trigger confirmation dialogs for risky but valid bash commands. Configured within the patterns.yaml file, these patterns intercept operations requiring manual approval before execution, ensuring guarded operations.