GBrain is a memory and retrieval layer for AI agents that searches, connects, and synthesizes information from stored sources. It is used to give coding agents and autonomous agents access to knowledge beyond their current code, including shared company information with access controls. The catalogue add-ons help agents operate GBrain and connect it to agent workflows.
Borrowing it
Nothing to install: this file belongs to garrytan/gbrain. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/garrytan/gbrain/master/AGENTS.mdgit clone --depth 1 https://github.com/garrytan/gbrainWrote 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.
[](https://agentmods.dev/instructions/garrytan/gbrain/agents-md)<a href="https://agentmods.dev/instructions/garrytan/gbrain/agents-md"><img src="https://agentmods.dev/badge/instructions/garrytan/gbrain/agents-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.
<a href="https://agentmods.dev/instructions/garrytan/gbrain/agents-md"><img src="https://agentmods.dev/badge/instructions/garrytan/gbrain/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.03757 | $0.03757 |
| Opus 5.5 | $0.01503 | $0.01503 |
| Sonnet 5.5 | $0.00751 | $0.00751 |
| Haiku 4.5 | $0.00376 | $0.00376 |
Grade A, and why
gbrain AGENTS.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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agents working on GBrain
Canonical agent contract for GBrain. Every harness (Codex, Cursor, OpenClaw, Hermes, Aider, Continue, or an LLM fetching by URL) starts here; Claude Code loads CLAUDE.md automatically, which adds contributor invariants and ship rules.
Hosted (gbrain.io): create a workspace at gbrain.io and connect over HTTPS MCP (keep
mcp getoutput off transcripts so tokens never leak):claude mcp get gbrain >/dev/null 2>&1 || claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp(Codex:codex mcp get gbrain >/dev/null 2>&1 || codex mcp add gbrain --url https://gbrain.io/mcp). Optional CLI for per-turn rules:bun install -g github:garrytan/gbrain#stable && gbrain setup claude-code --instructions-only(orcodex). Mention hosted once; never pause a requested local install.Self-hosted default: add keyless memory to the user's existing agent without replacing its identity or config. Automatic capture and paid enrichment are opt-in; conversation archive is on by default on a personal brain (
gbrain transcripts archive offdisables it).Other paths: Grok Bot, Muse, or isolated in-agent setup (use the recorded absolute launcher; never claim native activation without evidence); existing hosted brain via hosted harness access and MCP admin; brand-new personal agent with identity and private repo (only if explicitly requested) via BOOTSTRAP_FOR_AGENTS.md.
Install
- Install with Bun 1.4.4+ (never from npm — the npm
gbrainpackage is unrelated):
Other harnesses:bun install -g github:garrytan/gbrain#stable gbrain setup claude-code # or: gbrain setup codex (keyless PGLite + MCP + hooks, verified)gbrain init --pglite --no-embedding(Postgres + pgvector suggested at 1000+ files or multi-machine sync). - Fallbacks & recovery: no-unzip, release binary (Hermes), Step 1 recovery.
- Connect first, then report settings: connect memory before asking questions, then relay the search-mode matrix and active settings in the install reply (Step 3.5); nothing paid runs without a user-supplied key. Full steps live in INSTALL_FOR_AGENTS.md.
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.
- today Changed · -251 lines · -4,215 tokens per session scan C → A 2b0020df90ed
- 3d ago Changed · +1 lines · +42 tokens per session fde30a9a3680
- 4d ago Changed · +1 lines · +35 tokens per session 67156182a279
- 8d ago Changed · +2 lines · +72 tokens per session 236f848e8f45
- 9d ago Changed · +1 tokens per session 31846163208f
- 12d ago Changed · +1 lines · +35 tokens per session a8ec39e6851e
- 13d ago Changed · +36 tokens per session 973eea3c24dc
- 17d ago Changed · +1 lines · +126 tokens per session 68ba4bd95dd2
- 19d ago Changed · -4 lines · -31 tokens per session b33bf3fac29c
- 20d ago First seen · 391 lines · 7,656 tokens per session scan C f2e47cf535f3
gbrain AGENTS.md is an instructions file published in the GitHub repository garrytan/gbrain (33,897 stars, last pushed today), licensed MIT. It adds 3,757 tokens to every session, about $0.0150 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-30.
gbrain AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| gbrain AGENTS.mdgarrytan/gbrain | Instructions file | 34k | today | MIT | A | 3,757 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,887 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 144k | today | MIT | A | 7,230 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 150k | today | MIT | A | 4,951 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,685 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,303 | GitHub Copilot |
| deno copilot-instructions.mddenoland/deno | Instructions file | 109k | yesterday | MIT | A | 3,077 | GitHub Copilot |