Cross-session persistent memory for coding agents like Claude Code: Uses lifecycle hooks to automatically log tool calls, generate semantic summaries, and store them in local SQLite and Chroma. New sessions automatically include relevant context, and MCP tools can be used for on-demand retrieval.
Stars 104811 (+336 / 24h)
Reasoning
- Retrieval is divided into three layers:
searchfirst retrieves a concise index with IDs,timelineshows what happened before and after, andget_observationsretrieves only the filtered complete records. The author claims this saves approximately 10 times the tokens. - In addition to Claude Code, it supports OpenCode, T3 Code, Antigravity CLI, Pi, DeepSeek Harness, Grok Bot, and the OpenClaw gateway. Install using
npx claude-mem install --ide <name>. CLAUDE_MEM_MODEcan set the working mode and memory language (e.g.,code--zh); content wrapped in<private>tags is not stored.
Usage
- Run
npx claude-mem install; or in Claude Code, use/plugin marketplace add thedotmack/claude-mem, then/plugin install claude-mem, and restart to apply changes. - Do not use
npm install -g claude-mem, as that only installs the SDK and does not register hooks. Node.js 20+ is required; Bun and uv will be automatically installed if missing.
Risks
- The installer defaults to prompting you to log in via a browser and enable the hosted claude-mem observer (30-day free trial, after which it uses your Anthropic plan unless you subscribe). If you do not want to log in, pass
--provideror setCLAUDE_MEM_ONLINE_OPTIN=false. - When installing for Grok Bot, the hosted CMEM Pro is used by default. Screenshot saving and Cloud Sync are disabled by default; enabling them uploads data to cmem.ai. The repository has existed for 2025 years, and the license is Apache-2.0.