MESA LORE · v0.1.0 · OPEN SOURCE
Local MCP memory for Claude Code and Codex
MESA Lore is an open-source MCP memory server for coding agents. It makes past Claude Code, Codex CLI and Antigravity sessions searchable on your computer. In Claude Code and Codex, each new session starts with a short index. Agents then pull back only what they need, with sources.
- Runs on
- Your computer, on CPU
- Storage
- One SQLite file
- Model calls
- None
- License
- Apache-2.0
THE PROBLEM
Rules carry over. Past work is harder to find.
Each coding session starts with a fresh context window. Project instructions and saved notes can carry over, but details from older sessions are often left behind. Replaying a long session or explaining it again costs tokens. MESA Lore keeps that history searchable, so the agent loads details only when they are useful.
CLAUDE CODE MEMORY
How it differs from CLAUDE.md and auto memory
MESA Lore does not replace Claude Code’s built-in memory. Keep rules in CLAUDE.md and let auto memory hold learned preferences. Use Lore when you need to find what happened in earlier sessions.
| Compare | CLAUDE.md | Auto memory | MESA Lore |
|---|---|---|---|
| Written by | You | Claude | Hooks and the agent |
| Holds | Instructions and rules | Learnings and patterns | Past transcripts, notes and handoffs |
| Reaches a session | Loaded at session start | First 200 lines or 25KB of MEMORY.md | Short index, then search on demand |
| Best for | Standards and workflows | Preferences and corrections | Earlier decisions, failed attempts and work |
HOW IT WORKS
Small context first. Details on demand.
Capture
Hooks and transcript scans add past sessions to a local index. Agents can also save short notes.
Start small
With hooks, a new session receives a short index instead of the whole history. Other agents can request it through MCP.
Pull what is needed
The agent searches for details when it needs them and gets small passages with their sources.
Hand off
A handoff tells the next session what was done, what was decided and what comes next.
INSTALL
Set it up in one terminal session.
Requires Python 3.10 or newer. Tested on Linux. macOS is untested and Windows is not supported yet.
git clone https://github.com/Yasou13/MESA_Lore.git
cd MESA_Lore
python3 -m venv .venv
.venv/bin/pip install .
.venv/bin/mesa-lore install
.venv/bin/mesa-lore doctorinstall adds the MCP server and hooks to supported agents, imports existing history and backs up changed files to ~/.config/mesa-lore/backup/.
source .venv/bin/activate
mesa-lore search "why did login fail" --project my-app
mesa-lore index --project my-app
mesa-lore export --project my-app --out my-app.md
mesa-lore stats --days 30SUPPORTED AGENTS
One memory across your coding agents.
| Agent | Memory tools | Automatic capture |
|---|---|---|
| Claude Code | MCP | SessionStart, Stop and SessionEnd hooks |
| Codex CLI | MCP | Same hooks, after you approve them with /hooks in Codex |
| Antigravity | MCP | Transcripts are scanned at server start or with ingest-pending |
| Claude desktop | MCP | None. Chats on claude.ai and in the desktop chat tab are not captured |
Four MCP tools
memory_index- Shows the short project index.
memory_search- Finds relevant passages and notes.
memory_get- Opens one result with its context.
memory_save- Saves a decision, fact, todo, failed attempt or handoff.
DATA AND PRIVACY
Your history stays on your machine.
- Data stays in
~/.local/share/mesa-lore/lore.db. SetMESA_LORE_DBto use another path. - MESA Lore sends nothing over the network.
- Common secrets are masked before storage. Masking is pattern-based and can miss unusual formats.
- Returned text is wrapped in
<untrusted_memory>tags so agents treat it as data. - Projects can be excluded with
excluded_projectsin~/.config/mesa-lore/config.toml.
MEASURED RESULTS
What has been measured, and what has not.
These figures come from the repository’s test suite and benchmark at v0.1.0 on Linux with Python 3.12 and 3.14 and can be re-run from the source.
A separate private evaluation on the author’s own transcripts (38,291 entries, 168 MB) answered 51.7% of 120 questions correctly with an 800-token memory budget. Answers and grading used LLMs, and this evaluation cannot be reproduced from the repository.
End-to-end token savings when resuming a session have not been measured yet. Search is lexical and recall is incomplete, so check important answers against the returned source.
QUESTIONS
Common questions about MESA Lore
What is an MCP memory server?
It is a service that gives an AI agent memory tools through the Model Context Protocol. MESA Lore runs locally and provides four tools for viewing an index, searching, opening results and saving notes.
Does MESA Lore replace CLAUDE.md or auto memory?
No. CLAUDE.md is for instructions and auto memory is for learned preferences. MESA Lore adds searchable history from past sessions alongside them.
How do I give Claude Code memory between sessions?
Install MESA Lore and run mesa-lore install. It adds the MCP server and hooks, imports existing history and backs up the files it changes. New sessions then start with a short index and can search earlier work.
How do I add memory to Codex CLI?
Run mesa-lore install. Codex gets the same memory tools and hooks. Approve the hooks with /hooks in Codex to turn on automatic capture.
Does MESA Lore send my code or transcripts anywhere?
MESA Lore sends nothing over the network. Your coding agent still sends the memory it retrieves to its own model provider, as it does with any other context.
Do I need an API key, GPU or embedding model?
No. MESA Lore makes no LLM calls and uses no embeddings. Search is lexical, so a query needs words or stems that appear in the text.
Are secrets stored in memory?
Common API keys, tokens, passwords and private keys are masked before storage. Masking is pattern-based, so an unusual secret format can be missed. You can exclude projects from ingest.
How is MESA Lore different from MESA Core?
MESA Lore remembers the work of coding agents on your computer. MESA Core stores and searches documents for the AI applications you build. Lore does not require Core.
How do I remove it?
Run mesa-lore uninstall. It removes MESA Lore from your agent settings and keeps the backups and database. To delete stored entries, use mesa-lore purge with a project or age limit.
