{"slug": "how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown", "title": "How I gave Claude, Cursor and Codex one shared memory in plain Markdown", "summary": "A student developer built Keepfold, an open-source local memory layer that lets AI apps including Claude Desktop, Claude Code, Codex CLI, Gemini CLI, Cursor, VS Code, Windsurf and LM Studio share a single folder of Markdown notes over MCP. The system stores notes and JSONL events as the source of truth in a git-backed Obsidian vault, with SQLite FTS5 plus local embeddings for search and derived study levels recomputed from the event log. The developer reports 15 GitHub releases in the first ten days and wraps note text in <untrusted_note> tags to blunt prompt injection, while acknowledging the defense does not make injection impossible.", "body_md": "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.\n\nSo 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.\n\nYou 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:\n\nHere 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):\n\n```\n## Related\n- [[text-adventure]] — A small terminal game: rooms in a dict, one function per command.\n- [[functions]] — Functions\n- [[loops]] — Loops\n```\n\nSo 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.\n\n```\nClaude Code, Codex, Gemini CLI ── hook ──┐\nClaude Desktop, Cursor, VS Code ── MCP ──┤\n                                         ▼\n                          keepfold (stdio MCP server)\n                                         │\n                                         ▼\n              vault: one folder, in git, opens in Obsidian\n              Markdown notes + JSONL events = source of truth\n                                         │\n                  ┌──────────────────────┴───────────────┐\n                  ▼                                      ▼\n     search: SQLite FTS5                levels, plan, dashboard:\n     + local embeddings                 derived, rebuilt on demand\n```\n\nA few choices that shaped everything else:\n\n`keepfold undo <session>` can revert a chat that saved something wrong.\nI 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.\n\nThere 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.\n\nA 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\".\n\nSo 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.\n\nNone of this makes prompt injection impossible. It makes the easy versions fail.\n\nKeepfold had 15 releases in its first ten days on GitHub. Most of the fixes were not about memory at all:\n\n`C:\\Users\\First Last`. Fixed in 0.6.1, along with making sure every PC gets x64 Python.\nThe test suite (about 4,800 tests) runs only on made-up data in temp folders. The real vault never goes near it.\n\nEach of these is a good tool built for a different job. This is only what their own docs say, as of November 2026:\n\n|  | Keepfold | ChatGPT memory | Claude's memory | Basic Memory | mem0 / OpenMemory | \n|---|---|---|---|---|---|\n| Works across several AI apps | Yes | No, ChatGPT only | No, Claude apps only | Yes, any MCP app | Yes, any MCP app | \n| Plain files on your PC | Yes | No | No (you can export it) | Yes, Markdown | No, a vector database | \n| Free and open source | Yes, MIT | No | No | Yes, AGPL-3.0 | Yes, Apache-2.0 | \n| One-click Windows installer | Yes | Built in | Built in | No, uv or Homebrew | No, Docker | \n\nWhen the other tool is the better choice:\n\nKeepfold 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.\n\nIf you'd rather watch than read, here is the 43-second film:\n\nOne question for you: what would you want your AI apps to remember about you, and what should they never be allowed to save?\n\n*Written by Claude (AI) from Keepfold's docs and commit history, and published at my request.*", "url": "https://wpnews.pro/news/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown", "canonical_source": "https://dev.to/alenissacsam/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown-541k", "published_at": "2026-11-26 21:35:11+00:00", "updated_at": "2026-11-26 21:44:34.507655+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "ai-safety", "developer-tools"], "entities": ["Keepfold", "Claude Desktop", "Claude Code", "Codex CLI", "Gemini CLI", "Cursor", "Obsidian", "Basic Memory"], "also_reported_by": [], "takeaway": "Storing agent memory as plain Markdown and JSONL events in a git-backed vault, with derived state recomputed from the event log and note text wrapped in <untrusted_note> tags, keeps memory readable and editable while blunting simple prompt injection.", "recommendation": {"advice": "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.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown", "markdown": "https://wpnews.pro/news/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown.md", "text": "https://wpnews.pro/news/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown.txt", "jsonld": "https://wpnews.pro/news/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown.jsonld"}}