careful

Intercepts destructive bash commands and prompts for confirmation before execution.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills --skill careful-lgj-jonathan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: careful
Source: https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills/tree/main/gstack/careful
Command: npx skills add https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills --skill careful-lgj-jonathan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Destructive shell commands like rm -rf, DROP TABLE, or git push --force can cause irreversible data loss when run accidentally, especially in production or shared environments. This Skill adds a safety checkpoint that warns you before such commands execute. ## Core Features & Use Cases - Destructive Pattern Detection: Hooks into every Bash tool call and checks for rm -rf, DROP TABLE, TRUNCATE, git force-push, git reset --hard, kubectl delete, and docker prune patterns. - Safe Exceptions: Allows recursive deletes of build artifacts like node_modules, dist, .next, pycache, and coverage without warnings. - User Override: Returns an "ask" permission decision with a clear warning message, letting you proceed or cancel on a case-by-case basis. - Use Case: While debugging a live production issue, you ask the AI to clean up old files. The hook catches an accidental rm -rf /var/data and warns you before any damage occurs. ## Quick Start Ask the AI to enable careful mode or safety mode before running shell commands against a production environment.

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 Claude Code?

Enable the careful skill, which registers a PreToolUse hook that scans every Bash command for recursive delete patterns. When a match is found, it returns an ask decision with a warning so you can confirm or cancel before execution.

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 ., kubectl delete, and docker rm -f or docker system prune.

Can I delete node_modules without triggering the warning?

Yes. The hook whitelists recursive deletes targeting only build artifacts such as node_modules, dist, .next, build, .turbo, coverage, .cache, and __pycache__. Commands limited to these targets pass without a warning.

Does the careful hook block commands permanently?

No. The hook returns a permissionDecision of ask, which displays a warning message and lets you choose to proceed or cancel. It never hard-blocks a command, and the protection ends when the session ends.

Why did the careful hook not catch my command?

The hook only inspects Bash tool commands matching its defined pattern list. Commands with unusual quoting may fall back to a Python JSON parser, and patterns outside the documented list, such as non-recursive rm, are not checked.