← 回總覽

分享 2 个让 Codex 和 Claude 跨机器共用记忆技巧

📅 2026-08-03 16:57 卡尔的AI沃茨 人工智能 6 分鐘 7053 字 評分: 82
AI编程 Agent记忆 Claude Codex Mem0
📌 一句话摘要 文章介绍了使用 claude-mem 捕获本地对话记忆并通过 Mem0 实现跨机器、跨 Agent(Claude、Codex)共享的具体步骤与设计思路。 📝 详细摘要 作者分享了在多台 Mac 设备上让 Codex 和 Claude 共享记忆的实践方案:使用开源项目 claude-mem 通过 hook 捕获关键观察(observation),仅将决策、重要发现、已验证的 Bug 修复等信息上传至同一个 Mem0 账户;ClaudeCode 和 Codex 均可通过 Mem0 MCP 检索这些共享记忆,从而在不同机器上快速了解项目背景而无需重复说明。文章给出了详细的七步操作

84

The article introduces the specific steps and design ideas for using claude-mem to capture local conversation memory and enable cross-machine, cross-agent (Claude, Codex) sharing via Mem0. ![Image 1: 卡尔的AI沃茨卡尔的AI沃茨](https://www.bestblogs.dev/articles?sourceid=974215 "View More From This Source")

Yesterday 1167 words (about 5 min) View Source →

Sign in to highlight text and take notes as you read. Sign in now

刚买了第三台mac mini,是时候整理一下跨多台机器跨codex、claude code等Agent的记忆管理方案了。全部塞Agent.md的话上下文包爆炸的,你去X上搜会看到8月份Agent知识管理又多了很多词,分层记忆,时序图谱,Dreaming,CMEM,Mem0,Graphiti。

都安装下来发现重叠率太高,太难稳定在三台机器生效了。我烧了一周的codex额度做了个新方案,claude-mem负责本地记忆捕获,Mem0 负责跨设备共享。

claude-mem这个开源项目可以通过hook自动获取当前对话关键记忆,还可以筛选后再上传到远程的mem0,附上项目id,这样无论我是在MacBook上用Claude,还是换到Mac mini上打开Codex,Agent都会查询到当前项目的共享记忆,知道这个项目是啥,之前为啥这样设计,不用从头解释。

🔗 github. com/thedotmack/claude-mem

🔗 mem0. ai

第一次给Agent做知识管理的话,就把这提示语丢给codex,

搭建一套claude-mem本地捕获+Mem0跨机器跨Agent共享的记忆系统。

目标:

  • 每台机器分别使用claude-mem记录本地会话。不复制或同步claude-mem.db。
  • 只把架构决策,稳定偏好,重要发现和已验证的Bug修复上传到同一个Mem0账户。
  • ClaudeCode和Codex都能通过Mem0MCP 检索这些共享记忆。
  • Git同步代码,handoff同步当前进度,Mem0负责保存为什么和怎么做。
按以下步骤执行:
  • 审计本机的ClaudeCode,Codex,claude-mem,Mem0 MCP,Hook和数据库状态。
  • 安装或修复claude-mem,并验证新会话真的能生成observation。
  • 为ClaudeCode和Codex配置Mem0 MCP。
  • 确定一个所有机器共用的稳定user_id。
  • 建立claude-mem→Mem0的增量同步:
  • 只同步decision、bugfix、discovery;排除临时进度、原始日志、未确认计划和敏感信息;
  • 每条记忆带project、source_device、obs_id和唯一来源键;使用独立游标、文件锁、失败重试、dry-run和脱敏日志;
  • 默认从当前最新observation开始,未经确认不得回填历史数据。
  • 检索规则预设
优先按user_id+metadata.project搜索,使用 top_k=5、threshold=0.4、rerank=true;项目找不到时才回退一次到用户级搜索。
  • 完成至少一次本地、跨Agent和跨机器盲测。

其实7月底,claude-mem还发布了cmem远程服务,比MEM0更原生支持跨设备同步。但我是真怕啊,同步范围会包括完整提示语的,也就是还没公开的项目信息或者临时贴进对话的材料都会同步到云端,

想来想去还是我这个好。

Key Quotes

> The claude-mem open-source project can automatically capture key conversation memories via hooks, and after filtering, upload them to remote Mem0 with the project ID attached; thus, whether I'm using Claude on my MacBook or switching to Codex on my Mac mini, the agent can query the shared memory for the current project, knowing what the project is and why it was designed that way, without needing to start from scratch.

> Only upload architectural decisions, stable preferences, important findings, and verified bug fixes to the same Mem0 account.

Tags

AI Coding

Agent Memory

Claude

Codex

Mem0

Related Articles

* Open-Source "Bole Skill": Let You and Your Agent Evolve into AI Hotspot Experts! * 140. A 4-Hour Interview with Yao Shunyu: Let Me Be a Little Crazy! Training Models at Anthropic and Gemini, Tech Predictions, and the End of Heroism * Rethinking Development Infrastructure: When Agents Become First-Class Citizens * Xiaomi's Robot Brain Trained on 10 万小时 of Data, I Put It to the Test * Harness Engineering: How I Spent a Week Boosting AI Coding Rate to 90% in an Enterprise App * GLM-5.2 Released and Open-Sourced: Focused on Coding and Long-Horizon Tasks * Hands-on Test of ego lite: It Boosted My Codex Browser Automation by 2.5x! * Hands-on Testing of GPT5.6: Sharing Three Super-Useful Prompts and How to Divide Labor with Fable5 * After Connecting a Domestic Model API to Codex, Can It Still Run These 10 Core Features? * AI R&D Automation: Wiki Knowledge Base + Skill Pack

查看原文 → 發佈: 2026-08-03 16:57:00 收錄: 2026-08-04 04:00:07

🤖 問 AI

針對這篇文章提問,AI 會根據文章內容回答。按 Ctrl+Enter 送出。