guard

guard is a skill for Claude Code, Codex from rijuvashisht/Magneto. It costs 0 tokens per session (433 once invoked), scanned B, original, MIT.

A safety control that combines warnings for destructive commands with a limit on which files may be edited. A path glob is a file-matching pattern such as `src/payments/*`.

In plain words
What is it for?
Use it to protect one or more folders while making changes, then remove the edit lock or command warnings separately when appropriate.
Why use it?
It lowers the risk of damaging important files or making changes outside the intended area, especially during production work or critical debugging.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to protect one or more folders while making changes, then remove the edit lock or command warnings separately when appropriate.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rijuvashisht/magneto/guard
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.

Any agent
npx skills add rijuvashisht/Magneto --skill guard
Clone the repo
git clone --depth 1 https://github.com/rijuvashisht/Magneto

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/rijuvashisht/magneto/guard/github.svg)](https://agentmods.dev/skills/rijuvashisht/magneto/guard)
Your own site
<a href="https://agentmods.dev/skills/rijuvashisht/magneto/guard"><img src="https://agentmods.dev/badge/skills/rijuvashisht/magneto/guard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/rijuvashisht/magneto/guard"><img src="https://agentmods.dev/badge/skills/rijuvashisht/magneto/guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 433 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00000 $0.00433
Opus 5 $0.00000 $0.00217
Sonnet 5 $0.00000 $0.00087
Haiku 4.5 $0.00000 $0.00043

Measured 10d ago against content hash d873753b2c42, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

guard scanned grade B 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 10d 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 deletemediumDestructive command

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

User: Great, now rm -rf the old payment logs directory

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

src/templates/magneto-skills/skills/guard/SKILL.md · 67 lines

What it actually says

/guard — /careful + /freeze Combined

Role: Full Safety Inputs: one or more path globs Outputs: updates .magneto/safety.json (activates both careful + freeze) Audit actions: guard.activated


What /guard Does

Activates both /careful (destructive-command warnings) AND /freeze (edit scope lock) in one command. Use this for:

  • Production work
  • Debugging critical systems
  • Any time the cost of a mistake > the cost of friction

Activation

magneto guard src/payments          # full safety, scoped to src/payments
magneto guard src/payments src/api  # both /careful and /freeze on multiple globs

To release:

magneto unfreeze       # release freeze only, keep careful on
magneto careful --off  # release careful only, keep freeze on

Integration Contract

Honor both contracts:

  1. /careful — warn before destructive commands (see /careful skill)
  2. /freeze — refuse edits outside scope (see /freeze skill)

Example

User: /guard src/payments
Agent: /guard activated.
       /careful: ON
       /freeze: src/payments

User: Fix the bug in Payment.charge() — it double-charges on retry.
Agent: Scope check: src/payments/Payment.ts → allowed ✓
       [makes minimal fix]
       [runs tests]

User: Great, now rm -rf the old payment logs directory
Agent: /careful is ON. `rm -rf /var/log/payments/old` matches:
       ● Recursive file removal — critical

       Proceed anyway? Type "yes run this" to confirm.

Trigger Phrases

  • "guard mode"
  • "max safety"
  • "production mode"

Contract Reminder

Honor both /careful and /freeze contracts simultaneously. When in doubt, ask the user.

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. 10d ago First seen · 67 lines · 0 tokens per session scan B d873753b2c42

Subscribe to this mod's changes

guard is a skill published in the GitHub repository rijuvashisht/Magneto (6 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 433 tokens. A static security scan graded it B with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.