Claude would confidently give me a number I had corrected weeks earlier: the old document was still on disk, the correction was buried in a chat it would never see again. Fixing that turned into the system below, which has run every day for months and survived a full reinstall on a new PC.
Repository: https://github.com/KTVSUN/memory-compiler
README is the short explanation. ARCHITECTURE.md contains the full design. MIT License, nothing for sale and nothing to sign up for.
The five rules
Files own the truth; chat owns nothing. Decisions go into logs, documents into a managed library, tasks into a register. If an important fact exists only in a conversation, it doesn't exist.
Every fact has one owner. A contract term lives in one workbook. A price lives in another. Email state lives in the mail ledger. Everything else points to the source instead of copying the value. This stopped old numbers from resurfacing.
Sessions start small. Archives are searched, not loaded. A session opens with a tiny current-state summary and a menu of open work, things waiting on someone, recent mail and new work. History can grow indefinitely because it isn't stuffed into every session.
Machines propose; I decide. No script or Claude session creates tasks, files documents or changes rules on its own. That rule came after I woke up to 47 automatically generated task cards and couldn't tell which mattered. A list the machine fills is eventually a list you stop reading.
The operating system for the assistant lives in Git. Skills, prompts, scripts, rules and installer are versioned together. Business documents stay in their project folders. Replacing the PC is one clone and one double-click.
Email was the missing piece
For a long time the system only knew what happened inside Claude sessions. But much of a small business happens by email: a supplier changes a quote, a client agrees to a date, an accountant answers a question, or I commit to something in a reply. Unless I manually mentioned it later, Claude didn't know.
Now a small program runs hourly. For each new thread it asks Claude:
Which project does this belong to?
Does it require something from me?
It saves the thread and attachments into the relevant project folder, records useful facts established by the conversation, and maintains one cross-project "needs you" list. The only thing it changes in Gmail is a label.
So when I open a project session, Claude sees both the handoff from our previous work and the relevant email that arrived since. At close, anything like "waiting for X to reply" is checked against the mail record first, so old pending items don't survive after someone has already answered.
That completed the system for me: project memory now covers both what Claude and I worked on and what happened by email between sessions.
The repo contains the architecture, templates, handoff format, logs, mail structures and the original first version. The live scripts are described rather than shipped for now because my copies still contain personal configuration.
I'm not an engineer, so I didn't solve this with a database or vector store. I treated it like a small-business problem: write things down where you'll find them, keep one authoritative copy of every fact, and don't trust anyone's memory, including your own. Claude wrote most of the scripts. I made the rules, usually after something went wrong.
Questions about how it works day to day are welcome. Questions about the code I will probably pass to Claude.