guard

Restrict file edits to a directory and warn on destructive commands.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guard mode provides simultaneous destructive command warnings and directory-scoped edit restrictions to prevent accidental or malicious changes in prod or live environments.

Core Features & Use Cases

  • Combines destructive command warnings with directory-based edit blocking for safe production work.
  • Lets you set a freeze boundary to block edits outside a chosen path.
  • Use case: you are debugging a live service and want to prevent accidental rm -rf or force-push.

Quick Start

Provide a directory path to restrict edits to, then enable guard mode to activate destructive-command warnings and edit boundaries.

Frequently Asked Questions about guard

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

FAQPage Schema
How do I prevent accidental destructive commands like rm -rf when debugging a live system?

Preventing destructive commands during live system debugging requires enabling guard mode, which activates simultaneous destructive command warnings and directory-scoped edit restrictions to block accidental or malicious changes in production environments.

Can I restrict file edits to a specific directory during production maintenance?

Yes, restricting file edits to a specific directory during production maintenance is achieved by setting a freeze boundary. Guard mode stores this boundary to a state file and blocks any edits attempted outside the chosen path.

What is directory-based edit blocking and when do I need it for production work?

Directory-based edit blocking is a safety mechanism that confines file modifications to a chosen path. You need it for production work to prevent accidental or malicious changes from propagating outside the designated maintenance directory.

How do I set up a freeze boundary to block edits outside a chosen path?

To set up a freeze boundary, provide a directory path to restrict edits to, then enable guard mode. The system uses hooks to call sibling scripts and stores the freeze boundary to a state file, enforcing the edit restriction.

Does guard mode work without any external dependencies or components?

Yes, guard mode operates without external dependencies or components. It relies internally on hooks that call sibling careful and freeze scripts to manage destructive command warnings and edit boundary enforcement.

What are the limitations of relying on directory-scoped edit restrictions for live environments?

Directory-scoped edit restrictions limit modifications to a specific path but do not inherently prevent destructive commands from executing if they target the allowed boundary. Guard mode addresses this by combining edit blocking with destructive command warnings.