brainlayer: Instructions file for Claude Code

AGENTS.md

brainlayer AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from EtanHey/brainlayer. It costs 10,564 tokens per session, scanned B, original, Apache-2.0.

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 Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: SessionStart hook event, but also the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is EtanHey/brainlayer's own configuration. It tells Claude Code, Codex and OpenCode how to work on brainlayer 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 brainlayer configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/etanheyman/Gits/brainlayer/src.

Reuse

Borrowing it

Nothing to install: this file belongs to EtanHey/brainlayer. 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/EtanHey/brainlayer/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/EtanHey/brainlayer

Made for: Claude Code, 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 brainlayer AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/etanhey/brainlayer/agents-md"><img src="https://agentmods.dev/badge/instructions/etanhey/brainlayer/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10,564 This file is loaded in full into every session.
When invoked 10,564 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.10564 $0.10564
Opus 5.5 $0.04226 $0.04226
Sonnet 5.5 $0.02113 $0.02113
Haiku 4.5 $0.01056 $0.01056

Measured 2d ago against content hash 564e6288de09, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

brainlayer AGENTS.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 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`python -m brainlayer.hook_python ~/.claude/settings.json` lints a settings file for bare
AGENTS.md · 519 lines

How it starts

The opening of the file, as written. The whole thing — 519 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 · 519 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 Changed · +3 lines · +44 tokens per session 564e6288de09
  2. 4d ago Changed · +1 lines · +93 tokens per session b95768439ba1
  3. 5d ago Changed · +2 lines · +66 tokens per session 58c42a386be3
  4. 12d ago Changed · +2 lines · +150 tokens per session 85fc451b6df0
  5. 16d ago Changed · +16 lines · +404 tokens per session a733fc9e8f4e
  6. 17d ago Changed · +13 lines · +296 tokens per session 23029957dbd4
  7. 23d ago Changed · +3 lines · +123 tokens per session 4d273dd2b517
  8. 24d ago Changed · +18 tokens per session a2c5342bdc3f
  9. 27d ago Changed · +16 lines · +371 tokens per session 4ce68f840834
  10. 1mo ago First seen · 463 lines · 8,999 tokens per session scan B 918a3d4afd89

Subscribe to this mod's changes

brainlayer AGENTS.md is an instructions file published in the GitHub repository EtanHey/brainlayer (10 stars, last pushed today), licensed Apache-2.0. It adds 10,564 tokens to every session, about $0.0423 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-31.

Related

brainlayer AGENTS.md compared with instructions from other repositories

brainlayer AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
brainlayer AGENTS.mdEtanHey/brainlayerInstructions file10todayApache-2.0B10,564Claude Code, Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150kyesterdayMITA4,951Codex, OpenCode
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file291ktodayMITA4,396Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,303GitHub Copilot