guard

Blocks destructive shell commands and restricts file edits to a chosen directory.

Updated Sep 13, 2026
One-click install
npx skills add https://github.com/abdulazeezoj/monovella-poc --skill guard-abdulazeezoj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/abdulazeezoj/monovella-poc/tree/main/.agents/skills/gstack/guard
Command: npx skills add https://github.com/abdulazeezoj/monovella-poc --skill guard-abdulazeezoj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working on production systems or debugging live environments, a single mistyped command like rm -rf or an edit to the wrong file can cause serious damage. This Skill combines destructive command warnings with directory-scoped edit restrictions so risky operations are caught before they execute. ## Core Features & Use Cases - Destructive Command Warnings: PreToolUse hooks intercept Bash commands such as rm -rf, DROP TABLE, and force-push, warning before execution and hard-denying catastrophic shapes like recursive deletion of / or ~. - Directory-Scoped Edit Boundary: Edit and Write operations are blocked outside a user-specified directory, enforced via a freeze state file. - Combined Safety Mode: Merges the /careful and /freeze skills into one activation for maximum protection. - Use Case: While hotfixing a production checkout service, activate guard mode with the boundary set to the service directory so no command can wipe data and no edit can touch unrelated code. ## Quick Start Ask the assistant to activate guard mode and restrict all edits to your project's src directory.

Frequently Asked Questions about guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I block destructive commands like rm -rf in Claude Code?

Activate guard mode, which registers a PreToolUse hook on Bash that checks every command against destructive patterns such as rm -rf, DROP TABLE, and force-push. Dangerous commands trigger a warning, and catastrophic shapes like recursive deletion of / or ~ are hard-denied.

How to restrict AI file edits to a specific directory?

Guard mode asks which directory to restrict edits to, resolves it to an absolute path, and stores it in a freeze state file. PreToolUse hooks on Edit and Write then block any modification outside that boundary until you run /unfreeze.

Does guard mode work without the careful and freeze skills installed?

No. Guard references hook scripts from the sibling /careful and /freeze skill directories, so both must be installed. They are installed together by the gstack setup script.

Can I override a destructive command warning in guard mode?

Warnings for commands like rm -rf or force-push are overridable after review. However, catastrophic shapes such as recursive deletion of the root or home directory and force-push to the default branch are hard-denied and cannot be overridden.

How do I turn off the edit boundary set by guard mode?

Run /unfreeze to remove the directory edit boundary. To deactivate all protections entirely, end the session, since the destructive command guard is session-scoped.