claude-mem
thedotmack
Persistent memory layer across agent sessions with automatic semantic summaries and token-cost transparency.
What is claude-mem?
A persistent memory layer across agent sessions. An observer agent automatically captures tool use and decisions, generates semantic summaries, and makes them available to future sessions, with visible token costs and <private> tags for sensitive content.
claude-mem in depth
Every coding agent forgets. Close a Claude Code session and the chain of decisions, the reasons you rejected one approach, the file you patched three hours ago, all of it evaporates. The next session starts cold, and you spend the first ten minutes re-explaining your own project. claude-mem, an Apache-2.0 project from thedotmack, is a persistent memory layer that sits underneath the agent and tries to fix exactly this. It runs as a Claude Code plugin and quietly records what the agent does, turns those raw actions into compact summaries, and feeds the relevant ones back when a new session begins. The pitch is continuity: the agent should remember your project the way a colleague would, without you having to paste the same context every morning.
claude-mem works through five lifecycle hooks wired into the agent: SessionStart, UserPromptSubmit, PostToolUse, Stop, and SessionEnd. The PostToolUse hook is the heart of it. After each tool call, it fires a non-blocking HTTP POST to a background worker so the session is not stalled, and that worker, built on Bun and running a local HTTP API and web viewer, uses the Claude Agent SDK to compress the raw output into a structured observation. Observations land in SQLite with full-text search, and a Chroma vector store adds semantic lookup on top. Retrieval is deliberately staged: a three-layer workflow of index, timeline, then full detail, so the agent narrows down before pulling expensive text. The project reports roughly tenfold token savings from this filtering, with visible cost estimates at each layer.
The clear audience is heavy Claude Code users who lose real time to context resets: developers carrying one large codebase across many sessions, or anyone running long, multi-day agent workflows where continuity actually matters. If you frequently ask the agent to recall why a module was structured a certain way, or you want it to pick up where yesterday ended without a manual recap, this is the use case it was built for. The token-cost transparency is genuinely useful here, because persistent memory can quietly inflate your bill, and seeing estimated costs per retrieval layer lets you judge the tradeoff. The privacy-tag feature, where wrapping content in private tags excludes it from storage, matters for anyone whose sessions touch secrets, customer data, or anything they do not want persisted to a local database.
The honest caveats are real. Despite marketing that lists Gemini CLI, Codex, OpenCode, Copilot and more, the project is tuned for Claude Code first, and support for other agents reads more like aspiration than parity. The dependency stack is heavy for what is, conceptually, a memory cache: you need Node 18 or newer, Bun, SQLite, Chroma, and uv, plus a background worker holding a port. That is a lot of moving parts to install and keep healthy on a developer machine, and each is a potential failure point. The version history is the loudest warning: the project sits at 13.x with hundreds of releases, which signals rapid iteration but also a history of churn and breaking changes. Memory quality also depends on the summarizer, so observations can be lossy or miss the detail you later need.
Against the commercial grain, claude-mem is closest in spirit to the memory features baked into hosted agent platforms, but it stays local, open, and inspectable, which is its main argument. If you live in Claude Code, routinely lose context across sessions, and are comfortable running and debugging a Bun plus Chroma plus uv stack, it is worth adopting now and likely to repay the setup cost. If you mostly use other agents, the cross-agent claims are not yet a reason to switch, and the project is too early to lean on there. The same applies if you want a low-maintenance tool: the dependency footprint and the fast-moving 13.x release line mean you are signing up for upkeep. Adopt it as a power-user convenience, not yet as stable infrastructure.
Pros & Cons
Pros
- Apache-2.0, OSI-open
- Installs as a Claude Code plugin in one command
- Privacy tags and token-cost transparency built in
Cons
- Primarily tuned for Claude Code; other agents are more marketing than support
- Heavy dependency stack: Node 18+, Bun, SQLite, Chroma, uv
- Version 13.x suggests a history of breaking changes
License
Apache-2.0 (OSI-open)
When it is interesting
Heavy Claude Code users losing context across sessions.
When it is too early
If you primarily use other agents, or do not want the Bun + Chroma + uv stack.
This repo featured in the 2026-06 edition of the Open-Source AI Radar.
graphify
safishamsi
AI coding skill that turns a folder of code, docs and images into a queryable knowledge graph across 20+ agents.
memU
NevaMind-AI
Memory framework for proactive AI agents - typed memory graph from chats, docs and media.
MemOS
MemTensor
Self-evolving memory OS for LLMs and AI agents with tiered L1-L3 memory.