careful

Intercepts destructive bash commands and prompts for confirmation before execution.

1|Updated Jul 23, 2026
One-click install
npx skills add https://github.com/sanjanb/my-agent-harness --skill careful-sanjanb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: careful
Source: https://github.com/sanjanb/my-agent-harness/tree/main/skills/careful
Command: npx skills add https://github.com/sanjanb/my-agent-harness --skill careful-sanjanb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? AI agents and developers can accidentally run destructive commands like rm -rf, DROP TABLE, or git push --force, causing irreversible data loss or production outages. This Skill adds a safety checkpoint that warns before such commands execute. ## Core Features & Use Cases - Destructive Command Detection: A PreToolUse hook scans every Bash command for dangerous patterns including recursive deletes, SQL DROP/TRUNCATE, git force-push, git reset --hard, kubectl delete, and docker prune. - Safe Exceptions: Routine cleanup of build artifacts like node_modules, dist, .next, and pycache passes through without warnings. - User Override: Each warning returns an "ask" permission decision, so you can review the risk and choose to proceed or cancel. - Use Case: While debugging a live production issue, activate safety mode so any kubectl delete or force-push suggested by the agent triggers a confirmation prompt instead of executing immediately. ## Quick Start Ask the agent to enable careful mode with a phrase like "be careful" or "safety mode" before running commands in 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 or destructive commands from an AI agent?

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

What destructive commands does the careful hook detect?

It detects recursive deletes (rm -r), 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.

Can I still delete node_modules or build folders without warnings?

Yes. Standalone recursive deletes of build artifacts such as node_modules, .next, dist, __pycache__, .cache, build, .turbo, and coverage are whitelisted and pass without prompting.

Can I override a destructive command warning?

Yes. The hook returns an ask permission decision rather than a hard block, so you can review the warning message and choose to proceed with the command or cancel it.

How do I turn off safety mode after activating it?

The hooks are session-scoped, so safety mode deactivates automatically when you end the conversation or start a new session. No manual cleanup is required.