gate4agent: Instructions file for Claude Code

CLAUDE.md

gate4agent CLAUDE.md is an instructions file for Claude Code from ZENG3LD/gate4agent. It costs 1,471 tokens per session, scanned A, original, MIT.

A repository-specific instruction file for gate4agent, a local system that runs coding agents through processes, workspaces, and a relay service. It documents its components, local endpoints, credentials, and build rules.

In plain words
What is it for?
Use it when modifying gate4agent, running its Windows end-to-end tests, building its terminal interface, or working with its local node, relay, and harness services.
Why use it?
It gives an agent the project details needed to work safely with the right processes, connections, secrets, and test commands. Without it, the agent may use the wrong interface or violate repository rules.

Instructions file for Claude Code

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

This is ZENG3LD/gate4agent's own configuration. It tells Claude Code how to work on gate4agent 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 gate4agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ZENG3LD/gate4agent. 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/ZENG3LD/gate4agent/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ZENG3LD/gate4agent

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/zeng3ld/gate4agent/claude-md/github.svg)](https://agentmods.dev/instructions/zeng3ld/gate4agent/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/zeng3ld/gate4agent/claude-md"><img src="https://agentmods.dev/badge/instructions/zeng3ld/gate4agent/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 gate4agent CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/zeng3ld/gate4agent/claude-md"><img src="https://agentmods.dev/badge/instructions/zeng3ld/gate4agent/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,471 This file is loaded in full into every session.
When invoked 1,471 The same file — it is already loaded in full.
Security scan A 0 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.01471 $0.01471
Opus 5.5 $0.00588 $0.00588
Sonnet 5.5 $0.00294 $0.00294
Haiku 4.5 $0.00147 $0.00147

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

Security

Grade A, and why

gate4agent CLAUDE.md scanned grade A with 0 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 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 114 lines

How it starts

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

gate4agent — everything about providers: library, node, C2

gate4agent owns everything about CLI coding-agent providers (Claude Code, Codex, Kimi, Grok): the library that spawns, streams, resumes, and owns their subprocesses over PTY, pipe, ACP, and daemon transports behind one API; the node process that wraps providers for one machine and serves them over a wire; and the C2 that reaches the nodes on remote machines. The harness, TUI, observation, and task/mail stack lives in hatchery, a sibling repository that links these crates by path and talks to the node only through its wire (gate4agent-node-protocol) and the C2's (gate4agent-c2-protocol). Plans/handoffs/audits live in the owner's private workspace documentation tree, not in this repository.

Two generations

  • Transport core — the root gate4agent crate (src/) plus gate4agent-pty (the in-house PTY backend). Spawns and owns the vendor CLI subprocess directly: structured inline (JSONL), PTY (ConPTY / unix pty), plus the ACP and daemon compatibility surfaces. This is the original generation and the one every downstream crate ultimately calls into.
  • Session runtime substrate — gate4agent-catalog → gate4agent-kernel → gate4agent-runtime-native → gate4agent-shell-native, plus gate4agent-types, gate4agent-adapters, gate4agent-engine, gate4agent-handle, gate4agent-tool-protocol, gate4agent-tool-engine, gate4agent-provider-ports, gate4agent-shell-history, gate4agent-shell-capabilities, gate4agent-shell-hooks, gate4agent-shell-managed-hooks, gate4agent-shell-one-shot. This is the second generation: the managed-session substrate a node embeds (catalog lookup → kernel session lifecycle → native runtime execution → native shell integration), and it calls DOWN into the transport core for the actual subprocess. It does not replace the transport core; it wraps it.

Node and C2

  • gate4agent-node (binary gate4agent-node) — the node server: wraps providers, owns PTY/inline/ACP sessions, the file browser, local git, and worktrees for its machine. gate4agent-node-protocol is its bounded wire contract, gate4agent-node-wire the transport/auth/client.
  • gate4agent-c2 (binary gate4agent-c2) — the relay that aggregates node state and routes commands down; gate4agent-c2-protocol and gate4agent-c2-client (CLI gate4agent-c2ctl) are its contract and client.
  • gate4agent-build-stamp — the content hash of THIS repository's working tree that every node/C2 handshake carries; peers built from different trees refuse each other.
  • The node names no harness. What a session's harness-MCP door is called — server name, argv, the environment variables that carry its endpoint and token — arrives from the caller in HarnessMcpLaunchV1 on the reservation.
  • The node derives no observation/telemetry vocabulary. It publishes NodeEvent::Control and the agent stream; the C2 relays a sanitized telemetry view of control events (C2ControlEvent::detail, capability control-detail-v1) to a client that negotiated it, and the client builds its own telemetry from that.

Read the full file on GitHub · 114 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 Changed · -55 lines · -963 tokens per session 9c0966143da7
  2. 1mo ago Changed · +148 lines · +2,121 tokens per session 25f9e804c5c0
  3. 2mo ago First seen · 21 lines · 313 tokens per session scan A 8a9b9167e096

Subscribe to this mod's changes

gate4agent CLAUDE.md is an instructions file published in the GitHub repository ZENG3LD/gate4agent (9 stars, last pushed 15d ago), licensed MIT. It adds 1,471 tokens to every session, about $0.0059 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

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,719 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,461 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,334 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,792 tokens

generative-ai-for-beginners AGENTS.md

AGENTS.md instructions for microsoft/generative-ai-for-beginners, covering agents.md, project overview, setup commands, initial repository setup and clone the repository.

microsoft/generative-ai-for-beginners · 2,850 tokens