gate CLAUDE.md

gate CLAUDE.md is an instructions file for coding agents from GaaraZhu/gate. It costs 1,400 tokens per session, scanned B, original, MIT.

A repository guide for Gate, a command-line tool that removes personally identifying information before data reaches an AI model or passes through an MCP connection. It also lists the project's build and test checks.

In plain words
What is it for?
Use it when working on Gate's SQL filtering, output redaction, MCP proxy, Rust crates, builds, tests, formatting, or linting.
Why use it?
It helps agents preserve the project's privacy protections and verify changes before committing them.

Instructions file

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 instructions/gaarazhu/gate/claude-md
Clone the repo
git clone --depth 1 https://github.com/GaaraZhu/gate

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 gate CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/gaarazhu/gate/claude-md.svg)](https://agentmods.dev/instructions/gaarazhu/gate/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/gaarazhu/gate/claude-md"><img src="https://agentmods.dev/badge/instructions/gaarazhu/gate/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,400 This file is loaded in full into every session.
When invoked 1,400 The same file — it is already loaded in full.
Security scan B 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 $0.01400 $0.01400
Opus 5 $0.00700 $0.00700
Sonnet 5 $0.00280 $0.00280
Haiku 4.5 $0.00140 $0.00140

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

Security

Grade B, and why

gate CLAUDE.md 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 5d 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.

Reads agent configuration directoriesmediumAgent snooping

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

- **`init.rs` writes must be atomic.** Write to a tempfile, then rename. Never write directly to `~/.claude/settings.json`.
CLAUDE.md · 107 lines

How it starts

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

gate

PII-filtering CLI that transparently intercepts AI agent query commands and redacts sensitive data before it reaches the model context.

Notes

crates/gate/src/run.rs is the production Gate 1 + Gate 2 pipeline. Loads config, runs gate1::extract_columns + gate1::build_plan on the SQL arg, spawns the subprocess, pipes stdout through common::redactor::redact. All subcommands fully implemented.

crates/mcp/ is a separate crate that provides the gate mcp subcommand — a stdio JSON-RPC proxy that forwards traffic between the AI harness and an upstream MCP server. It intercepts tools/call responses and redacts PII via Gate 2 before returning them.

Repository structure

gate/
  Cargo.toml            # workspace root
  crates/
    common/             # config, PII patterns, redactor (Gate 2), error types, harness detection
    gate1/              # SQL tokenizer + column extractor (Gate 1)
    gate/               # main binary (all subcommands)
    mcp/                # stdio MCP proxy: intercepts tools/call responses and redacts PII

Build and test commands

cargo build
cargo test --all
cargo clippy -- -D warnings
cargo fmt --check

Before every commit

Run all checks from the workspace root and fix any failures:

cargo fmt --all
cargo clippy -- -D warnings
cargo test --all

Never commit if any of these fail.

Dependencies (pin these in workspace Cargo.toml)

clap = { version = "4", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
serde_yaml = "0.9"
regex = "1"
shell-words = "1"
anyhow = "1"
thiserror = "1"
tempfile = "3"
criterion = { version = "0.5", features = ["html_reports"] }
ctrlc = { version = "3", features = ["termination"] }

Gate 1 uses a hand-written SQL tokenizer — do NOT add sqlparser-rs.

Safety checklist (required for any redaction changes)

When modifying redaction logic (common/redactor.rs, gate1/lib.rs, mcp/intercept.rs), run this checklist before committing:

Read the full file on GitHub · 107 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. 5d ago First seen · 107 lines · 1,400 tokens per session scan B 0c23a4b16477

Subscribe to this mod's changes

gate CLAUDE.md is an instructions file published in the GitHub repository GaaraZhu/gate (216 stars, last pushed 15d ago), licensed MIT. It adds 1,400 tokens to every session, about $0.0070 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.