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.

CompareCLAUDE.mdAuto memoryMESA Lore
Written byYouClaudeHooks and the agent
HoldsInstructions and rulesLearnings and patternsPast transcripts, notes and handoffs
Reaches a sessionLoaded at session startFirst 200 lines or 25KB of MEMORY.mdShort index, then search on demand
Best forStandards and workflowsPreferences and correctionsEarlier decisions, failed attempts and work

HOW IT WORKS

Small context first. Details on demand.

  1. Capture

    Hooks and transcript scans add past sessions to a local index. Agents can also save short notes.

  2. Start small

    With hooks, a new session receives a short index instead of the whole history. Other agents can request it through MCP.

  3. Pull what is needed

    The agent searches for details when it needs them and gets small passages with their sources.

  4. 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.

Install from GitHub
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 doctor

install adds the MCP server and hooks to supported agents, imports existing history and backs up changed files to ~/.config/mesa-lore/backup/.

Everyday commands
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 30

SUPPORTED AGENTS

One memory across your coding agents.

AgentMemory toolsAutomatic capture
Claude CodeMCPSessionStart, Stop and SessionEnd hooks
Codex CLIMCPSame hooks, after you approve them with /hooks in Codex
AntigravityMCPTranscripts are scanned at server start or with ingest-pending
Claude desktopMCPNone. 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.

MEASURED RESULTS

What has been measured, and what has not.

432tokens at session start163 for the index, 269 for tool definitions
8/9keyword benchmark questionsTurkish search: 3 of 3
47–86 mssearch p95 on 10,000 chunksRange across three benchmark runs on Linux
200passing testsAll 31 required benchmark categories pass

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.

Current limits

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.

NEXT STEP

Where to go from here