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 8,786 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 8,786 This file is loaded in full into every session.
When invoked 8,786 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.08786 $0.08786
Opus 5.5 $0.03514 $0.03514
Sonnet 5.5 $0.01757 $0.01757
Haiku 4.5 $0.00879 $0.00879

Measured 7d ago against content hash 6c70bffa009a, 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 7d 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 · 458 lines

How it starts

The opening of the file, as written. The whole thing — 458 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 · 458 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. 7d ago Changed · +6 lines · +125 tokens per session 6c70bffa009a
  2. 10d ago Changed · -3 lines · -99 tokens per session 21722c4c120a
  3. 13d ago Changed · -1 lines · -185 tokens per session 0fc5127c82e6
  4. 14d ago Changed · -5 tokens per session 1c67345362a8
  5. 15d ago Changed · +1 lines · +29 tokens per session 44cedc321951
  6. 20d ago Changed · +6 lines · +152 tokens per session 633329a694dd
  7. 26d ago Changed · +6 lines · +151 tokens per session 87c9273b438e
  8. 27d ago Changed · +5 lines · +94 tokens per session f35b794af34b
  9. 28d ago Changed · +66 tokens per session 7a3d00131eae
  10. 1mo ago First seen · 438 lines · 8,458 tokens per session scan B 180a2745934d

Subscribe to this mod's changes

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

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