gate: Instructions file for Claude Code

CLAUDE.md

gate CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions Claude Code; mentions OpenCode.

This is GaaraZhu/gate's own configuration. It tells Claude Code how to work on gate itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything gate configures →

Reuse

Borrowing it

Nothing to install: this file belongs to GaaraZhu/gate. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/GaaraZhu/gate/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/GaaraZhu/gate

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/gaarazhu/gate/claude-md/github.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/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 gate CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/gaarazhu/gate/claude-md"><img src="https://agentmods.dev/badge/instructions/gaarazhu/gate/claude-md.svg" alt="Reviewed on agentmods" width="80" 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. 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.01400 $0.01400
Opus 5.5 $0.00560 $0.00560
Sonnet 5.5 $0.00280 $0.00280
Haiku 4.5 $0.00140 $0.00140

Measured 1mo ago against content hash 0c23a4b16477, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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. 1mo 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 2mo ago), licensed MIT. It adds 1,400 tokens to every session, about $0.0056 per session on Opus 5.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.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,786 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens