Skip to content

Codebase memory MCP servers for Claude Code, compared

For codebase memory in Claude Code, start with the information you need to retrieve. A code index answers where a function is used; a session store helps resume a task; a decision record explains why an approach was chosen or rejected. Some servers cover more than one of these jobs.

If you are looking for a codebase-memory-mcp alternative, Selvedge fits the decision-history part of the problem. It does not replace a code structure index or call graph. You can also keep codebase-memory-mcp and add Selvedge for recorded reasons and outcomes.

We maintain Selvedge. This is a documentation-based comparison, reviewed September 24, 2026, with versioned sources below. It is not a benchmark of the other tools.

JobThe question it answersStarting points
Code intelligenceHow is the code structured, and what depends on this function?codebase-memory-mcp, OpenLore
Session contextWhat task was in progress, and what should resume next?Memory Keeper
General memoryWhat facts and preferences should an agent retrieve later?mem0, the reference MCP memory server, claude-code-memory
Decision historyWhy did we choose this, what did we reject, and when should we reconsider?Selvedge, maintained ADRs; also inspect the decision features in the tools above

These are selection questions, not exclusive categories. For example, codebase-memory-mcp now documents an ADR-management tool, OpenLore documents anchored decisions, and Memory Keeper can store decisions as context items.

ServerDocumented focusStorage and setup considerations
codebase-memory-mcpA persistent code graph, structural and semantic queries, and architecture decision recordsNative executable and release assets; SQLite-backed local storage. Its documentation states no required hosted service or API key.
OpenLoreStatic analysis, code relationships, anchored notes and decisions, and optional change guardrailsLocal-first index; its core path requires no API key. Check the documented configuration of optional features.
Memory KeeperPersistent task context, decisions, progress and checkpoints across sessionsNode-based MCP server with SQLite storage; agents must save and restore the relevant context.
mem0Memory extraction and retrieval for agents and applicationsSelf-hosted and managed options. The documented default uses an LLM and embeddings; inspect provider and storage configuration before assuming offline operation.
Reference MCP memory serverEntities, relationships and observations in a knowledge graphLocal JSONL file; configure its location so later sessions use the same store.
claude-code-memoryCoding activity, patterns and relationshipsRequires a separately configured Neo4j database, local or cloud.
SelvedgeRecorded reasons and outcomes for functions, columns, routes and other entitiesLocal SQLite under .selvedge/; MCP and CLI. Core queries require no LLM. Recording and retrieval are explicit.

A local memory server does not make the whole coding workflow offline: the connected agent may send retrieved content to its model provider. Installation and optional models can also require downloads.

  • Need code navigation or impact analysis? Start with codebase-memory-mcp or OpenLore. Check language coverage and the queries you need on your own repository.
  • Need to resume an interrupted Claude Code session? Start with Memory Keeper’s save/checkpoint/restore workflow.
  • Need facts or preferences across an application? Compare mem0’s extraction and retrieval approach with a simpler explicitly maintained knowledge graph.
  • Need the reason an approach was rejected? Try Selvedge’s entity-keyed prior_attempts, or maintain an indexed set of instructions and ADRs. Other servers also store decisions; compare their retrieval and revision behavior before choosing.

Before adding another server, check whether your current tool already stores the information you need. Multiple servers can coexist, but overlapping records need a clear source of truth and a retrieval rule.

  1. Save one actual decision, the reason for it, and what would change your mind.
  2. Start a new coding session in the same project.
  3. Ask for that decision before editing the affected code.
  4. Inspect whether the answer includes the reason, outcome and source.
  5. Change the underlying constraint and check how the old record is revised or superseded.

This tests your configuration and workflow. It does not establish that the agent will always retrieve or follow the record. See the distinction between agent memory and retrieval.

Selvedge is a local MCP server and CLI for recorded code decisions. log_change saves the stated reason; prior_attempts retrieves recorded attempts and outcomes by entity. An explicit reject or revert can report confidence: "exact", which describes the recorded evidence, not whether the decision is correct.

Terminal window
pip install selvedge
selvedge setup --agent claude-code

Follow the Claude Code setup guide, then the record-and-retrieve walkthrough. For other clients, use the quickstart. Claude Code hooks do not automatically apply to other agents.

What is the best MCP server for codebase memory with Claude Code?

There is no single choice for every workflow. Match code navigation, session context, general memory or decision history to the task, then verify a later-session retrieval in your repository.

Is Selvedge a replacement for codebase-memory-mcp?

Not for code indexing, call graphs or structural search. Selvedge focuses on reasons and outcomes that agents or people explicitly record. codebase-memory-mcp also documents ADR storage, so assess whether its existing decision features already meet your need.

Can I use more than one memory server?

Yes, if your client supports multiple MCP servers. Give each record a clear owner and tell the agent which source to consult. More available tools alone do not guarantee better decisions.

Does local storage mean no data leaves my computer?

No. Local storage describes where the server keeps records. A connected coding agent may include retrieved records in requests to its model provider; provider configuration and optional features also matter.

The descriptions above summarize these repository documentation snapshots. We have not run a comparative reliability, speed or memory benchmark. Features and setup can change; consult the current upstream instructions before installation.