vnhax
thedotmack / claude-mem
View on GitHub ↗

Independent review by VNHAX. Not affiliated with or endorsed by the project's authors.

🔥 1,527 STARS IN ONE DAY (2 NOV 2026)PERSISTENT AGENT MEMORY4 MCP SEARCH TOOLSSQLITE + CHROMAAPACHE-2.0 LICENSE
Claude-Mem architecture: lifecycle hooks capture agent work into SQLite and Chroma, and MCP search tools bring it back into new sessions
thedotmack / claude-mem — persistent context across sessions

Claude-Mem: Give Claude Code (and Other Agents) Memory That Survives Sessions

Stop re-explaining your project every time you open a new session.
Claude-Mem captures what your agent does, compresses it into summaries, and injects the relevant parts into future sessions. The agent can also search that history on its own.

6 hooks
Lifecycle events captured
SessionStart through SessionEnd
~10×
Token savings (project claim)
Search an index first, fetch details only for chosen IDs
10+
Agent harnesses supported
Claude Code, Codex, OpenCode, T3 Code, Antigravity…
HOW IT WORKS

The 3-Layer Memory Search

Claude-Mem exposes four MCP tools. The README recommends this order to keep token use low:

search

Get a compact index of matching memories with IDs, about 50–100 tokens per result. Filter by type, date or project.

timeline

See what was happening around an interesting result, in chronological order.

get_observations

Fetch the full details only for the IDs you picked, about 500–1,000 tokens each. Batch several IDs per call.

Core Components

ComponentWhat It Does
Lifecycle hooksSessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop and SessionEnd, each one command run by a small launcher on PATH.
Worker serviceA local HTTP API with a web viewer and search endpoints, managed by Bun.
SQLite databaseStores sessions, observations and summaries, with FTS5 full-text search.
Chroma vector DBAdds semantic search next to keyword search (hybrid retrieval).
mem-search skillLets you ask questions of your project history in natural language.
Web viewer & My WorkBrowse memory, sessions and settings; track live requests and a review queue locally.

Install for Your Agent

Commands from the README. Restart the agent afterwards.

AgentCommand
Claude Codenpx claude-mem install (or /plugin marketplace add thedotmack/claude-mem, then /plugin install claude-mem)
OpenCodenpx claude-mem install --ide opencode (OpenCode 1.3.4 or later)
T3 Codenpx claude-mem install --ide t3code
Antigravity CLInpx claude-mem install --ide antigravity
Pi / DeepSeek Harnessnpx claude-mem install --ide pi · npx claude-mem install --ide dsh --dsh-profile tui
OpenClaw gatewaycurl -fsSL https://install.cmem.ai/openclaw.sh | bash
Setup

Install (Claude Code)

npx claude-mem install

The installer sets up hooks and the worker, then offers a browser sign-in for the hosted memory service. To skip it, pass an explicit --provider flag or set CLAUDE_MEM_ONLINE_OPTIN=false.

More Commands:
From inside Claude Code:
/plugin marketplace add thedotmack/claude-mem
Then:
/plugin install claude-mem
Not this (library only, no hooks):
npm install -g claude-mem
Requirements:
Node.js 20+, Claude Code with plugin support (Bun & uv auto-installed)

Why Progressive Disclosure Saves Tokens

Loading every past observation into context would be expensive and noisy. Claude-Mem gives the agent a cheap index first, lets it look around a promising result, and only then pulls full details for the few memories that matter. The README puts the saving at about 10x compared with fetching everything up front.

Choosing a Memory Provider

After install you choose who generates the summaries: the hosted claude-mem observer (30-day free trial, then it falls back to your Anthropic plan unless you subscribe), your own OpenRouter or Gemini key, or your Anthropic plan. Pick based on cost and on where you are comfortable sending session content.

HONEST NOTES

Privacy & Cost Checklist

Memory tools see a lot of your work. Before you install:

  • Hosted by default: The default sign-in path uses the hosted memory service. Choose a local or bring-your-own-key provider if your code must stay in-house.
  • Mark secrets: Wrap sensitive content in <private> tags so it is not stored.
  • Opt-in extras: Screenshots are off by default; Cloud Sync uploads to cmem.ai only when you enable it.
  • Summaries cost tokens: Generating summaries uses a model. After the free trial, that comes out of your plan or your own API key.
🔒 Privacy Controls

<private> tags, opt-in screenshots and Cloud Sync, and a choice of memory provider.

⚖️ License

Apache-2.0 (per the GitHub repository metadata).

📘 Docs

docs.claude-mem.ai: installation, search tools, configuration, architecture and troubleshooting.

Frequently Asked Questions

How do I install Claude-Mem for Claude Code?

Run npx claude-mem install, or inside Claude Code run /plugin marketplace add thedotmack/claude-mem and then /plugin install claude-mem. The README warns that npm install -g claude-mem installs only the library and does not set up the hooks.

Does Claude-Mem send my code to a server?

It depends on the provider you choose. The installer offers a hosted claude-mem observer with a 30-day free trial, your own OpenRouter or Gemini key, or your Anthropic plan, and you can skip the sign-in with an explicit --provider flag. Cloud Sync and screenshot capture are optional. Read the configuration docs before you use it on private code.

How do I keep secrets out of Claude-Mem?

Wrap sensitive content in <private> tags and it is excluded from storage. Screenshot capture is off by default.

What does Claude-Mem need to run?

Node.js 20 or later and a current Claude Code with plugin support. Bun and uv are installed automatically if missing, and SQLite is bundled.