claude-mem:讓每個 agent 跨 session 記住你做過的事
claude-mem: Persistent Context Across Sessions for Every Agent
摘要分析
claude-mem(⭐10.1 萬,10/6 單日 +534 星進 trending)解決 Claude Code 開新對話就失憶的問題。它用 SessionStart、PostToolUse 等 hooks 擷取每個操作,交由 AI 壓縮成語意摘要存進 SQLite 與 Chroma 向量庫,下次 session 自動注入相關上下文。搜尋採 search→timeline→get_observations 三步,先索引後細節,README 宣稱省約 10 倍 token。<private> 內容不會被存。安裝只需 npx claude-mem install。
- npx claude-mem install(Node 20+;勿用 npm -g,那只裝 SDK)
- 或 /plugin marketplace add thedotmack/claude-mem → /plugin install claude-mem → 重啟
- hooks 自動擷取、AI 壓縮、SQLite+Chroma 儲存
- 搜尋三步:search → timeline → get_observations,先索引後細節省 token
- 敏感內容用 <private> 包起來就不會存
claude-mem (about 101k stars, updated 2026-10-16; it gained 534 stars in one day on GitHub trending on Oct 6) solves the problem of Claude Code forgetting everything between sessions. Lifecycle hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd) capture every action, an AI step compresses them into semantic summaries stored in SQLite plus a Chroma vector database, and relevant context is injected into future sessions. Its MCP search tools follow a three-step pattern, search for a compact index, timeline for surrounding context, get_observations for full details, which the README claims saves about 10x tokens. Content wrapped in <private> tags is never stored. It supports Claude Code, Codex, Gemini, Copilot, OpenCode and more; install with npx claude-mem install.
- npx claude-mem install (Node 20+)
- Or /plugin marketplace add thedotmack/claude-mem
- Hooks capture, AI compresses, SQLite + Chroma store
- search → timeline → get_observations saves tokens
- <private> tags exclude content
關鍵字:claude-mem持久記憶hooks向量搜尋token 節省
來源原文:https://github.com/thedotmack/claude-mem
本頁為報導內容的摘要與分析,版權屬原媒體所有;請以原文為準。
