← Back to directory
C

claude-mem

Community
Persistent cross-session memory for Claude Code and other agents
GitHub source repository ↗
★ 89.7k Stars Category · Dev Tools Very popular
50FMRS · D
Reliability
6/20
Security and permissions
5/20
Maintenance
14/20
Documentation
15/20
Setup experience
10/20

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.

Read the FMRS scoring method →

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.

Tools

search
Full-text search over the memory index, filterable by type, date, and project; returns a compact result index (~50-100 tokens per result) as step one of the 3-layer retrieval workflow.
timeline
Retrieves chronological context around a specific observation or search result to show what was happening at that point.
get_observations
Fetches full observation details for given IDs (batch multiple IDs for efficiency) — the most detailed, highest-token step of the 3-layer workflow.

Setup

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.

Fit and risk

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

Not for

  • Privacy-sensitive workflows where agent activity shouldn't be logged/stored by default without manually excluding content via <private> tags
  • One-off, single-session tasks that don't need cross-session context
  • Environments where installing a background worker service (Bun) and a Python package manager (uv) is not permitted

Required permissions

  • Local file system read/write access for session logs, the SQLite database, and configuration (~/.claude-mem)
  • Ability to run and manage a background worker process (Bun) and a Python package manager (uv)
  • Network access for AI-based summarization/compression calls and optional cloud sync to cmem.ai
  • Access to Claude Code (or other agent) lifecycle hooks and tool-use transcripts in order to capture observations

Risks and side effects

  • Captures and stores all tool-use activity from agent sessions by default; sensitive content must be manually excluded using <private> tags
  • Runs a local HTTP worker service with a web viewer, which exposes stored memory data on the local machine/network
  • Optional cloud sync transmits memory data to a third-party service (cmem.ai)
  • Auto-installs additional runtimes (Bun, uv) when missing, widening the trust/supply-chain surface
  • The project is associated with a third-party cryptocurrency token (CMEM) that is not part of the core software — a separate financial-risk consideration, not evidence of malicious code

Troubleshooting

  1. Restart Claude Code after installation or after changing CLAUDE_MEM_MODE for settings to take effect
  2. Confirm Node.js >=20 and that Bun and uv are installed (they auto-install if missing)
  3. Verify the worker service is running; the web viewer URL is printed at startup
  4. Check ~/.claude-mem/settings.json for AI model, port, and log level configuration
  5. Describe the issue to Claude to trigger the built-in troubleshoot skill for automatic diagnosis
  6. Generate a detailed bug report with `npm run bug-report` from the plugin marketplace directory

Use cases

Automatically restore prior project context when starting a new Claude Code session
Search past coding sessions in natural language to recall earlier decisions or bug fixes
Maintain continuity of knowledge across long-running, multi-session projects

Supported clients

Claude CodeFull support
OpenCodeFull support
OpenClawFull support
CodexPartial support
GeminiPartial support
GitHub CopilotPartial support