guard

guard is a skill for Claude Code, Codex from garagon/nanostack. It costs 65 tokens per session (1,938 once invoked), scanned C, original, Apache-2.0.

A safety control for coding-agent work that adds warnings or restrictions around production systems, sensitive data, and destructive commands.

In plain words
What is it for?
It is for enabling careful, frozen, or unrestricted operating modes when working near production systems or performing potentially destructive tasks.
Why use it?
It reduces the risk of accidentally deleting data, changing the wrong system, or running a dangerous command.

Skill for Claude CodeCodex

Written for Claude Code and Codex: hooks in frontmatter, but also agents/openai.yaml present. Also seen: names the AskUserQuestion tool; positional $N argument.

Part of the nanostack plugin — 18 skills, 1 command shipped together

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/garagon/nanostack/guard
Any agent
npx skills add garagon/nanostack --skill guard
Clone the repo
git clone --depth 1 https://github.com/garagon/nanostack

Made for: Claude Code, Codex.

Or install nanostack, the plugin that ships this one along with the rest of its 18 skills, 1 command.

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/garagon/nanostack/guard.svg)](https://agentmods.dev/skills/garagon/nanostack/guard)
Your own site
<a href="https://agentmods.dev/skills/garagon/nanostack/guard"><img src="https://agentmods.dev/badge/skills/garagon/nanostack/guard.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,938 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found 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.1 $0.00065 $0.01938
Opus 5 $0.00032 $0.00969
Sonnet 5 $0.00013 $0.00388
Haiku 4.5 $0.00006 $0.00194

Measured 6d ago against content hash 6b7c12b4f622, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 6d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (bin/budget-gate.sh, bin/check-dangerous.sh, bin/check-write.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

- `rm -rf`, `rm -r` on directories
guard/SKILL.md · 160 lines

How it starts

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

/guard — Safety Guardrails

You have activated safety guardrails. These protect against accidental destructive operations during this session.

Telemetry preamble

Defensive telemetry init. No-op if telemetry is disabled via NANOSTACK_NO_TELEMETRY=1, ~/.nanostack/.telemetry-disabled, or if the helpers are removed.

_P="$HOME/.claude/skills/nanostack/bin/lib/skill-preamble.sh"
[ -f "$_P" ] && . "$_P" guard
unset _P

Modes

The user may activate a specific mode. If no mode is specified, default to careful.

Careful Mode (default)

What it does: Warns before any potentially destructive operation but does not block.

When you detect a destructive operation, pause and present:

⚠️  GUARD: Potentially destructive operation detected
Operation: {{what you're about to do}}
Impact: {{what could go wrong}}
Reversible: {{yes/no — if yes, how}}

Proceed? [y/n]

Use AskUserQuestion to get explicit confirmation before proceeding.

Destructive operations include:

  • rm -rf, rm -r on directories
  • git reset --hard, git push --force, git branch -D
  • DROP TABLE, DELETE FROM without WHERE, TRUNCATE
  • kubectl delete, docker rm, docker system prune
  • Writing to production configs or .env files
  • Modifying CI/CD pipeline files
  • Any operation the guard/bin/check-dangerous.sh script flags

Freeze Mode

What it does: Asks the agent to keep its file writes (Edit, Write) within a chosen scope for the rest of the session. This is a guided instruction the agent follows, not a hook-enforced block: unlike the secret and system-path denylist in check-write.sh, the Write/Edit hook does not currently reject an out-of-scope write. Treat freeze as agent-level discipline, not a wall.

When the user says /freeze or /guard freeze:

  1. Ask which directories/files are in scope (or accept them as arguments)
  2. Store the scope in guard/config.json
  3. For the remainder of the session, keep Edit and Write operations within the frozen scope and decline anything outside it

Read the full file on GitHub · 160 lines

Files

What ships with it

6 files 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. 6d ago First seen · 160 lines · 65 tokens per session scan C 6b7c12b4f622

Subscribe to this mod's changes

guard is a skill published in the GitHub repository garagon/nanostack (204 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 65 tokens to every session and 1,938 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

rulesync

Generates and syncs AI rule configuration files (.cursorrules, CLAUDE.md, copilot-instructions.md) across 20+ coding tools from a single source. Use when syncing AI rules, running rulesync commands, importing or generating rule files, or managing shared AI coding configurations.

dyoshikawa/rulesync · 64 tokens

establishing-project-context

Use when the user asks to establish shared project language, or project work exposes a conflicting, renamed, or deprecated domain term that needs active semantic modeling. Routine small tasks stay on the fast path.

GanyuanRan/Aegis · 45 tokens

autoprompt

Explicit-only useful-first orchestration. Invoke /autoprompt to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Never infer invocation from ordinary requests. Never resume from leftover artifacts without an explicit resume instruction.

Spielewoy/autoprompt-skill · 56 tokens

gitnexus

将 GitNexus 作为受控可选代码智能能力接入,用于 brownfield MCP 查询、影响面分析、 detectchanges、多仓分析和更深代码图谱证据。输出必须回落到 /team- 主链和 artifacts。.

hashgraph-online/awesome-codex-plugins · 58 tokens

loop

Full execution protocol for MODE: LOOP — the compound-engineering loop: brainstorm → plan → build → review → improve, iterating under defense-in-depth stop conditions with generator/critic separation, durable resumable state, and mandatory compounding learning capture. Loaded on demand by the architect when the loop…

ZaxbyHub/opencode-swarm · 72 tokens

restore-internals-seams-in-finally-blocks-after-each-test

When delegating a task affected by this skill, include.

ZaxbyHub/opencode-swarm · 26 tokens