Mem-Forever memory that outlives the session.
Every AI tool forgets you when the window closes. Mem-Forever keeps the memory in your own private Git repository: a profile, one file per memory, a hand-off note that says where you stopped, and an encrypted vault for your keys. Any tool that reads files can use it, and a chat with no tools gets it pasted in one message.
Use this template Read the engineering book
::PROGRESS{date:2026-11-05|done:§1 tests green|next:tag and release|unverified:docs build}
Three ways in
-
A coding agent with the repo on disk
It reads its own instruction file, then the hand-off, then the profile, and works on the files directly. Every save is its own commit, pushed at once.
Claude Code, Cursor, Codex, Copilot, Gemini CLI, Hermes
-
A chat with a connector or a clone
It reads
BRAIN.mdfirst, eight points, about 400 tokens on most tokenizers and 588 on Claude's, then the files it names, and writes back through git when it can.ChatGPT, Claude.ai, Gemini web, through GitHub or Drive
-
A chat with no tools at all
One pasted message: a notation card and the hand-off blocks, built by
brain.py pastein the owner's language. It hands changes back as blocks in a code fence; a tool that can write git reviews them before anything is merged.Any web chat, signed in or not
What a session does
- Reads the hand-off and tells you in two sentences what was done, what comes next and what is unverified.
- Commits what the last session left unsaved before touching the work.
- Reads the profile, yours and the agent's own, and the memory index; opens a memory file only when the task needs it.
- Judges each next item before acting: a boundary conflict stops, missing evidence asks, the owner's call waits.
- Updates the hand-off at every milestone, not at session end, so a closed window loses nothing.
A hand-off request authorizes nothing
Reading, restating or exporting the note is recording, not doing. An item enters done only with evidence from the conversation or an observed result; the item moves whole, its text unchanged.
Review before merge
A hand-off that comes back from another model is a candidate, not the truth. The tool compares it block by block with the accepted one and never writes: a deleted boundary, a forbidden or unevidenced item in done, a missing key, a changed identifier or a silent drop is rejected; the rest is listed for you to decide.
REJECT boundary deleted or rewritten: ::BOUNDARY{never:force-push main|scope:project} REJECT DECIDE line 9: key why empty (write none) REJECT next item dropped without a word: write the release note FLAG decision 'ship from main, no release branch': why changed TRANSITION next/unverified -> done, needs evidence: tag and release review: REJECTED (3); baseline stays; nothing written
Output of brain.py handoff review on an example hand-off, 2026-11-05: the candidate dropped the boundary, emptied a reason and dropped a next item.
Measured, not estimated
| What | Result |
|---|---|
| The notation card, English, 1351 bytes | 381 to 410 tokens on ten models' own tokenizers, 539 on Claude's. |
| The notation card, Chinese | 352 to 392 tokens on the same ten, 542 on Claude's. Tested in conversation on twelve model tiers, weak to strong. |
BRAIN.md, the eight points | 399 to 406 tokens on GPT, GLM and Kimi, 427 on Doubao, 588 on Claude's. |
| One web chat, signed out, no tools | Read the card and a 14-block hand-off in one message; restated 4, 6 and 9 items verbatim; its write-back was reviewed, corrected once, accepted. |
| Template files | Every file with notation passes the iLang grammar validator with zero errors and zero warnings. |
Dates and methods are in the engineering book, section 5.
Works with the tools you already use
Claude Code reads CLAUDE.md, Cursor reads .cursorrules, Codex reads AGENTS.md, Copilot reads .github/copilot-instructions.md, Gemini CLI reads GEMINI.md. The five files carry the same text. Web chats take BRAIN.md as their instructions and reach the repo through a connector, a Drive mirror or a pasted message.