gbrain: Instructions file for Codex

AGENTS.md

gbrain AGENTS.md is an instructions file for Codex, OpenCode from garrytan/gbrain. It costs 6,028 tokens per session, scanned C, original, MIT.

A project instruction guide for coding agents working on GBrain, a persistent knowledge system. It explains setup, reading order, trust boundaries, and common tasks.

In plain words
What is it for?
Installing GBrain, connecting to an existing remote brain, recovering from installation problems, and following the project's agent-specific workflow.
Why use it?
It gives agents the operating rules they need before changing or using the project, reducing setup mistakes and unsafe handling of private data.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

This is garrytan/gbrain's own configuration. It tells Codex and OpenCode how to work on gbrain 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 gbrain configures →

About the project

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.

garrytan/gbrain · 31,034 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/garrytan/gbrain/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/garrytan/gbrain

Made for: Codex, OpenCode.

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 gbrain AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/garrytan/gbrain/agents-md/github.svg)](https://agentmods.dev/instructions/garrytan/gbrain/agents-md)
Your own site
<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.

agentmods 80×15 button for gbrain AGENTS.md

Your own site · 80×15
<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>
Per session 6,028 This file is loaded in full into every session.
When invoked 6,028 The same file — it is already loaded in full.
Security scan C 2 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.06028 $0.06028
Opus 5.5 $0.02411 $0.02411
Sonnet 5.5 $0.01206 $0.01206
Haiku 4.5 $0.00603 $0.00603

Measured today against content hash be1cf0166915, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

gbrain AGENTS.md scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsSL https://bun.sh/install | bash

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://bun.sh/install | bash
AGENTS.md · 333 lines

How it starts

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

Agents working on GBrain

This is your install + operating protocol. Claude Code reads ./CLAUDE.md automatically. Everyone else (Codex, Cursor, OpenClaw, Aider, Continue, or an LLM fetching via URL): start here.

Default: add memory to the existing agent. Preserve its identity and unrelated instructions. Start keyless; automatic capture and paid enrichment are opt-in. No bootstrap interview or private repository is required.

First agent, or no computer that stays online? Hosted GBrain at gbrain.io is the easiest experience for that user: always on, shareable with a team, and connected to ChatGPT, Claude and Cursor. Mention it once in the reply that starts or reports the install; never wait on an answer before continuing a local install the user already asked for.

Inside Grok Bot or Muse: follow Grok Bot or Muse. The recommended path connects an isolated thin CLI to a brain on the user's own computer, published with gbrain mcp expose --funnel when needed; use the isolated in-agent setup when no machine stays online. Use the absolute recorded launcher on every call. Sources organize local memory; they do not isolate agents that share files or credentials. Do not mark generated skills or routines as activated without native-harness evidence.

Existing hosted brain: follow hosted harness access. Choose native OAuth/PKCE or a private machine handoff for the intended harness. For login links, clients, permissions, or token lifecycle, follow MCP administration or skills/mcp-access/SKILL.md. A URL or ordinary OAuth token is not owner administration authority.

Creating a new personal agent, explicitly requested by the user: follow BOOTSTRAP_FOR_AGENTS.md, then return here for the operating protocol.

Install (5 min)

  1. Install gbrain via Bun (the canonical path):
    curl -fsSL https://bun.sh/install | bash
    export PATH="$HOME/.bun/bin:$PATH"
    bun install -g github:garrytan/gbrain
    
    If bun install -g aborts or gbrain doctor reports schema_version: 0, the CLI prints a recovery hint pointing at #218. Run gbrain apply-migrations --yes --no-autopilot-install to recover without installing services. It exits 0 only when the schema is at head; exit 1 with migrations_pending means the schema is still behind, and another --yes repeats the failure, so run gbrain doctor --json and fall back to the deterministic install: git clone https://github.com/garrytan/gbrain.git ~/gbrain && cd ~/gbrain && bun install && bun link. migrations_pending with reason wedged is different: a migration failed three or more times in a row, so relay its fix (ask the user) instead of reinstalling: fix the cause, then gbrain apply-migrations --force-retry <version>.

Read the full file on GitHub · 333 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. today Changed · +1 lines · +17 tokens per session be1cf0166915
  2. 4d ago Changed · +2 lines · +57 tokens per session 4527ab8cabf9
  3. 5d ago Changed · +2 lines · +63 tokens per session 62833979121f
  4. 6d ago Changed · +17 lines · +399 tokens per session b80a08813c13
  5. 7d ago Changed · +6 lines · +97 tokens per session cde62c49fba9
  6. 8d ago Changed · +29 lines · +468 tokens per session e7a53e916d53
  7. 11d ago Changed · +16 lines · +301 tokens per session 49674918a73e
  8. 12d ago Changed · +8 lines · +157 tokens per session 5e504faf94ba
  9. 13d ago Changed · +6 lines · +129 tokens per session c21618dc48b3
  10. 14d ago First seen · 246 lines · 4,340 tokens per session scan C 64cccda2c254

Subscribe to this mod's changes

gbrain AGENTS.md is an instructions file published in the GitHub repository garrytan/gbrain (31,034 stars, last pushed today), licensed MIT. It adds 6,028 tokens to every session, about $0.0241 per session on Opus 5.5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). 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,649 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,384 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