gateguard

gateguard is a skill for Claude Code from unrealandychan/clean-code-skill. It costs 58 tokens per session (2,032 once invoked), scanned C, original, MIT.

A pre-action check that blocks file edits, new files, and shell commands until the agent investigates the codebase and gathers specific facts.

In plain words
What is it for?
Use it before changing code in interconnected projects, working with structured data, or reviewing changes made by an AI agent. It can require checks such as finding importers, reading schemas, and following user instructions.
Why use it?
It reduces guesses that can break related modules, violate existing data formats, or ignore the project's established patterns.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event.

Good fit Use it before changing code in interconnected projects, working with structured data, or reviewing changes made by an AI agent. It can require checks such as finding importers, reading schemas, and following user instructions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/unrealandychan/clean-code-skill/gateguard
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 unrealandychan/clean-code-skill --skill gateguard
Clone the repo
git clone --depth 1 https://github.com/unrealandychan/clean-code-skill

Made for: Claude Code.

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 gateguard

README.md
[![agentmods](https://agentmods.dev/badge/skills/unrealandychan/clean-code-skill/gateguard/github.svg)](https://agentmods.dev/skills/unrealandychan/clean-code-skill/gateguard)
Your own site
<a href="https://agentmods.dev/skills/unrealandychan/clean-code-skill/gateguard"><img src="https://agentmods.dev/badge/skills/unrealandychan/clean-code-skill/gateguard/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 gateguard

Your own site · 80×15
<a href="https://agentmods.dev/skills/unrealandychan/clean-code-skill/gateguard"><img src="https://agentmods.dev/badge/skills/unrealandychan/clean-code-skill/gateguard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,032 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00058 $0.02032
Opus 5.5 $0.00023 $0.00813
Sonnet 5.5 $0.00012 $0.00406
Haiku 4.5 $0.00006 $0.00203

Measured 1mo ago against content hash 68fa6e19ead9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

gateguard 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 1mo 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.

Triggers on: `rm -rf`, `git reset --hard`, `git push --force`, `drop table`, etc.
skills/ecc/gateguard/SKILL.md · 187 lines

How it starts

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

GateGuard — Fact-Forcing Pre-Action Gate

A PreToolUse hook that forces Claude to investigate before editing. Instead of self-evaluation ("are you sure?"), it demands concrete facts. The act of investigation creates awareness that self-evaluation never did.

When to Activate

  • Working on any codebase where file edits affect multiple modules
  • Projects with data files that have specific schemas or date formats
  • Teams where AI-generated code must match existing patterns
  • Any workflow where Claude tends to guess instead of investigating

Core Concept

LLM self-evaluation doesn't work. Ask "did you violate any policies?" and the answer is always "no." This is verified experimentally.

But asking "list every file that imports this module" forces the LLM to run Grep and Read. The investigation itself creates context that changes the output.

Three-stage gate:

1. DENY  — block the first Edit/Write/Bash attempt
2. FORCE — tell the model exactly which facts to gather
3. ALLOW — permit retry after facts are presented

No competitor does all three. Most stop at deny.

Evidence

Two independent A/B tests, identical agents, same task:

Task Gated Ungated Gap
Analytics module 8.0/10 6.5/10 +1.5
Webhook validator 10.0/10 7.0/10 +3.0
Average 9.0 6.75 +2.25

Both agents produce code that runs and passes tests. The difference is design depth.

Gate Types

Edit / MultiEdit Gate (first edit per file)

MultiEdit is handled identically — each file in the batch is gated individually.

Before editing {file_path}, present these facts:

1. List ALL files that import/require this file (search the tree — Glob/Grep, or find/grep via Bash)
2. List the public functions/classes affected by this change
3. If this file reads/writes data files, show field names, structure,
   and date format (use redacted or synthetic values, not raw production data)
4. Quote the user's current instruction verbatim

Read the full file on GitHub · 187 lines

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. 1mo ago First seen · 187 lines · 58 tokens per session scan C 68fa6e19ead9

Subscribe to this mod's changes

gateguard is a skill published in the GitHub repository unrealandychan/clean-code-skill (12 stars, last pushed 1mo ago), licensed MIT. It adds 58 tokens to every session and 2,032 once invoked, about $0.0002 per session on Opus 5.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-09-09.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

deck-retro

Run a fully local agent-deck retrospective over the user's own transcripts, Recall index and logs. Use when a user wants to find recurring failures or take their own finding from investigation through synthetic reproduction, a user-filed issue, a test-first fix and contributor PR handoff. Also use for weekly usage…

asheshgoplani/agent-deck · 86 tokens