Memory for Claude Code, Codex and Cursor: 7 tools compared (November 2026)
本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。
Memory for Claude Code, Codex and Cursor: 7 tools compared (November 2026)
This weekend I asked Claude and ChatGPT eight questions developers ask about memory for coding agents, like “What is the best memory MCP server for Claude Code?” and “How can I make Cursor remember lessons and mistakes across sessions?”. Across the 16 answers, the tools named most were Basic Memory (9 times), Mem0 (7), Cognee (6), Supermemory (6) and claude-mem (4). I build one of the others, hippo, which came up once, so read the hippo section with that in mind. For everything else I went to each project’s own README and docs on 22 November 2026 and wrote down what they say, with links, so you can check me.
这个周末,我向 Claude 和 ChatGPT 询问了开发者关于编码智能体记忆的八个问题,例如“Claude Code 最好的记忆 MCP 服务器是什么?”以及“如何让 Cursor 在不同会话间记住经验教训和错误?”。在 16 个回答中,被提及最多的工具分别是 Basic Memory(9 次)、Mem0(7 次)、Cognee(6 次)、Supermemory(6 次)和 claude-mem(4 次)。我开发了其中另一个工具 hippo,它被提及了一次,所以请在阅读 hippo 部分时考虑到这一点。对于其他所有内容,我查阅了每个项目在 2026 年 11 月 22 日的 README 和文档,并记录了它们的内容及链接,以便您可以核实。
The short version:
简要版本:
| Tool | Where memories live | Hosted account | How memories get saved | Model call to save | Repo licence | Repo stars |
|---|---|---|---|---|---|---|
| claude-mem | SQLite in ~/.claude-mem, though the Cursor install defaults to their hosted CMEM Pro | Optional | Hooks pass tool calls to an observer agent that writes notes | Yes, the observer model | Apache-2.0 | 119k |
| Mem0 (hosted MCP) | Your Mem0 account | Required | The agent calls add_memory | Not stated for the hosted MCP, the library makes one LLM call per add | Apache-2.0 | 69k |
| Cognee | Local by default, Cognee Cloud optional | Optional | Plugins capture prompts and tool traces, plus a remember call | Local models with no key, provider calls with one | Apache-2.0 | 33k |
| Supermemory | Their hosted service by default in the Claude Code plugin, or local in ~/.supermemory | Optional | Plugin auto-capture, plus an MCP memory tool | Yes, fact extraction, which can run on Ollama locally | MIT | 32k |
| Basic Memory | Markdown files on your disk | Optional, for cloud sync | The agent writes notes through tools like bm_write | No extraction LLM stated, embeddings for search run locally by default | AGPL-3.0 | 4.7k |
| MCP memory server | One local JSONL file | None documented | The model calls create_entities and add_observations | Not stated | MIT, in a repo moving to Apache-2.0 part of the official servers repo | N/A |
| hippo | SQLite in your repo, plus markdown copies | None | Hooks in Claude Code and Codex, MCP tools in Cursor | No, on the default path | MIT | 794 |
claude-mem “runs a second agent beside it that takes notes while it works”. Hooks hand each tool call to a local worker, an observer model turns that activity into short observations, and it writes a summary when the session ends. Everything sits in SQLite at ~/.claude-mem/claude-mem.db with Chroma on top for semantic search, and cloud sync is opt-in. The observer can run on Ollama, LM Studio or any OpenAI-compatible endpoint. The Cursor install uses CMEM Pro, their hosted service, unless you pick another provider, and the install guide lists Codex CLI as a supported host. It’s the most starred tool here by a long way.
claude-mem “在旁边运行第二个智能体,在工作时做笔记”。钩子(Hooks)将每个工具调用传递给本地工作进程,观察者模型将这些活动转化为简短的观察记录,并在会话结束时编写摘要。所有内容都存储在 ~/.claude-mem/claude-mem.db 的 SQLite 中,并结合 Chroma 进行语义搜索,云同步功能可选择开启。观察者模型可以在 Ollama、LM Studio 或任何兼容 OpenAI 的端点上运行。Cursor 的安装使用其托管服务 CMEM Pro(除非您选择其他提供商),安装指南列出了 Codex CLI 作为支持的主机。它是这里星标数最多的工具,遥遥领先。
Mem0 runs a hosted MCP server. In their words “nothing runs on your machine”, and the memories “live in your Mem0 account, not on your computer”, so you need a Mem0 Platform account. The MCP docs cover Claude Code, Codex (through ~/.codex/config.toml) and Cursor, and the agent decides for itself when to call add_memory. The open-source library can run on your own infrastructure, and it uses OpenAI’s gpt-5-mini and text-embedding-3-small by default.
Mem0 运行一个托管的 MCP 服务器。用他们的话说,“没有任何东西在您的机器上运行”,记忆“存在于您的 Mem0 账户中,而不是您的电脑上”,因此您需要一个 Mem0 平台账户。MCP 文档涵盖了 Claude Code、Codex(通过 ~/.codex/config.toml)和 Cursor,智能体会自行决定何时调用 add_memory。该开源库可以在您自己的基础设施上运行,默认使用 OpenAI 的 gpt-5-mini 和 text-embedding-3-small。
Cognee turns what you give it into a knowledge graph. Its Claude Code and Codex plugins capture prompts and tool traces automatically and recall what’s relevant on every turn. Cursor connects through their MCP server. It runs locally for free with no API key, using a local GLiNER model to extract the graph and a local embedding model, and once you set a provider key, processing makes calls to that provider.
Cognee 将您提供的内容转化为知识图谱。它的 Claude Code 和 Codex 插件会自动捕获提示词和工具追踪记录,并在每一轮对话中召回相关内容。Cursor 通过其 MCP 服务器进行连接。它可以在本地免费运行,无需 API 密钥,使用本地 GLiNER 模型提取图谱,并使用本地嵌入模型;一旦您设置了提供商密钥,处理过程就会调用该提供商。
Supermemory’s Claude Code plugin auto-captures “conversations and important tool usage”, and an MCP memory tool lets the agent save things itself. The plugin talks to their hosted service with an API key by default, and it also works against a local supermemory that keeps everything in ~/.supermemory. Run locally, it extracts facts with the model you choose, which can be OpenAI, Anthropic, Gemini, Groq or a local Ollama model, embeddings run locally by default, and URL ingestion still goes through a hosted reader. There are plugins for Claude Code, Codex and Cursor, and the Codex one shares memory with Claude Code, Cursor and OpenCode.
Supermemory 的 Claude Code 插件会自动捕获“对话和重要的工具使用情况”,并且一个 MCP 记忆工具允许智能体自行保存内容。该插件默认使用 API 密钥与他们的托管服务通信,它也可以针对存储在 ~/.supermemory 中的本地 supermemory 工作。在本地运行时,它使用您选择的模型提取事实(可以是 OpenAI、Anthropic、Gemini、Groq 或本地 Ollama 模型),嵌入默认在本地运行,而 URL 摄取仍通过托管的阅读器进行。它为 Claude Code、Codex 和 Cursor 提供了插件,其中 Codex 插件与 Claude Code、Cursor 和 OpenCode 共享记忆。
Basic Memory keeps “Markdown files that both you and your AI can read, write, and search”, plain text on your disk with a local SQLite index. The agent writes notes through tools like bm_write, and the Claude Code plugin adds a briefing at session start and a checkpoint before compaction, with capture as an opt-in. Changed notes get embedded for search, locally with fastembed by default or through an OpenAI-compatible API. It has setup guides for Claude Code, Codex and Cursor, cloud sync is optional, and it’s the only AGPL-3.0 tool on this list.
Basic Memory 保留了“您和您的 AI 都可以读取、写入和搜索的 Markdown 文件”,即磁盘上的纯文本,并带有本地 SQLite 索引。智能体通过 bm_write 等工具编写笔记,Claude Code 插件会在会话开始时添加简报,并在压缩前添加检查点,捕获功能可选择开启。更改后的笔记会被嵌入以供搜索,默认使用本地的 fastembed 或通过兼容 OpenAI 的 API。它拥有针对 Claude Code、Codex 和 Cursor 的设置指南,云同步是可选的,并且它是此列表中唯一的 AGPL-3.0 工具。
The official MCP memory server: The reference server in modelcontextprotocol/servers is “a basic implementation of persistent memory using a local knowledge graph”, kept in one JSONL file. The model calls tools like create_entities and add_observations, and you shape what it saves through the prompt. Its README covers Claude Desktop and VS Code.
官方 MCP 记忆服务器:modelcontextprotocol/servers 中的参考服务器是“使用本地知识图谱实现持久化记忆的基础实现”,保存在一个 JSONL 文件中。模型调用 create_entities 和 add_observations 等工具,您可以通过提示词来塑造它保存的内容。其 README 涵盖了 Claude Desktop 和 VS Code。
hippo (the one I build) keeps one SQLite store per repo, plus a global one in ~/.hippo/, and writes markdown copies of its memories so you can grep them, commit them and review a rule in a pull request. There’s no account, and storing a memory makes no model call on the default path. Some optional features do call a model, such as the fact extraction hippo sleep runs when ANTHROPIC_API_KEY is set, which you can turn off. hippo init adds its instructions to the CLAUDE.md or AGENTS.md you already have. Claude Code gets 9 hooks, so your pinned rules load at session start, each prompt gets up to 5 memories that share its words, your task is saved before compaction and failed tool calls get stored. Codex gets two hooks that it runs once you trust them in /hooks, and session capture there is opt-in. Cursor reads the AGENTS.md block and gets 13 memory tools once you add hippo mc.
hippo(我开发的工具)为每个仓库保留一个 SQLite 存储,并在 ~/.hippo/ 中保留一个全局存储,并将记忆以 Markdown 副本形式写入,以便您可以对其进行 grep 搜索、提交,并在拉取请求中审查规则。它没有账户,在默认路径下存储记忆不会调用模型。一些可选功能确实会调用模型,例如当设置了 ANTHROPIC_API_KEY 时运行的事实提取 hippo sleep,您可以将其关闭。hippo init 会将其指令添加到您现有的 CLAUDE.md 或 AGENTS.md 中。Claude Code 获得 9 个钩子,因此您的固定规则会在会话开始时加载,每个提示词最多可获得 5 条共享其词汇的记忆,您的任务会在压缩前保存,失败的工具调用也会被存储。Codex 获得两个钩子,一旦您在 /hooks 中信任它们,它们就会运行,且那里的会话捕获是可选的。Cursor 读取 AGENTS.md 块,并在您添加 hippo mc 后获得 13 个记忆工具。