claude-mem vs MemPalace vs XERJ: which memory should Claude Code use?
Should I use claude-mem, MemPalace or XERJ for Claude Code memory? Use claude-mem for automatic, model-written session summaries. Use MemPalace to keep every conversation word for word, saved by hooks. Use XERJ when you want the agent to choose what to save and one local engine for memory, logs, docs and code.
TL;DR All three give Claude Code memory that lasts across sessions. claude-mem saves on its own and has a model write short summaries. MemPalace saves every word on its own and searches it by meaning. XERJ saves only what the agent chooses, through MCP tools, in a local engine that also searches your other data.
Three designs for a coding agent's memory
Act as a coding agent. Read https://xerj.org/llms.txt, install XERJ, start a local node, run claude mcp add xerj -- xerj mcp, then in a new Claude Code session store two facts about this repo with xerj_memory_store and recall them in a third session with xerj_memory_recall, and report what came back.
Side by side
Read from each project's README and the XERJ source on 2026-10-30. We did not run a head-to-head benchmark.
| claude-mem | MemPalace | XERJ | |
|---|---|---|---|
| How it saves | Lifecycle hooks, automatic | Hooks, periodically and before compaction | The agent calls xerj_memory_store |
| What it keeps | Model-written observations and summaries | Original text, word for word | The text the agent sends |
| Model on write | Yes: hosted observer, your key, or your Anthropic plan | No, in raw mode | No |
| Search | SQLite FTS5 plus Chroma | ChromaDB by default; other backends | BM25, semantic or hybrid in one index |
| How it recalls | Context at session start, plus MCP search | MCP tools and a recall skill | MCP xerj_memory_recall or HTTP |
| Runtime | Bun worker service | Python package | One binary |
| Other agents | Codex, OpenCode and others | Codex CLI and Cursor hooks | Any MCP client or HTTP caller |
| License | Apache 2.0 | MIT | Apache 2.0 |
Find your fit
Answer four questions
claude-mem
You want Claude Code to remember on its own and start each session with a short, model-written recap.
MemPalace
You want every conversation kept word for word, saved by hooks, searched by meaning, with no summaries.
XERJ
You want the agent to decide what to save, and one local engine that also searches your logs, docs and code.
claude-mem in short
claude-mem installs hooks for every stage of a Claude Code session. A model reads what happened and writes compact observations, stored in SQLite with full text search and in Chroma for vectors. At the next session start it adds relevant context by itself, so you do not have to ask. That model call is the trade: the installer offers a hosted observer with a 30 day free trial, or --provider to use your own key or Anthropic plan.
Pick it when you want memory that works without the agent thinking about it.
MemPalace in short
MemPalace keeps the conversation as written, with no summarizing. It organizes text into wings, rooms and drawers so searches can be scoped. ChromaDB is the default backend and others can be plugged in. Its README reports 96.6% R@5 on LongMemEval in raw mode with no API calls; that is the project's own number.
Pick it when you never want a model to decide what to forget.
XERJ in short
XERJ is a local search engine with a memory API. The agent stores a memory by calling a tool and recalls it the same way. Recall is BM25 by default, with semantic and hybrid modes. Because it is a full search engine, the same node can index your logs, docs, code and past Claude Code sessions.
Limits to know: it saves nothing unless the agent asks, it runs on one node with no replication, and namespaces isolate by name, not by credential.
See what an MCP memory server is for the general idea, and Claude Code memory for the built-in options that come first.
How to try it with XERJ
Use the Copy the prompt button and paste it into Claude Code. It installs XERJ, adds it as an MCP server and tests store and recall across sessions. To add it by hand:
curl -fsSL https://xerj.org/get | sh
claude mcp add xerj -- xerj mcp
Sources checked
All checked on 2026-10-30.
- claude-mem README, thedotmack/claude-mem: hooks, worker, SQLite FTS5, Chroma, observer and provider options. License Apache 2.0.
- MemPalace README, MemPalace/mempalace: verbatim storage, ChromaDB default, pluggable backends, hooks, LongMemEval R@5. License MIT.
- XERJ:
engine/crates/xerj-api/src/memory_api.rsandengine/crates/xerj-mcp/src/lib.rs.
FAQ
What is the difference between claude-mem and MemPalace?
claude-mem has a model compress each session into short observations and adds them at the next session start. MemPalace stores the conversation word for word and finds it with search, with no summary step.
Does claude-mem need a paid service?
Its installer offers a hosted observer with a 30 day free trial. You can instead pass a --provider flag to use your own OpenRouter or Gemini key, or your Anthropic plan.
Is MemPalace's 96.6% score independent?
No. MemPalace reports 96.6% R@5 on LongMemEval in raw mode in its own README. We did not rerun it.
How is XERJ different from both?
XERJ has no hooks. The agent saves and recalls through MCP tools when it decides to. The same local engine also searches logs, docs, code and past session files.
Can I use more than one?
Yes. They are separate MCP servers or plugins. Running two memory systems means two places to check, so start with one.
Which is the best MCP memory server for Claude Code?
It depends on what you want saved and who decides. Use the picker on this page, then try your choice for a week.
Related
- What is an MCP memory server?
- How does Claude Code memory work, and when do you need more?
- Search Claude Code past sessions on disk
- XERJ vs Mem0: which memory fits your AI agent?
- How do people store user preferences so an agent can recall them next week?
- What's a simple way to give an agent long-term memory on my laptop without Qdrant? · same intent: agent memory
- XERJ vs agent memory tools: Mem0, Zep, Letta and Cognee · same intent: agent memory
- Should agent memory use a knowledge graph? · same intent: agent memory