brainlayer AGENTS.md

Project instructions for BrainLayer, a memory system for a group of AI agents. It records prompts, decisions, results, and reasons, while linking each memory back to the conversation that produced it.

In plain words
What is it for?
Maintaining agent memory, source links, indexing rules, search visibility, and the records of what worked or failed in previous agent tasks.
Why use it?
They help agents reuse earlier experience without losing where that information came from. They also define how different kinds of agent conversations should be indexed and searched.

Instructions file for CodexOpenCode

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/etanhey/brainlayer/agents-md
Clone the repo
git clone --depth 1 https://github.com/EtanHey/brainlayer

Made for: Codex, OpenCode.

Per session 4,406 This file is loaded in full into every session.
When invoked 4,406 The same file — it is already loaded in full.
Security scan A 0 findings. 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.04406 $0.04406
Opus 5 $0.02203 $0.02203
Sonnet 5 $0.00881 $0.00881
Haiku 4.5 $0.00441 $0.00441

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

Security

Grade A, and why

brainlayer 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 2d 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.

AGENTS.md · 266 lines

How it starts

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

BrainLayer — a letter from Etan

Ratified row-by-row by voice, 2026-08-07. Record: docs.local/GRILL-RATIFIED-2026-08-06.md.

BrainLayer is the fleet's memory — both sides of it. My prompts, intent, and corrections on one side; what you all tried, what worked, what eroded and why on the other — the fleet's accumulated experience, so agents learn from each other's experience instead of re-deriving what the fleet already paid to learn. More than storage: it should give agents the understanding of WHY to go one way and not the other.

Everything traces to its origin. From any memory you can walk back to the conversation it came from. Prefer pointers to the source of truth over hoarding copies.

Every indexed source carries its class. CLI coding agents (Claude Code, Codex, antigravity), desktop apps (Claude Desktop, Gemini, ChatGPT), and subagents — normal subagents versus brain-workers. The class is labeled at ingest and decides default-search visibility and importance. Desktop apps: indexed, hidden from default search, opt-in only — and the opt-in switch stays unadvertised so benchmark lanes can't trip it. Normal subagents: indexed, labeled, expandable as a subagent thread. Brain-workers: always saved, never in default searches, never demoting other results — [OPEN] whether they index at all, and they should ship with BrainLayer itself. All transcripts get saved, so every memory can trace back. A new source enters only by deliberate wiring; nothing is auto-detected.

Store discipline. Verify, then store. Do the thing, then store it — never store-before-work as ritual. When something you stored turns out wrong, UPDATE it, don't store again beside it. If it's my intent you corrected, come back and ask me if you got it right — and make sure your question actually reached me: a question buried under recon output was never asked. Standing rules carry their date and expiry — a stale truth must not masquerade as current. [NOT A FEATURE YET — this is where I'm driving this] Eventually BrainLayer should be able to sleep like a human brain does: during the night or hibernation periods it runs local or large-context models to figure out what the current truths still are, and learns. That's what a brain does when it sleeps.

Never silently degrade. Never auto-delete personal data. Transcripts move to the archive only after they're embedded, and only if the usage readers still see everything. Test data changes against a copy of the real database before merging. Merged is not deployed — verify the thing that executes. Never ship my database inside a package.

This letter is for agents building BrainLayer. The rules for agents USING it live in the tool descriptions — keep those true.

— Etan


Read the full file on GitHub · 266 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. 2d ago First seen · 266 lines · 4,406 tokens per session scan A 3ee2fc286d78

Subscribe to this mod's changes

brainlayer AGENTS.md is an instructions file published in the GitHub repository EtanHey/brainlayer (8 stars, last pushed 8d ago), licensed Apache-2.0. It adds 4,406 tokens to every session, about $0.0220 per session on Opus 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.