careful

Intercepts destructive bash commands and prompts for confirmation before execution.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/VertaKhan/cs_gstack --skill careful-vertakhan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: careful
Source: https://github.com/VertaKhan/cs_gstack/tree/main/.claude/skills/gstack/careful
Command: npx skills add https://github.com/VertaKhan/cs_gstack --skill careful-vertakhan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Accidentally running destructive commands like rm -rf, DROP TABLE, or git push --force can cause irreversible data loss or production outages. This Skill adds a safety layer that inspects every bash command before it runs and warns you when a destructive pattern is detected, letting you confirm or cancel. ## Core Features & Use Cases - Destructive Pattern Detection: Flags recursive deletes (rm -rf), SQL DROP/TRUNCATE, git force-push, git reset --hard, git checkout/restore of the working tree, kubectl delete, and docker force-remove or prune. - Safe Exceptions: Allows routine cleanup of build artifacts such as node_modules, dist, build, pycache, .next, .turbo, and coverage without triggering warnings. - Use Case: While debugging a live production environment, you ask the assistant to clean up old files. When it attempts rm -rf /var/data, the hook intercepts the command and asks for explicit confirmation, preventing accidental deletion of production data. ## Quick Start Ask the assistant to enable careful mode or safety mode for this session so every bash command is checked for destructive patterns before running.

Frequently Asked Questions about careful

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

FAQPage Schema
How do I prevent accidental rm -rf commands in a terminal session?▼

Enable careful mode, which installs a PreToolUse hook that scans every bash command for recursive delete patterns. When rm -rf targets anything other than known build artifacts like node_modules or dist, it returns an ask decision so you can confirm or cancel.

What destructive commands does the careful hook detect?▼

The hook detects rm -rf and rm --recursive, SQL DROP TABLE, DROP DATABASE, and TRUNCATE, git push --force, git reset --hard, git checkout or restore of the working tree, kubectl delete, and docker rm -f or docker system prune.

Can I still delete node_modules without getting a warning?▼

Yes. The hook whitelists recursive deletes that only target build artifacts: node_modules, .next, dist, __pycache__, .cache, build, .turbo, and coverage. Commands limited to those targets pass through without a confirmation prompt.

Does the careful hook block commands permanently?▼

No. The hook returns a permissionDecision of ask with a warning message, so you can always override the warning and proceed. It never hard-blocks a command, and the protection ends when the session ends since hooks are session-scoped.

Why did the careful hook not warn about my command?▼

The hook only matches the specific destructive patterns listed in its checks, and it allows commands it cannot parse. If your command used an unrecognized variant or only targeted whitelisted build directories, it would pass without a warning.