What problem does it solve?
Accidental execution of destructive commands like recursive file deletion, database drops, or force git pushes can cause irreversible data loss and system damage, especially when working on critical production systems or sensitive codebases.
Core Features & Use Cases
- Destructive Command Blocking: Intercepts and blocks high-risk bash commands including rm -rf, DROP TABLE, git push --force, git reset --hard, kubectl delete, and docker system prune before they execute.
- Optional Directory Freeze: Restricts all file edits to a user-specified directory, preventing unintended modifications to files outside the allowed scope.
- Explicit Override Support: Allows intentional execution of blocked commands when the user provides explicit confirmation, balancing safety with flexibility.
- Use Case: When deploying to a production environment, Guard prevents accidental force-pushes to the main branch, and when working on a sensitive payment processing module, it blocks edits to any files outside the src/payments/ directory.
Quick Start
Instruct Claude to activate Guard and freeze all file edits to the src/api/ directory to prevent accidental changes to unrelated parts of the codebase.