Rank #03 · Daily · AI
claude-mem: Persistent Cross-Session Memory for Coding Agents
Productize long-term agent memory—capture, compress, and reinject—so sessions stop starting from zero across major agent hosts.
What it does
claude-mem (thedotmack) is a persistent memory compression system aimed first at Claude Code and expanded to many harnesses. It automatically captures tool-usage observations during sessions, generates semantic summaries, and makes them available to future sessions so agents keep project continuity after reconnects.
Core loop from the public materials:
- Capture — lifecycle hooks (SessionStart, UserPromptSubmit, Pre/PostToolUse, Stop, SessionEnd) observe what the agent does via
claude-mem hook …launchers the installer places on PATH. - Compress — observations and summaries land in local storage (SQLite + hybrid search with Chroma vector DB); optional cloud sync to cmem.ai.
- Reinject — relevant context is primed into new sessions; MCP search tools follow progressive disclosure:
search(compact index) →timeline→get_observations(full detail only for filtered IDs).
Install is typically npx claude-mem install (or IDE-specific flags such as --ide opencode, --ide t3code, --ide grok-bot, --ide antigravity, Pi/DeepSeek harness flags, OpenClaw gateway script, or Claude Code marketplace /plugin install). The README stresses that npm install -g claude-mem installs the SDK only—hooks and worker setup require the installer//plugin path. Node ≥20; Bun and uv are auto-installed if missing for worker/vector paths.
Documented extras include a local “My Work” / viewer UI at the worker URL, optional TeamBrain shared workspace, privacy tags (<private>), opt-in screenshots under ~/.claude-mem/media-v1/, context configuration, and mode/language settings (e.g. code--zh). Installer may offer a hosted observer trial / sign-in flow; you can skip with --provider, CLAUDE_MEM_ONLINE_OPTIN=false, or non-interactive CI. Homepage: claude-mem.ai · docs: docs.claude-mem.ai.
Who it’s for
- Developers living in multi-session coding agents who lose decisions, bugfixes, and project facts between threads.
- Teams standardizing memory across Claude Code, Codex, Copilot, OpenCode, T3 Code, OpenClaw, Grok Bot, and related hosts listed in the repo description.
- Operators who want local-first memory with optional hosted observer / cloud sync, and who can accept the worker stack the installer manages.
Stars / language / license
~110,318 stars · TypeScript · Apache-2.0
Data verified: 2026-11-02 ~22:16 Asia/Shanghai (GitHub API get_repository + README get_file_contents)
Trending note (selection ~22:14 Asia/Shanghai): ~+1,799 stars today (live UI); archive earlier same day ~+1,526 when the repo sat near Daily #1
Category tags
AI · agent-memory · RAG · MCP · Claude-Code · long-term-memory · SQLite
How it differs from similar projects
Many agents ship chat history inside one host; claude-mem productizes cross-session, cross-host memory as an installable observer + search layer. Versus generic vector notebooks or mem0-style libraries alone, the Rising pitch is the full capture → compress → reinject pipeline wired into agent lifecycle hooks and MCP search with progressive disclosure (compact index before expensive detail fetches). Versus “paste a giant CONTEXT.md” workflows, it emphasizes automatic observation capture and token-aware retrieval.
Be conservative on marketing claims: treat “up to 100% more usage” / observer trial language in the installer docs as product narrative, not an independent benchmark. License is Apache-2.0 for the open project; hosted CMEM Pro / cloud sync have their own commercial boundary described in project docs (docs/license.md, docs/ip-boundary.md). A third-party CMEM token exists and is “embraced” by the author—unrelated to the software license.
Digging into the memory workflow
A typical progressive-disclosure turn (from project docs):
- Call MCP
searchwith a natural-language query and optional type/date filters → get a compact ID index. - Optionally call
timelinearound an interesting observation. - Call
get_observationsonly for the IDs you still need → full detail (~order-of-magnitude more tokens per hit than the index).
Settings live in ~/.claude-mem/settings.json (model, worker port, data directory, log level, context injection). CLAUDE_MEM_SESSION_START_INCLUDE_ALL_SOURCES controls whether SessionStart context pulls every harness or only the current one. Modes under plugin/modes/ control workflow tone and observation language (code, code--zh, code--ja, …).
Takeaways
- Prefer the installer / plugin path, not a bare global npm SDK install, if you want hooks + worker.
- Use
<private>tags when a prompt or tool output must not enter memory. - Treat hosted observer / Cloud Sync as optional commercial/hosted layers on top of the Apache-2.0 local system—read the project’s license boundary docs before enterprise rollout.
- Session amnesia is the product bug this repo is productizing a fix for; that—not star count—is the OSINT reason it sits at Daily #03.