guard

Detect destructive commands and restrict file edits to a safe directory.

1|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/a29paul/hexlens --skill guard-a29paul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/a29paul/hexlens/tree/main/.claude/skills/gstack/guard
Command: npx skills add https://github.com/a29paul/hexlens --skill guard-a29paul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When working on production systems or critical codebases, accidental execution of destructive commands (like rm -rf, DROP TABLE, or force-push) or unintended edits to files outside your intended work scope can cause severe outages, data loss, or irreversible damage. This skill eliminates that risk by enforcing two layers of proactive protection.

Core Features & Use Cases

  • Destructive command warnings: Alerts you before executing high-risk commands such as rm -rf, DROP TABLE, or git force-push, with the option to override the warning if the action is intentional.
  • Directory-scoped edit restrictions: Lets you lock all file edits to a specific safe directory, automatically blocking any attempts to modify files outside that defined path.
  • Use Case: Ideal for debugging live production services, making changes to critical infrastructure code, or working on sensitive projects where you need to avoid accidental modifications to unrelated files.

Quick Start

Ask the AI to activate guard mode and provide the path to the directory you want to restrict all edits to, and it will immediately enable both destructive command warnings and edit boundary enforcement.

Frequently Asked Questions about guard

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

FAQPage Schema
How do I prevent accidental execution of destructive commands like rm -rf or DROP TABLE?

To prevent destructive command execution, you can enable guard mode to intercept high-risk commands like rm -rf or DROP TABLE. It issues a warning before execution, allowing you to override the block only if the action is intentional.

How can I lock file edits to a specific directory scope?

You can lock file edits to a specific directory scope by activating directory-scoped edit restrictions. This enforces boundaries by automatically blocking any attempts to modify files outside your defined safe path.

What is the best way to protect production systems during live debugging?

The best way to protect production systems during live debugging is to enable integrated safety mode. This simultaneously warns you before executing destructive commands and locks edit boundaries to prevent out-of-scope file modifications.

Can I override the warning if a flagged destructive command is intentional?

Yes, you can override the warning when a destructive command is intentional. The safety mode alerts you before execution and provides an option to proceed, ensuring accidental data loss is prevented without blocking valid actions.

Does guard mode require any external dependencies to enforce edit restrictions?

No, guard mode does not require external dependencies to enforce edit restrictions. It uses integrated pre-tool hook scripts to validate directory scope and detect destructive commands natively within your workflow.