claude-mem: memory across sessions for coding agents
Added Copyable prompt below
Published Last verified Released
Our verdict
Worth installing if you keep re-explaining your project to Claude Code, Codex or OpenCode at the start of every session. claude-mem hooks into the session lifecycle, has a model summarise each tool call into an observation, stores them locally in SQLite with Chroma search, and loads a short context index when the next session starts. Search is layered (a compact index first, full details only for the IDs you pick), which the maintainer says cuts tokens about 10x versus dumping history. It is the most-starred project of its kind (about 106,700 GitHub stars on 2026-10-31, gaining roughly 1,600 a day and #1 on GitHub Trending that day), but stars are not a quality signal. Choose the memory provider deliberately: the installer pre-selects CMEM Pro, a hosted service that runs the summarising on cmem.ai, with a 30-day free trial and a subscription after.
- Who it's for
- Developers who run long projects in Claude Code, Codex, OpenCode, Gemini or OpenClaw and lose context between sessions
- Leverage
- New sessions start with what past sessions learned, so you stop re-pasting background, decisions and dead ends
- Effort
- Low
- Date added
What it does
claude-mem (thedotmack/claude-mem, Apache-2.0, npm claude-mem, first released 2025-08-31) is a persistent memory plugin for coding agents. Lifecycle hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd) capture what the agent does; a background worker has a model compress each step into an observation and stores it in ~/.claude-mem (SQLite plus a Chroma vector index). At session start it injects relevant context, and four MCP search tools (search, timeline, get_observations and related) let the agent pull more on demand. It installs for Claude Code, Codex, OpenCode, Gemini, Copilot, T3 Code, Antigravity CLI, Pi, OMP and OpenClaw, needs Node.js 20+, and auto-installs Bun and uv. Wrap anything in <private> tags to keep it out of storage. Memory providers: CMEM Pro (hosted on cmem.ai, pre-selected, 30-day free trial, then paid or fallback to your Anthropic plan), your own OpenRouter or Gemini key, your Anthropic plan (--provider claude), or the already-logged-in agent over local loopback (--provider host). Risks: the summarising costs model tokens on whichever provider you pick; the hosted option sends observations to cmem.ai; it adds hooks to every project and runs a background service; v15.7.0 (30 Oct 2026) fixed a bug where its My Work refresh could fall through to hidden Codex runs on the owner's ChatGPT account; and npm install -g claude-mem installs only the SDK, not the plugin.
How builders use it
- Decide where summarising runs before you install: --provider claude keeps it on your Anthropic plan and skips the cmem.ai sign-in; the default CMEM Pro sends observations to cmem.ai.
- Install with npx claude-mem install (add --ide opencode, --ide t3code and so on for other agents), or inside Claude Code with /plugin marketplace add thedotmack/claude-mem then /plugin install claude-mem.
- Restart the agent, work normally, and wrap secrets or client data in <private> tags so they are never stored.
- In a later session, ask the agent to search memory for past decisions or failed approaches; run npx claude-mem doctor if hooks don't fire.
What to expect
Each new session opens with a short index of what earlier sessions did and decided, searchable on demand, instead of a blank context you refill by hand.
Copy this: Install with memory on your own plan
# Official source: github.com/thedotmack/claude-mem (Apache-2.0)
# Needs Node.js 20+; Bun and uv are installed if missing.
# Claude Code, summarising on your Anthropic plan (skips cmem.ai sign-in)
npx claude-mem install --provider claude
# Other agents
npx claude-mem install --ide opencode
npx claude-mem install --ide t3code
# Or from inside Claude Code
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
# Check hooks and the worker
npx claude-mem doctor
# Keep sensitive text out of memory
<private>API keys, client names, anything you never want stored</private>Related discoveries
See the newest picks →- ToolVibe-Coding & Prompt-to-App
Modern Web Guidance: stop agents writing legacy web code
An open-source agent skill and CLI (Apache-2.0) from the Chrome team, now backed by Edge, Firefox and MDN, that feeds your coding agent short, expert-reviewed guides on modern HTML, CSS and browser APIs right before it writes front-end code, and scans an existing codebase for legacy patterns worth replacing.
NewEffort: LowPrompt#Plugin / extension#Open source
- ToolCoding & Shipping Agents
goose
An open-source agent with a desktop app, CLI and API that runs locally and works with 15+ model providers.
Effort: Low#Local / BYO model#MCP
- ToolCoding & Shipping Agents
ai-memory: one shared memory for every coding agent
A self-hosted memory server that lets Claude Code, Codex, Cursor and 20+ other coding agents share one project memory and hand work to each other.
Effort: MediumPrompt#MCP#Open source
- ToolCoding & Shipping Agents
DeepSeek Harness: an open agent harness built from plugins
DeepSeek's open-source agent harness: a local web UI and CLI where the model, tools, sandbox, UI and even the agent loop are swappable plugins.
Effort: MediumPrompt#Plugin / extension#Open source
Get the best new A.I. picks in your inbox
The best new agent workflows and tools we’ve vetted, with a clear verdict on each. Short, occasional, useful.