How this command is triggered — by the user, by Claude, or both
Slash command
/commands-extra:guardThe summary Claude sees in its command listing — used to decide when to auto-load this command
# /guard - Compose Careful + Freeze `guard` combines the two safety hooks shipped by the `hooks` module: - **check-careful.py** (PreToolUse:Bash) - prompts on destructive commands (`rm -rf`, SQL DROP/TRUNCATE, force push, hard reset, etc.). - **check-freeze.py** (PreToolUse:Edit|Write) - denies writes outside the frozen directory. `/guard` activates both for a named scope. Use it during investigation or refactors where you want to stay inside one module and avoid destructive surprises. ## Usage ## Workflow 1. Resolve the argument to an absolute path (same rules as `/freeze`). 2....
guard combines the two safety hooks shipped by the hooks module:
rm -rf, SQL DROP/TRUNCATE, force push, hard reset, etc.)./guard activates both for a named scope. Use it during investigation or
refactors where you want to stay inside one module and avoid destructive
surprises.
/guard # Guard the current working directory
/guard <absolute-or-relative-path>
/freeze).~/.claude/freeze-dir.txt.~/.claude/hooks/check-careful.py and
~/.claude/hooks/check-freeze.py exist). If either is missing, warn the
user and point to the hooks module README.Guarded: <path>. Edit/Write scoped; destructive Bash commands will prompt./unfreeze clears the freeze half. The careful hook
stays active (it has no state file to clear; it runs on every Bash call).Slash commands that encourage focused scope (for example /investigate when
adopted) should call /guard <target-dir> at the start of the session so the
user does not have to remember.
check-careful.py has no enable/disable state - it inspects every Bash
command. The only way to quiet it is to not call destructive commands.check-freeze.py is gated by the state file, so /unfreeze fully clears
the scope lock.npx claudepluginhub lucasmccomb/ccgm --plugin commands-extra/guardActivates guard mode: enables warnings for destructive commands (rm -rf, git push --force) and restricts edits to the specified directory. Without arg, activates only warnings.
/guardActivates combined careful and freeze modes: blocks destructive commands and restricts edits to the specified glob pattern. Use 'off' to disable both.
/guardActivates safety guardrails that block destructive Bash commands (rm -rf), SQL drops (DROP TABLE), git force-pushes, and optionally restrict file edits to a directory. Explains each block.
/guardChecks current changes against the latest approved implementation contract, reporting scope drift, unchanged planned files, needed acceptance tests, and smallest safe next step.
/guardActivates careful mode (destructive operation warnings) and freeze mode (directory lock) simultaneously for maximum safety, restricting edits to the specified directory.
/guardActivates safety mode: warns on destructive commands, locks file scope to path or disables with 'off'. Argument: [scope|off]