brain-memory
Skill16 starsChanged 21 days agoMITView on GitHub
The read/write protocol for the user's second brain — search before answering, and write back the durable residue of a session. Use when a session produced a decision, constraint, or hard-won gotcha worth keeping, when a Stop-hook nudge asks for a capture pass, or when the user says to remember something. For retrieving and synthesizing existing content, use `consult-brain`; for bulk-importing external content, use `ingest-brain`. MANDATORY TRIGGERS: remember this, write this down, save this to my brain, note this for later, capture this decision, add this to memory, log this learning, don't forget that, keep this in the brain, capture pass, session capture, what did we learn.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- itechmeat/open-second-braintheir own version, first seen Sep 26, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- itechmeat/open-second-brain★ 515same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brain-askSkill
- brain-authoringSkill
- brain-captureSkill
- brain-graphSkill
- brain-maintenanceSkill
- brain-proactivitySkill
- brain-todoSkill
- consult-brainSkill
- elicit-brainSkill
- ingest-brainSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
Before answering anything about the user's own history, work, or prior decisions, search first:
- Very specific: line 54
If the search says yes and you now need the material itself, read it under a ceiling: brain recall "<keywords>" --budget 2000 --json.
- Very specific: line 91
Every capture lands tagged inbox for later triage.
- Distinctive: line 114
When a nudge fires and nothing clears this bar, say so in one line and stop.
- Distinctive: line 120
Never write without checking first:
- Very specific: line 142
When a retrieved document materially changed what you said, name it inline: "from your 2026-05-20 note (3f2a1b9c) …".
- Very specific: line 168
If brain capture fails because the vault is unconfigured, that is a setup problem — see brain-maintenance, and do not retry in a loop.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Brain Memory
Agents read the brain reliably and write to it almost never, because writing is always the last step of a task and nothing forces it. This skill is the write protocol: what earns a durable note, how to check the brain does not already say it, and how to record it in one call.
Division of responsibility. consult-brain is the read protocol — how to
retrieve and synthesize. brain-memory is the write protocol — when and how the
durable residue of a session goes back in, plus the dedupe rule that stops the
brain filling with near-duplicates. For bulk-importing external content (files,
Gmail, Krisp, Slack), use ingest-brain. For themes and connections across
interactions, use brain-graph.
When this fires
- The user says so — "remember this", "don't forget that", "keep this in the brain". Always write. Do not second-guess an explicit instruction.
- A Stop-hook nudge arrives — a session-end hook decided the session did substantive work and nothing went back. Do one capture pass (below), then stop. Do not start new work.
- You noticed something durable mid-session — a decision got made, a constraint bit you, someone told you a fact you will need again. Offer it in one line; write it if the user agrees or if it is unambiguously theirs.
The read half
Before answering anything about the user's own history, work, or prior decisions, search first:
brain search "<2-4 keywords>" --limit 5 --json --brief--brief returns each hit's ingest-time summary instead of its chunk snippet
when the summary is cheaper — enough to tell you whether the brain already
knows something, which is all this pass needs.
If the search says yes and you now need the material itself, read it under a
ceiling: brain recall "<keywords>" --budget 2000 --json. Never loop
brain show over the hits — that returns every body in full, is unbounded,
and this skill's read half never needs it. The measured cost is in
consult-brain's cost-ordered table.
Retrieval mechanics — filters, brain recall, brain show, brain ask, voice
writing — live in consult-brain, including the cost-ordered command table. Do
not restate them here; hand off.
The write half
One capture per pass. One claim per capture.
brain capture --json --tag <topic> --text "<the durable fact in one or two sentences>"Assert on the response. It returns exactly six keys:
{
"document_id": "3f2a1b9c-7d4e-4a11-9c02-5b6e8f0a1234",
"id_prefix": "3f2a1b9c",
"title": "2026-07-25-capture-hnsw-index-caps-at-2000-dims",
"tags": ["inbox", "pgvector"],
"vault_path": "capture/2026-07-25-capture-hnsw-index-caps-at-2000-dims.md",
"status": "ingested"
}"status": "ingested" is the success signal, and it is keyed identically on the
MCP tool brain_capture — so the same assertion works whichever surface you
used. Report the id_prefix back to the user. If the command exits non-zero it
prints a plain error on stderr, not JSON; treat that as a failure and say so
rather than claiming a write that did not happen.
Every capture lands tagged inbox for later triage. Add one topical --tag so
it is findable before it is triaged.
What IS worth writing
- A decision and the reason behind it — not just "we chose Postgres", but why, and what it ruled out.
- A constraint discovered the hard way — "pgvector caps HNSW at 2000 dims, so the 4096-dim backend has no index." The kind of thing that costs an hour to rediscover.
- A fact about a person, system, or commitment that will not be obvious from the repo in three months.
- A correction to something already in the brain — see the dedupe rule.
What is NOT worth writing
- A summary of what you just did. The user was there.
- Anything
git log, the code, orCLAUDE.mdalready says. - A restatement of a document already in the brain.
- Speculation, or anything the user did not confirm.
- Transient state — "the test is currently failing", "the branch is mid-rebase".
- Routine edits, lookups, or answers to generic technical questions.
When a nudge fires and nothing clears this bar, say so in one line and stop. Declining is a valid outcome; padding the brain with session summaries is worse than writing nothing.
Dedupe before you write
Never write without checking first:
brain search "<the claim in 3-5 words>" --limit 5 --json --briefThen:
- A hit already states it → do not write. Say
already in the brain (<id-prefix>)and stop. - A hit contradicts it → do not add a second competing note.
brain edit <id-prefix>the existing one so the brain holds one current answer. Seebrain-authoringfor the edit flow. - A hit is adjacent but not the same → write the new one, and mention the neighbour so the user can link them.
- No hits → write it.
Two near-duplicate notes are worse than one, because retrieval then returns both and the user has to adjudicate.
Citing memory that changed the answer
When a retrieved document materially changed what you said, name it inline:
"from your 2026-05-20 note (3f2a1b9c) …". Then log the signal:
brain rate <id-prefix> useful # this doc helped
brain rate <id-prefix> irrelevant # false positiveLog silently — do not ask permission. This feeds ranking. Same convention as
consult-brain.
Operational notes
- The
brainCLI works from any cwd. No need tocdinto the second-brain repo. - The session-end nudge is installed with
brain claude install-hooksand is opt-in. It fires at most once per session, only after real work, and only when nothing was written back. Disable it withBRAIN_HOOK_ENABLED=falseorbrain claude install-hooks --uninstall. - Tuning knobs are real environment variables, not
.enventries:BRAIN_HOOK_ENABLED,BRAIN_HOOK_MIN_TOOL_CALLS(default 12),BRAIN_HOOK_TRANSCRIPT_MAX_BYTES,BRAIN_HOOK_SENTINEL_TTL_DAYS. - Captures are picked up by the normal
brain-rebuildcycle. They are not summarized or graph-synced inline, so a fresh capture will not appear in graph queries immediately. - Review the inbox later with
brain capture list/brain capture review— seebrain-proactivityfor the triage flow. - If
brain capturefails because the vault is unconfigured, that is a setup problem — seebrain-maintenance, and do not retry in a loop.
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.

