Careful Mode Guardrails

0•

Intercepts and warns before executing potentially destructive bash commands, database mutations, and container operations in Claude Code.

The gstack-careful skill introduces an automated safety layer for Claude Code by checking bash tool calls against known dangerous operations before they run. It actively detects high-risk commands such as recursive file deletions (rm -rf), unconstrained database drops and truncations, destructive git history modifications (force pushes and hard resets), Kubernetes resource deletions, and Docker prunes. Safe build artifacts like node_modules, dist, and cache directories are automatically allowlisted to prevent unnecessary friction, while all other destructive commands prompt user confirmation with an explicit override mechanism, making it indispensable for live environment debugging, production maintenance, and shared infrastructure work.

Key Features

01Configurable prompt confirmation allowing manual user override when needed
02PreToolUse bash hook that intercepts destructive CLI commands before execution
03Smart allowlist for standard build and dependency cache cleanup (node_modules, dist, cache)
04Detection for risky patterns across Git, SQL databases, Docker, and Kubernetes
050 GitHub stars
06Session-scoped execution designed specifically for prod debugging and shared environments

Use Cases

01Protecting repository commit history and uncommitted changes during complex git rebase workflows
02Guarding shared staging clusters and cloud namespaces against unintended kubectl or Docker wipes
03Preventing accidental data loss or downtime when debugging live production servers