A long-term memory shared by every AI you use, in Claude Code: the MCP server, hooks that keep the conversation in the raw log and load MEMORY.md, background dreaming, and a dream skill.
One long-term memory for every AI you use. Tell one assistant something once, and the others already know it, with the original words and where they came from.
Status: early. Runs on your own machine as one local MCP server over one folder of Markdown files kept in Git. Three tools and one resource for conversations, and a prompt and four tools for dreaming, one owner. Dreaming is run by your client, whose own model judges each day. A Claude Code plugin is included. A hosted version comes later.
How it remembers
Plain files you own. Facts are Markdown, one fact per file, in one flat folder. Read them, grep them, back them up. Git keeps every earlier version.
Forever. The raw log of conversation and tool calls is append-only. Nothing is deleted. There is no screen for browsing it; you talk to your AI.
Searched like code. Your AI searches with rg, ripgrep's arguments and output, rephrasing as it goes: the facts first, most-retrievable first, then what was said in the raw log, newest day first. The path tells them apart (facts/… or log/…). No embeddings, no semantic search.
Written while you sleep. During the day only the raw log grows. Later, dreaming turns each past day into facts: it adds them, overwrites the ones you corrected, and rewrites MEMORY.md. Your client decides when to dream, since only it knows where the memory is used.
Three kinds, no tags. Every fact is semantic (what is true of you and the people, projects, decisions and likes around you), episodic (what happened on a day) or procedural (how something is done), and nothing else; anything else is refused. Facts about you are semantic. Names are in the text, so search finds them without tags.
Only what is yours. A model already knows the general things. Facts hold only what is particular to you and those around you, both when they are written and when episodes are folded into a semantic fact.
Forgetting is overwriting. Correct yourself the way you would with a person. The fact is rewritten in place; Git keeps what it said before. No delete command.
Strength from FSRS. A fact a reply relied on without correction gets stronger (Good), one an AI only read a little stronger (Hard), and a corrected one weaker (Again). A fact that only came up in a search is not a use, and an unused one is kept but sinks in the ranking. Something you ask it not to forget starts strong (Easy). See src/memory/fsrs.ts.
Grounded and in your language. Every fact points to the raw log lines it came from, kept exactly as said. Nothing is translated.
The memory folder
~/.memory by default (set MEMORY_DIR or pass --dir <path> to move it). The folder is readable by you only, and every file in it too.
Path
What it holds
Who writes it
MEMORY.md
What your AIs should always know about you, the most important points and a table of contents, at most 8,000 characters. The one note always in context: an MCP resource to load at the start of each conversation, read before searching.
Rewritten when it dreams; your AI may edit it
facts/*.md
One fact per file: its kind, date, sources, S, D, last used, then the fact.
Dreaming only
log/<day>.jsonl
The raw log: conversation, every tool call, every read of a resource and every session a client starts, one JSON line each. Append-only.
memory and memory log
night.json
The last day dreaming has turned into facts, and when.
Dreaming
A folder from an earlier version that still has USER.md gets its text moved into MEMORY.md on start (under "About the owner (from USER.md)"), and Git keeps the old file. Facts from before kinds lose their about tags and become semantic on start, every other line as it was; a tagged name the text does not mention is added to the text, so search still finds it, and Git keeps them as they were (if Git cannot, they wait for the next start).
A fact file:
---
kind: semantic
date: 2026-12-02
source: [log/2026-12-02.jsonl#L14]
S: 3.7145
D: 5.1618
last_used: 2026-12-02
---
The owner waters the tomatoes every morning.
Run it on your machine
You need Node 22.18 or later, Bun to install the packages (the repository pins Node 26 and Bun with mise) and Git. Nothing is built; Node runs the TypeScript directly.
git clone https://github.com/wwwyo/memory.git
cd memory
bun install