gateguard

gateguard is a skill for Claude Code from naimkatiman/continuous-improvement. It costs 79 tokens per session (3,860 once invoked), scanned D, original, MIT.

A safety gate that makes a coding agent investigate the project before it can edit files or run destructive commands. It checks for concrete facts such as existing code patterns, data formats and user instructions.

In plain words
What is it for?
Use it before modifying code, schemas or data files when you want the agent to inspect the relevant project details first.
Why use it?
It reduces changes based on guesses, especially when edits affect several parts of a codebase or files follow strict formats.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the continuous-improvement plugin — 27 skills, 6 hooks shipped together

Good fit Use it before modifying code, schemas or data files when you want the agent to inspect the relevant project details first.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add naimkatiman/continuous-improvement
Claude Code
/plugin install continuous-improvement

Made for: Claude Code.

Or install continuous-improvement, the plugin that ships this one along with the rest of its 27 skills, 6 hooks.

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/naimkatiman/continuous-improvement/gateguard/github.svg)](https://agentmods.dev/skills/naimkatiman/continuous-improvement/gateguard)
Your own site
<a href="https://agentmods.dev/skills/naimkatiman/continuous-improvement/gateguard"><img src="https://agentmods.dev/badge/skills/naimkatiman/continuous-improvement/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/naimkatiman/continuous-improvement/gateguard"><img src="https://agentmods.dev/badge/skills/naimkatiman/continuous-improvement/gateguard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,860 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. 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.00079 $0.03860
Opus 5 $0.00039 $0.01930
Sonnet 5 $0.00016 $0.00772
Haiku 4.5 $0.00008 $0.00386

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

Security

Grade D, and why

gateguard scanned grade D with 3 findings 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

| Careful — warn on `rm -rf`, `git push --force`, `git reset --hard`, `DROP TABLE`, `chmod 777`, `--no-verify` … | [Destructive Bash Gate](#destructive-bash-gate-every-destructive-command). Its pattern set is a superset

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Set the `CI_GATEGUARD_EXCLUDE` environment variable to opt specific low-risk paths out of the gate entirely — an LLM-maintained prose wiki, a generated scratch directory, anything where the fact-forcing pause costs more

Recursive force deletehighDestructive command

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

Triggers on structured rules that ignore flag order and spelling — `rm` with any recursive plus any force flag (`rm -r -f`, `rm -Rf`, `rm --recursive --force`), `git clean` with a force flag and no dry run, `git checkout
plugins/continuous-improvement/skills/gateguard/SKILL.md · 208 lines

How it starts

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

GateGuard — Fact-Forcing Pre-Action Gate

A runtime PreToolUse hook + skill pair that forces the agent 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.

Implementation status: GateGuard ships as a runtime PreToolUse hook at hooks/gateguard.mjs, wired as the first PreToolUse entry in the plugin bundle. The hook physically blocks Edit / Write / MultiEdit and every destructive Bash on stdin/stdout JSON, returning {decision: "block", reason: "..."} until the agent presents facts and retries with the per-session clearance signal. This skill file is the human-readable spec the hook implements. Originally tracked in issue #106 (closed; landed as PR #108).

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 the agent 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.

Read the full file on GitHub · 208 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. 3d ago Changed · +15 lines 8d75b7249b8f
  2. 9d ago First seen · 193 lines · 79 tokens per session scan D d1163bcdc854

Subscribe to this mod's changes

gateguard is a skill published in the GitHub repository naimkatiman/continuous-improvement (7 stars, last pushed 3d ago), licensed MIT. It adds 79 tokens to every session and 3,860 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

opensrc

Fetch dependency source code to give AI agents deeper implementation context. Use when the agent needs to understand how a library works internally, read source code for a package, fetch implementation details for a dependency, or explore how an npm/PyPI/crates.io package is built. Triggers include "fetch source for"…

vercel-labs/opensrc · 103 tokens

nopus-configure

Configure nopus complexity sensitivity, extra-simple rewrites, rewrite evidence, and Pi response hiding for this user.

Vistyy/nopus · 27 tokens

nopus-simplify

Rewrite the immediately preceding assistant response with clearer and more direct prose when the user invokes this skill.

Vistyy/nopus · 25 tokens

agentpush

Bridge an imported agentpush MCP server (Telegram, WhatsApp, etc.) with live agentproto sessions via the daemon's transmitter subsystem: transmitmessage sends outbound and binds the recipient to a session, inboundwatcherstart polls agentpush for new messages, and inboundendpointcreate/POST /inbound(/:slug) route…

agentproto/ts · 119 tokens

bureau

Drive Bureau — the browser stack's installable capability server: a stealth Firefox (Camofox) + daemon that exposes browser tools as MCP-over-HTTP on :8830, plus a CLI for saved browser identities (sessions), social capture / search, adapter health probes, declarative workflows, and Guilde connection. Use when working…

agentproto/ts · 131 tokens

agentproto-apps

Operate and build Agentproto apps — AIP-42 app bundles (defineApp().emit(dir), APP.md + agents/ + workflows/ + ui/) and their daemon lifecycle (appinstall, appapply, apprun, appstatus, appstop) plus the app-scoped durable data plane (appdataread/write/list/migrate). Covers serving one with a UI (agentproto app serve →…

agentproto/ts · 178 tokens