Persistent memory for Claude Code: captures tool-use observations via hooks, summarizes them, and injects relevant context into future sessions.
- Stars
- 105K+
- Try it
Install as a Claude Code plugin — see the project docs for the two-command setup
Every coding-agent session starts from zero. You explain the architecture, the agent rediscovers the same gotcha it hit yesterday, and you burn tokens re-teaching it things it already learned. claude-mem attacks that problem directly — and it's become one of the most-starred agent projects on GitHub, passing 105,000 stars according to trending trackers.
How it works
claude-mem is a plugin for Claude Code built around a simple loop: capture → compress → inject.
- Capture. Lifecycle hooks fire at session start, when you submit a prompt, when tools run and at session end. It records observations from tool calls like Read, Write, Edit, Bash, Glob and Grep.
- Compress. A background worker (managed by Bun, on port 37777) uses the Claude Agent SDK to turn raw observations into structured learnings and session summaries.
- Inject. When a new session starts, relevant prior context is fed back in automatically.
Everything is stored locally in SQLite at ~/.claude-mem/claude-mem.db, with FTS5 full-text search.
Notable features
- MCP search tools —
search,timelineandget_observations— designed as a three-layer workflow so the agent can find what it needs without dumping its whole history into context. - Auto-generated CLAUDE.md folder files with activity timelines.
- A web viewer with real-time updates, so you can see what it's remembering.
- Worktree support, 28 languages, 11 context configuration settings, and an experimental "Endless Mode."
Privacy: know what you're storing
claude-mem records what your agent sees — which can include file contents and command output. Two things to know:
- Wrap anything sensitive in
<private>…</private>tags and it's stripped at the hook layer, before reaching the database. - The memory database lives in your home directory. Treat it like any other file that might contain secrets: exclude it from cloud backups you don't control, and don't share it.
Requirements
Node.js 18+ and a Claude Code version with plugin support. Bun and uv are installed automatically if missing. The docs describe a two-command plugin install, a source install, and how to verify it's working.
Our take
Persistent memory is quickly becoming table stakes for agents, and claude-mem's design — local storage, full-text search, explicit opt-out tags, and a viewer that shows you exactly what's remembered — is a sensible model. The main thing to weigh is the extra background process and the volume of data it accumulates. For anyone who uses Claude Code daily on the same codebases, it's worth trying.
Sources
- claude-mem documentation — Introduction mintlify.com
- GitHub — thedotmack/claude-mem github.com
- CoddyKit — GitHub Trending October 2026 coddykit.com