Claude-mem: Give Claude Code the Memory It's Missing

You open a new Claude Code session. Five minutes in, you realize it has no idea what you built yesterday. You’re explaining your authentication system all over again, re-describing last week’s architecture decisions, watching it suggest exactly the refactor you already told it was a bad idea. Again.

This is the fundamental problem with Claude Code as a standalone tool: each session starts from zero. For a quick script or one-off task, it doesn’t matter. But for anyone working on a real system for days or weeks, that blank slate is a productivity killer.

claude-mem solves this. And the community agrees — it just crossed 51,600 stars on GitHub trending.


What claude-mem does, concretely

Created by Alex Newman (@thedotmack), claude-mem is a Claude Code plugin that turns your sessions into a persistent, searchable memory system. It watches everything Claude does, intelligently compresses it, and injects relevant context back into future sessions — automatically.

The core idea: every time Claude edits a file, runs a command, or makes an architecture decision, claude-mem captures that as an observation — compressed to around 500 tokens using Claude Haiku running asynchronously on a background worker. Those observations are stored locally in SQLite at ~/.claude-mem/claude-mem.db. The next time you open a session in the same project, relevant observations appear automatically.

No manual notes. No maintaining CLAUDE.md. No context you have to remember to paste.


The architecture: five hooks

claude-mem hooks into the Claude Code lifecycle at five points:

SessionStart        → Loads relevant context from previous sessions
UserPromptSubmit    → Optionally augments the prompt with history
PostToolUse         → Captures observation after each tool action
Summary             → Generates session summary
SessionEnd          → Compresses and persists final state

The heavy lifting happens in a background worker service running on port 37777. This matters: compression is asynchronous, so it doesn’t block your session. You work normally; the memory pipeline runs in parallel.

The default model for compression is claude-haiku-4-5 — fast and cheap, without burning your main context budget on bookkeeping.


Installation: two commands

# In a Claude Code session:
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem

Restart Claude Code. Done. Context from previous sessions will start appearing automatically.

One important note: there’s also an npm package, but npm install -g claude-mem only installs the library — it does not register the hooks or start the worker service. Always use the plugin commands above.


What you get

Mem-search skill: Query your project history directly in chat. Ask “what did we decide about the database schema?” or “have we worked on the payment flow before?” and get synthesized answers from past observations instead of raw logs.

Web viewer: Head to http://localhost:37777 for a real-time memory stream. Every observation listed, searchable, with before/after context and visual priority indicators (:red_circle: critical decisions, :blue_circle: informational, :brown_circle: architectural).

File-read gating: When claude-mem has previous observations about a file, it blocks redundant reads and injects the observation history instead. Fewer tokens wasted re-reading files Claude already understands.

Privacy control: Wrap any content in <private> tags and claude-mem won’t store it.

Cross-machine sync: claude-mem-sync lets you push/pull observations between machines via SSH. The team tested syncing over 3,400 observations between two servers — and a fresh session on the remote machine used that transferred memory to deliver a real PR with new features.


Honest caveats

Two things worth knowing before you install:

Latency. Observation generation adds 60–90 seconds per tool use when running in background mode. In most sessions you won’t notice it because it’s asynchronous — but on slow hardware or with a busy worker, it can show up.

Moves fast. The changelog shows weekly releases with breaking changes and bug fixes. v12.0.1 fixed MCP tools reliability issues that slipped into v12.0.0. It’s active, healthy development, but expect to update it often. Check the releases page before reporting issues.

AGPL-3.0 license. Free to use, but if you build something on top of it, AGPL terms apply. Worth reading if you use it in a commercial context.


The bigger picture

The creators of claude-mem call their approach RAD — Retrieval Augmented Development. The analogy: RAG standardized how agents retrieve external knowledge; RAD wants to standardize how agents retrieve their own working memory. Whether that framing catches on remains to be seen, but the problem it solves is real and under-addressed.

The 51K stars aren’t hype. They’re developers tired of re-explaining their architecture every morning.


Install it today

/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem

GitHub: GitHub - thedotmack/claude-mem: A Claude Code plugin that automatically captures everything Claude does during your coding sessions, compresses it with AI (using Claude's agent-sdk), and injects relevant context back into future sessions. · GitHub
Docs: https://docs.claude-mem.ai


How many times have you found yourself re-explaining something to Claude Code that you already told it last week? Have you tried claude-mem or another solution for the cross-session memory problem? Tell us below :backhand_index_pointing_down: