# How I gave Claude, Cursor and Codex one shared memory in plain Markdown

> Source: <https://dev.to/alenissacsam/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown-541k>
> Published: 2026-11-26 21:35:11+00:00

**Recommendation:** Keep agent memory in plain, git-tracked files and wrap note text in untrusted-content tags before it reaches a model; recompute derived state from the event log so corrections never go stale.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

Every AI chat I opened started from zero, and every app started from zero again. I'm a student, I use several AI apps every day, and I kept re-explaining my projects, my stack and my decisions to each of them.

So I built Keepfold: one memory folder on my own PC that all of them read from and add to, through MCP. This post is how it works, what broke while shipping it alone, and where other tools are the better choice.

You install it, pick a folder and connect your AI apps (one click each for Claude Desktop, Claude Code, Codex CLI, Gemini CLI, Cursor, VS Code, Windsurf, Antigravity and LM Studio). From then on:

Here is what an AI app actually gets. In the sample vault, a made-up student types "Add a save command to my text adventure game". Before the model answers, Keepfold adds this (shortened):

```
## Related
- [[text-adventure]] — A small terminal game: rooms in a dict, one function per command.
- [[functions]] — Functions
- [[loops]] — Loops
```

So the model starts out knowing how the game is built. With your own vault, the lines you pinned ("Python 3.12, type hints, uv only") and the preferences that fit the message come first.

```
Claude Code, Codex, Gemini CLI ── hook ──┐
Claude Desktop, Cursor, VS Code ── MCP ──┤
                                         ▼
                          keepfold (stdio MCP server)
                                         │
                                         ▼
              vault: one folder, in git, opens in Obsidian
              Markdown notes + JSONL events = source of truth
                                         │
                  ┌──────────────────────┴───────────────┐
                  ▼                                      ▼
     search: SQLite FTS5                levels, plan, dashboard:
     + local embeddings                 derived, rebuilt on demand
```

A few choices that shaped everything else:

`keepfold undo <session>` can revert a chat that saved something wrong.
I wanted to be able to read my memory, fix it by hand, grep it, back it up and delete it, without asking a service. A folder of Markdown gives all of that for free. Obsidian opens it as a vault. Git gives it history. If Keepfold disappeared tomorrow, the notes would still be readable.

There is one rule that keeps this honest: numbers are never stored in notes. Study levels and spaced-repetition states (FSRS) are worked out from the event log every time. If a grade was wrong, cancelling it makes everything recompute, and nothing goes stale.

A memory that AI apps read is also a place where someone can plant instructions. A web page you saved, an imported chat or a note could contain "ignore your previous instructions".

So note text never reaches a model as plain text. Over MCP it is wrapped in `<untrusted_note>` tags, so the model can tell your notes from instructions. In the app and the dashboard it is escaped and stripped of links and images, and the dashboard runs under a `default-src 'none'` content security policy. Lines about you that try to drop an AI's rules, give it a persona or open with a role label are refused when they are written.

None of this makes prompt injection impossible. It makes the easy versions fail.

Keepfold had 15 releases in its first ten days on GitHub. Most of the fixes were not about memory at all:

`C:\Users\First Last`. Fixed in 0.6.1, along with making sure every PC gets x64 Python.
The test suite (about 4,800 tests) runs only on made-up data in temp folders. The real vault never goes near it.

Each of these is a good tool built for a different job. This is only what their own docs say, as of November 2026:

|  | Keepfold | ChatGPT memory | Claude's memory | Basic Memory | mem0 / OpenMemory | 
|---|---|---|---|---|---|
| Works across several AI apps | Yes | No, ChatGPT only | No, Claude apps only | Yes, any MCP app | Yes, any MCP app | 
| Plain files on your PC | Yes | No | No (you can export it) | Yes, Markdown | No, a vector database | 
| Free and open source | Yes, MIT | No | No | Yes, AGPL-3.0 | Yes, Apache-2.0 | 
| One-click Windows installer | Yes | Built in | Built in | No, uv or Homebrew | No, Docker | 

When the other tool is the better choice:

Keepfold is free and MIT: [github.com/alenissacsam-2/keepfold](https://github.com/alenissacsam-2/keepfold). Issues and Discussions are open, and bug reports are the most useful thing you can send me.

If you'd rather watch than read, here is the 43-second film:

One question for you: what would you want your AI apps to remember about you, and what should they never be allowed to save?

*Written by Claude (AI) from Keepfold's docs and commit history, and published at my request.*
