careful

Warn before destructive Bash commands via a PreToolUse hook.

9|3|Updated Jan 29, 2022
One-click install
npx skills add https://github.com/I194/PMTools_2.0 --skill careful-i194
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: careful
Source: https://github.com/I194/PMTools_2.0/tree/main/.claude/skills/gstack/careful
Command: npx skills add https://github.com/I194/PMTools_2.0 --skill careful-i194

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents unintended data loss by warning before destructive commands and requiring explicit confirmation.

Core Features & Use Cases

  • PreToolUse Bash hook that scans each command for dangerous patterns (rm -rf, git reset --hard, kubectl delete, and similar) and prompts a warning with an option to proceed or cancel.
  • Safe exceptions allow certain operations to pass without warnings under controlled conditions.
  • Audit logging of guarded commands and usage analytics to support compliance and post-incident reviews.

Quick Start

Enable careful mode to automatically warn before executing destructive commands and let you override when appropriate.

Frequently Asked Questions about careful

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

FAQPage Schema
How do I prevent unintended data loss from destructive bash commands?

To prevent unintended data loss, you can use a safety guardrail that inspects bash commands via a PreToolUse hook. It warns before executing risky operations like rm -rf, requiring explicit confirmation to proceed or cancel.

Can I get a warning before running git reset --hard or kubectl delete in production?

Yes, safety guardrails can warn before running git reset --hard or kubectl delete in production. A PreToolUse Bash hook scans input for these destructive patterns and prompts an explicit warning with an option to proceed.

How do I set up a PreToolUse hook to block dangerous shell commands?

Setting up a PreToolUse hook to block dangerous shell commands involves enabling careful mode. This automatically scans each bash command for risky patterns, blocks execution, and issues an explicit warning message with user override options.

Is there a way to audit and log destructive commands for compliance reviews?

Auditing destructive commands for compliance is possible by logging usage analytics. The guardrail maintains an audit log of guarded commands and user overrides to support post-incident reviews and compliance tracking.

Can I safely allow specific destructive commands to run without warnings?

Yes, you can allow specific destructive commands to run without warnings using safe exceptions. These controlled exceptions let predefined operations pass the PreToolUse hook without triggering the standard warning prompt.

What are the limitations of using command warnings for production safety?

Limitations of using command warnings for production safety include relying on user overrides to proceed. While the PreToolUse hook inspects for patterns like rm -rf, users can still bypass warnings, making audit logging essential for post-incident review.