Best for
- Developers working on long-running projects with Claude Code (or other supported agents) who want memory to persist across sessions
- Teams that want automatic summarization of agent tool activity instead of manual note-taking
claude-mem is a well-documented, open-source memory compression system built primarily for Claude Code. It combines hook-based capture, AI summarization, and a 3-layer MCP retrieval workflow (search/timeline/get_observations) with local SQLite storage and optional cloud sync. Users should be aware of its local HTTP worker service, default full-capture behavior, and an unrelated third-party token associated with the project.
claude-mem is an open-source (Apache-2.0) memory compression system built primarily for Claude Code. It uses 5 lifecycle hooks to automatically capture an agent's tool-use activity during a session, compresses it into semantic summaries with AI, stores it in a local SQLite database, and injects relevant context back into future sessions. A local Bun-managed worker service exposes an HTTP API and web viewer, and a Chroma vector database provides hybrid semantic + keyword search for retrieval. Beyond Claude Code, the project ships install paths for OpenCode and the OpenClaw gateway, and claims compatibility with Codex, Gemini, Hermes, and Copilot, though installation specifics for those clients are not documented.
Run npx claude-mem install (use npx claude-mem install --ide opencode for OpenCode, or follow the Antigravity CLI setup guide for Antigravity). Alternatively, install from inside Claude Code with /plugin marketplace add thedotmack/claude-mem followed by /plugin install claude-mem. Restart Claude Code afterward — context from prior sessions then appears automatically in new sessions. Note: npm install -g claude-mem only installs the SDK/library and does NOT register plugin hooks or set up the worker service; the maintainers explicitly recommend the install methods above instead. OpenClaw gateway users can run curl -fsSL https://install.cmem.ai/openclaw.sh | bash for a one-command setup.