careful

Block destructive Bash commands via a PreToolUse validation hook.

4|1|Updated May 31, 2015
One-click install
npx skills add https://github.com/samcdavid/dotfiles --skill careful-samcdavid
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: careful
Source: https://github.com/samcdavid/dotfiles/tree/main/claude/skills/careful
Command: npx skills add https://github.com/samcdavid/dotfiles --skill careful-samcdavid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protects production data and critical infrastructure by blocking dangerous shell commands in real-time.

Core Features & Use Cases

  • Destructive command guardrails: blocks rm -rf, DROP TABLE, force-push, kubectl delete across Bash sessions.
  • Session-scoped protection: active for the current session until a new session starts.
  • Safe disablement: requires starting a new session to bypass the guard.

Quick Start

Invoke /careful to enable destructive-command blocking for the current session.

Frequently Asked Questions about careful

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

FAQPage Schema
How do I block destructive bash commands like rm -rf before they execute?▼

Bash command guardrails intercept destructive commands using a PreToolUse hook that validates input and denies dangerous patterns like rm -rf before execution, protecting production data and critical infrastructure in real time.

What shell commands does destructive command protection typically cover?▼

Destructive command protection covers risky shell operations including file deletions, database drops like DROP TABLE, force-push, and kubectl delete, applying guardrails across Bash sessions and scripts.

Can I disable command blocking if I need to run a risky operation intentionally?▼

You can disable command blocking safely by starting a new session. The protection is session-scoped, remaining active for the current session until you initiate a new one to bypass the guard.

Does command blocking work for both interactive shells and automated scripts?▼

Command blocking works for both interactive Bash sessions and scripts. It applies to risky operations across shells and scripts, blocking destructive commands like file deletions and force-push scenarios.

What's the best way to protect production data from accidental command line deletions?▼

The best way to protect production data is to enable destructive-command blocking, which prevents risky operations like file deletions and database drops from executing in real time during your Bash session.