guard

Combines destructive command warnings with directory-scoped edit restrictions for safer sessions.

Updated Mar 23, 2026
One-click install
npx skills add https://github.com/dhnpmp-tech/project-agent --skill guard-dhnpmp-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/dhnpmp-tech/project-agent/tree/main/.claude/skills/gstack/guard
Command: npx skills add https://github.com/dhnpmp-tech/project-agent --skill guard-dhnpmp-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working on production systems or live environments, a single destructive command (rm -rf, DROP TABLE, force-push) or an edit to the wrong file can cause serious damage. Guard mode layers two protections so risky operations are caught before they execute. ## Core Features & Use Cases - Destructive Command Warnings: Intercepts dangerous Bash commands like rm -rf, DROP TABLE, and force-push, warning you before they run (with override option). - Directory-Scoped Edits: Blocks Edit and Write operations outside a directory you specify, enforced via PreToolUse hooks. - Combined Protection: Merges the /careful and /freeze skills into a single activation for maximum safety. - Use Case: You are debugging a live production server and only want changes inside /app/config. Activate guard mode, set the boundary to /app/config, and any edit outside that path is blocked while destructive shell commands trigger warnings. ## Quick Start Ask the AI to activate guard mode and restrict edits to your target directory, for example: turn on guard mode and lock edits to the src folder.

Frequently Asked Questions about guard

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

FAQPage Schema
How do I block file edits outside a specific directory?

Activate guard mode and provide a directory path when prompted. The skill resolves it to an absolute path, saves it to a freeze state file, and PreToolUse hooks then block any Edit or Write call targeting files outside that boundary.

How do I get warnings before running destructive shell commands?

Guard mode hooks into Bash tool calls and checks each command against destructive patterns like rm -rf, DROP TABLE, and force-push. A warning appears before execution, and you can choose to override it.

Does guard mode require other skills to be installed?

Yes. Guard depends on the sibling careful and freeze skill directories for its hook scripts (check-careful.sh and check-freeze.sh). Both are installed together by the gstack setup script.

How do I turn off the edit boundary after activating guard mode?

Run the /unfreeze command to remove the directory edit boundary. To deactivate all protections entirely, end the current session, since the hooks are session-scoped.

Can I still run destructive commands if I really need to?

Yes. Destructive command checks produce warnings rather than hard blocks, so you can override and proceed. Only edits outside the frozen directory are strictly blocked.