What problem does it solve?
Guard mode prevents accidental destructive actions and unintended repository-wide edits by combining warnings for dangerous commands with a directory-scoped edit lock, reducing the risk of data loss or production outages.
Core Features & Use Cases
- Destructive command warnings: Detects risky operations like rm -rf, DROP TABLE, and force-push and prompts for confirmation before running.
- Directory-scoped edit restrictions: Restricts file edits to a user-specified directory path so changes outside the boundary are blocked.
- Integrated hooks: Runs pre-tool hooks for Bash and edit/write operations and records a local usage event for auditability.
- Use Case: Ideal for debugging live systems, performing high-risk maintenance, or granting temporary edit permissions during release windows.
Quick Start
Activate guard mode and set the directory to restrict edits to /path/to/allowed/dir to enable destructive-command warnings and lock edits to that path.