company-brain-os / memory
CLAUDE.md7 starsChanged 47 days agoMITView on GitHub
Read this before writing anything to memory. Memory is live state. The project folder is detail. Memory files and the index (MEMORY.md) hold the current status and a pointer to where the real work lives. The long operational story (build logs, meeting notes, history) belongs in the project's own folder, not in memory. Nothing gets shortened in memory until its detail is safe somewhere else first (preserve-first, see below). Nothing is ever lost, only relocated. Flat schema, no nested wrapper:
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- daily-log/CLAUDE.mdCLAUDE.md
- operators/CLAUDE.mdCLAUDE.md
- daily-briefingSkill
- handoverSkill
- html-previewSkill
- meeting-debriefSkill
- memory-checkupSkill
- pr-reviewSkill
- session-debriefSkill
- setup-company-brainSkill
- shipSkill
- skill-detectorSkill
- skill-improveSkill
- sparringSkill
- syncSkill
- system-checkupSkill
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Read this before writing anything to memory.
- Very specific: line 40
Every entry in MEMORY.md is one line:
- Very specific: line 50
Preserve-first: Before shortening a memory file's ## Updates, confirm the detail it currently holds is already safe in the project folder.
- Distinctive: line 53
Update the existing file rather than creating a duplicate.
- Distinctive: line 66
Convert relative dates to absolute: before writing them anywhere.
- Distinctive: line 148
Only stop and read closely if both sides touch the *same* item's line, then it's a real edit conflict on one project, not two independent …
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Memory layer rules
Read this before writing anything to memory.
Principle
Memory is live state. The project folder is detail. Memory files and the
index (MEMORY.md) hold the current status and a pointer to where the real
work lives. The long operational story (build logs, meeting notes, history)
belongs in the project's own folder, not in memory. Nothing gets shortened in
memory until its detail is safe somewhere else first (preserve-first, see
below). Nothing is ever lost, only relocated.
Four categories
project_*: active initiatives with a status and a next action.strategic_*: long-term positioning and directions.feedback_*: lessons learned and agent-behavior rules (include the why).reference_*: pointers to external resources (URLs, repos, dashboards).
Frontmatter (Core)
Flat schema, no nested wrapper:
---
name: <kebab-case-slug>
type: project # project | strategic | reference | feedback
status: 🟡 # see status scale below
deadline: YYYY-MM-DD # optional; omit if there is no hard date
owner: <operator-slug>
---Status scale: 🔴 urgent · 🟠 stalled/waiting · 🟡 active · 🟢 on track · 🔵 wrap-up (done, loose ends open) · ❌ closed.
Index line format
Every entry in MEMORY.md is one line:
- [Title](file.md) - <emoji> one line + Next action
The line states three things and nothing more: what it is, what state it is in, and what happens next. Technical detail, tooling, prices, or anything else that belongs to the project itself stays out of the index.
Rules
- Preserve-first. Before shortening a memory file's
## Updates, confirm the detail it currently holds is already safe in the project folder. If the detail lives only in memory, write it into the folder first, then shorten. Update the existing file rather than creating a duplicate; check for one before adding a new one. - Status and Next action are rewritten, never appended to. In a project
file,
## Statusand## Next actionalways describe the present; the chronology goes in## Updates. Either one longer than an index line is out of standard: move the detail to## Updatesor the project folder. - Archive, never delete. Closing an item means: set
status: ❌in the frontmatter and in the body, move the file tomemory/archive/, and move its index line fromMEMORY.mdtomemory/archive/INDEX.md. Soft-delete only. - Don't save what is derivable elsewhere. Skip anything the repo already records (code, git history, a CLAUDE.md) or anything that only matters to one conversation.
- Convert relative dates to absolute before writing them anywhere.
- Wikilinks reference the filename stem. Link related items with
[[filename-without-extension]]in the body, e.g.[[project_example]]points atproject_example.md. A file's frontmattername:matches its filename stem, so the link, the filename, and thename:field are always the same string. status:in the frontmatter schema above applies toproject_*andstrategic_*files (it drives the emoji on their index line).reference_*andfeedback_*files don't carry a status field: they are reference material and standing rules, not work with a state.
Where index rows live
MEMORY.md is auto-loaded on every session start and the host tool truncates
it past a size cap, so it carries only rows the daily briefing needs: projects
and strategic directions, plus feedback rules. Two kinds of rows live in
sibling files, read on demand:
reference_*rows inmemory/REFERENCES.md. The files themselves stay inmemory/; only the row moves. A project that uses a reference links it with a[[wikilink]].- Closed items in
memory/archive/INDEX.md, with links relative to the archive folder ((project_slug.md), noarchive/prefix).
Same one-line row format everywhere. The scripts in scripts/ and the
checks in /memory-checkup read rows from all three files, and still accept
a repo that keeps everything inline in MEMORY.md.
Memory roots (opt-in)
memory/ is the primary root. A team that adopts federated roots
(docs/ADVANCED.md section 8) keeps one more root per area that needs it,
at areas/<name>/memory/, with this file as the single standard for all of
them: same row format, same frontmatter, same archive convention, same
preserve-first rule. An item has one home, the root that owns its next
action; the primary index points at each area root with one row under
## Areas, with no status and no next action on it. Without an area root
none of this applies and memory/ is the whole layer.
Anti-patterns
- ❌ Relative time words ("today", "next week", "recently") instead of an absolute date.
- ❌ Letting the model infer or change a status on its own judgment instead of a human decision.
- ❌ Pruning detail from a memory file before the same detail is written safely into the project folder (breaks preserve-first).
- ❌ Appending a new dated line to the index without collapsing the previous
one, letting
MEMORY.mdgrow without bound. - ❌ A
[[wikilink]]or file path that does not resolve to a real file. - ❌ The same item in two memory roots (the gate reports
DUP-ROOT): one home, the other root links it. - ❌ A status or a next action on a
## Areaspointer row.
When two debriefs collide
MEMORY.md is the file most likely to conflict when two operators close sessions
close together in time: it's the one flat file every debrief touches, so two people
editing it the same day land near each other far more often than in any per-project
file. The index line format (one line per item, self-contained) is what makes almost
every one of these conflicts trivial: both sides added or changed a line, and the fix
is to keep both lines, not to pick one.
A conflict on two adjacent index lines looks like this:
<<<<<<< HEAD
- [Website redesign](project_website.md) - 🟡 wireframes approved, next: build homepage.
=======
- [Client onboarding revamp](project_onboarding.md) - 🟢 one-pager drafted, next: share for review.
>>>>>>> origin/mainBoth lines describe real, current state. The resolution is a union, not a choice:
delete the three marker lines (<<<<<<<, =======, >>>>>>>) and keep both content
lines, in whichever order reads cleanly:
- [Website redesign](project_website.md) - 🟡 wireframes approved, next: build homepage.
- [Client onboarding revamp](project_onboarding.md) - 🟢 one-pager drafted, next: share for review.Only stop and read closely if both sides touch the same item's line, then it's a real edit conflict on one project, not two independent additions, and needs an actual decision about which status is current.
This is still a merge conflict like any other: resolve it inside the rebase, never
abort onto a dirty tree. See the iron rules in the root CLAUDE.md's daily git cycle.
Advanced memory (salience scoring, machine index): see docs/ADVANCED.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

