guard

guard is a skill for Claude Code, Codex from act-sdk/act-sdk-js. It costs 98 tokens per session (729 once invoked), scanned C, a copy of guard, MIT.

A manually triggered safety mode for software work that warns about destructive commands and restricts edits to an approved directory.

In plain words
What is it for?
Use it when the user types /guard and wants extra protection while editing or debugging. It asks for confirmation when an action may be destructive or its scope is unclear.
Why use it?
It reduces the risk of deleting data, changing production-related files, or modifying files outside the requested scope.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/act-sdk/act-sdk-js/gstack-guard
Any agent
npx skills add act-sdk/act-sdk-js --skill gstack-guard
Clone the repo
git clone --depth 1 https://github.com/act-sdk/act-sdk-js

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/act-sdk/act-sdk-js/gstack-guard.svg)](https://agentmods.dev/skills/act-sdk/act-sdk-js/gstack-guard)
Your own site
<a href="https://agentmods.dev/skills/act-sdk/act-sdk-js/gstack-guard"><img src="https://agentmods.dev/badge/skills/act-sdk/act-sdk-js/gstack-guard.svg" alt="Measured on agentmods" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 729 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin 94% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00098 $0.00729
Opus 5 $0.00049 $0.00365
Sonnet 5 $0.00020 $0.00146
Haiku 4.5 $0.00010 $0.00073

Measured 3d ago against content hash eb49586e05a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

guard scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

Combines /careful (warns before rm -rf, DROP TABLE, force-push, etc.) with
Origin

This is a copy

94% identical to guard — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/gstack-guard/SKILL.md · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Safety Advisory: This skill includes safety checks that check bash commands for destructive operations (rm -rf, DROP TABLE, force-push, git reset --hard, etc.) before execution, and verify file edits are within the allowed scope boundary before applying, and verify file writes are within the allowed scope boundary before applying. When using this skill, always pause and verify before executing potentially destructive operations. If uncertain about a command's safety, ask the user for confirmation before proceeding.

/guard — Full Safety Mode

Activates both destructive command warnings and directory-scoped edit restrictions. This is the combination of /careful + /freeze in a single command.

Dependency note: This skill references hook scripts from the sibling /careful and /freeze skill directories. Both must be installed (they are installed together by the gstack setup script).

mkdir -p ~/.gstack/analytics
echo '{"skill":"guard","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}'  >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true

Setup

Ask the user which directory to restrict edits to. Use AskUserQuestion:

  • Question: "Guard mode: which directory should edits be restricted to? Destructive command warnings are always on. Files outside the chosen path will be blocked from editing."
  • Text input (not multiple choice) — the user types a path.

Once the user provides a directory path:

  1. Resolve it to an absolute path:
FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
echo "$FREEZE_DIR"
  1. Ensure trailing slash and save to the freeze state file:
FREEZE_DIR="${FREEZE_DIR%/}/"
STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.gstack}"
mkdir -p "$STATE_DIR"
echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
echo "Freeze boundary set: $FREEZE_DIR"

Read the full file on GitHub · 64 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 64 lines · 98 tokens per session scan C eb49586e05a2

Subscribe to this mod's changes

guard is a skill published in the GitHub repository act-sdk/act-sdk-js (2 stars, last pushed 3mo ago), licensed MIT. It adds 98 tokens to every session and 729 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). It is 94% identical to guard, differing in 6 lines, and is treated as a copy.

Related

Other skills, from other repositories

memora

Use when working with persistent memory across sessions, storing/retrieving knowledge, managing TODOs/issues, or when context from previous sessions would be helpful.

agentic-box/memora · 33 tokens

tsa-edit-then-verify

The full edit-and-verify loop mandated by CLAUDE.md and docs/agent-tooling-gap-report.md:58. Pre-edit gate (edit action=safe + baseline health action=file) → LLM edits → post-edit verify (health action=file diff + edit action=impact + scoped verificationcommand). Replaces "edit then run the whole pytest suite" (5 min)…

aimasteracc/tree-sitter-analyzer · 267 tokens

tsa-pr-review

AST-grounded PR / diff review. One workflow → per-file risk ranking, blast radius per changed symbol, the exact pytest command to gate merge, any architecture-constraint violations, and a final BLOCK / REVIEW / APPROVE verdict — in 1–2k tokens and 4–6 MCP calls. Goes beyond a generic LLM diff-read because only TSA's…

aimasteracc/tree-sitter-analyzer · 354 tokens

tsa-refactor-queue

Build a top-N prioritized refactoring queue by intersecting three signals: health grade (which files are F/D), temporal churn (which files change most often), and dead-code density (which files carry the most unreachable symbols). For each candidate the queue surfaces (a) the dimension that dragged the grade down, (b)…

aimasteracc/tree-sitter-analyzer · 265 tokens

tsa-temporal

Find "hot zones" — symbols modified often in recent git history that need extra review attention. Adds temporal context (modcount30d / 90d / all) to call-graph queries. Like Hebbian "fire-together-wire-together" but for code: functions that change together often deserve scrutiny together. Use when: User asks "what's…

aimasteracc/tree-sitter-analyzer · 170 tokens

tsa-constraints

Architectural constraint enforcement. Detect forbidden cross-module calls ("MCP must not depend on CLI") at index time and gate edits on them. Rules live in YAML at repo root; violations bubble up through edit action=safe and edit action=impact as UNSAFE verdicts. Use when: User asks "does this PR break architecture?"…

aimasteracc/tree-sitter-analyzer · 161 tokens