careful

Intercepts destructive bash commands and prompts for confirmation before execution.

107|7|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/no-session/pstack --skill careful-no-session
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: careful
Source: https://github.com/no-session/pstack/tree/main/careful
Command: npx skills add https://github.com/no-session/pstack --skill careful-no-session

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, especially when working 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. - 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 so you can review the warning and choose to proceed or cancel. - Use Case: While debugging a live production issue, you ask the AI to clean up old data. If it generates a DROP TABLE or kubectl delete command, the hook intercepts it and warns you before anything runs. ## Quick Start Ask the AI to enable careful mode before running any commands against the production database.

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 or destructive commands in Claude Code?

Enable the careful skill, which registers a PreToolUse hook that scans every Bash command for destructive patterns like rm -rf, DROP TABLE, and git push --force. When a match is found, it returns an ask decision so you can confirm or cancel before execution.

What destructive commands does the careful hook detect?

It detects recursive rm, SQL DROP TABLE/DATABASE and TRUNCATE, git push --force, git reset --hard, git checkout/restore of the working tree, kubectl delete, and docker rm -f or system prune. Each match triggers a specific warning message.

Can I still delete node_modules or build folders without warnings?

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

Can I override a destructive command warning?

Yes. The hook returns a permissionDecision of ask rather than a hard block, so you always see the warning and can choose to proceed. The protection is a checkpoint, not a lockout.

How do I turn off careful mode after activating it?

End the conversation or start a new session. The PreToolUse hook is session-scoped, so it stops intercepting commands once the session ends.