One of the quiet limits of Claude Code is that every session begins with no memory of prior conversations. Whatever the agent learned about your codebase yesterday, the conventions, the names of your custom hooks, the bug you spent forty minutes hunting, is gone tomorrow. Claude-Mem fixes this by intercepting messages, compressing them into a structured memory store, and replaying that compressed context at session start.
It is the kind of mod that sounds like a nice-to-have until you install it. After a week, going back to a stock Claude Code session feels like talking to a colleague who has just had a head injury, where everything has to be re-explained every morning.
§01What it actually does
The mod sits behind Claude Code's lifecycle hooks and observes the conversation as it builds. Past sessions are summarized into a memory file, not a transcript but a digest the model can reload cheaply. At session start, only the memory entries relevant to the current working directory get reinjected, which keeps the context budget under control.
The claimed gains, on the project's own benchmarks, are up to 95% fewer tokens on returning sessions and roughly twenty times more tool calls before context limits start to bite. Real-world numbers vary with how much prior conversation actually exists, but the direction holds: the longer you have been working in a codebase, the more the mod earns.
§02When it earns its keep
Claude-Mem pays off most when agentic work spans more than a single sitting. Long-running projects you return to over weeks, where the memory remembers the conventions the agent has already been taught. Codebases with non-obvious patterns, like bespoke hooks, custom DSLs, or internal libraries with quirky names, where re-explaining the same context eats turn budget. Multi-session agentic workflows where you are iterating on the same problem across days rather than minutes.
The mod is less useful for one-shot tasks, throwaway scripts, and fresh project starts. There is no prior context to compress, so the overhead is pure cost without the recall benefit.
§03Setup
# install globally
npm install -g claude-mem
# initialize in your project
cd ~/Code/your-project
claude-mem init
# from now on, claude code sessions in this
# directory automatically read & write memory.
Memory files live next to your project in .claude-mem/. Treat them like build artifacts: gitignore by default, back up if losing them would actually hurt.
◆ pull quote
“Memory is a build artifact, not a source of truth. If your project's intent lives in a compressed memory file and nowhere else, you have a problem the mod cannot fix.”
§04Caveats
- Compressed is not the same as recall. Memory is a digest. Do not expect it to surface a one-line decision you made in passing six weeks ago. Important decisions still belong in
CLAUDE.mdor a real doc. - License is AGPL 3.0. Fine to use; read the license carefully before forking or productizing.
- Community-built. Quality is good, maintenance is volunteer. There is no SLA, and the API is pre-1.0 territory.
- Privacy is local-only by default. Memory stays on your disk, with no cloud sync. Good for privacy, less convenient when you want it on multiple machines without setting up sync yourself.
§05The bigger pattern
Memory mods are the canary for what is coming. Agents that hold state across sessions are the obvious next step in the product, and the community will keep iterating on this faster than the official roadmap can. Install Claude-Mem as a baseline now; expect the pattern to be absorbed into Claude Code itself eventually.