Part ofWhat Is Claude Code? The Complete Guide
In This Article
6 sectionsQuick answer
Learn how to install claude-mem, the community tool that gives Claude Code persistent memory across sessions, plus how it compares to built-in options.
The fastest way to give Claude Code persistent memory is the interactive installer: npx claude-mem install. You can also add it as a Claude Code plugin from the thedotmack marketplace and restart. It is a community tool, not an official Anthropic product.
Install commands, plugin marketplace behaviour and storage details verified 31 July 2026 against Anthropic's Claude Code plugins documentation.
If you use Claude Code every day, you have felt the pain: you close the terminal, come back tomorrow, and Claude has forgotten everything. The architecture you agreed on, the naming conventions you settled, the bug you already ruled out — gone. Every new session starts from zero, and you end up re-explaining your project again and again. That reset is exactly the gap this tool is built to close. We verified this flow hands-on, so where a step is fiddly we have flagged it from experience instead of guesswork.
This guide explains what it is, how to install it correctly, how the tool works under the hood, and how it stacks up against the memory options Claude Code already ships with. Claude Code currently runs on the latest models, including Claude Opus 5 and Claude Sonnet 5, and the tool works the same way across them — the install takes about 60 seconds, and this guide is reviewed regularly so the steps stay accurate. It is written to be honest about one important thing first.
Key takeaway
claude-mem is a community, open-source tool (not an official Anthropic product) that gives Claude Code persistent memory by capturing each session into a local SQLite database and re-injecting it later; install it with the interactive installer in about 60 seconds — a plain npm install -g alone won't wire up the hooks.
Claude-mem is community software, not an official Anthropic tool
It is an open-source project maintained by an independent developer, not something Anthropic builds or supports. Treat it like any developer tool you grant elevated access: useful and popular, but third-party code that reads your session activity.
Let's be clear up front: it is an open-source, community-built project (maintained by the developer "thedotmack"), not something Anthropic makes or supports. It is popular and useful, but it is third-party software that runs on your machine and reads your session activity. Treat it the way you'd treat any developer tool you install with elevated access — more on the security side of that below.
With that framing in place, here is what the tool actually does.
What the tool does
It hooks into Claude Code's lifecycle, summarises each finished session with the Claude Agent SDK, and stores those observations in a local SQLite database. New sessions then load the relevant memories back into context automatically.
The tool captures what your agent does during a session, compresses that record into concise summaries, and injects the relevant pieces back into future sessions automatically. In plain terms: it watches the work, remembers the important parts, and hands them back to Claude next time so you don't have to.
Mechanically, it hooks into Claude Code's lifecycle. When a session ends, it uses AI (the Claude Agent SDK) to summarize what happened — decisions made, files touched, problems solved — and stores those observations in a local SQLite database on your machine. When you start a new session, relevant memories are loaded back into context so Claude picks up roughly where you left off.
A few properties matter here. The storage is local — the memory lives in a database file on your machine, not a cloud service. And the project supports scoping what gets stored: you can wrap sensitive content in <private> tags so API keys, credentials, or personal details are never persisted. Because it works through hooks and Claude Code's plugin system, it fits neatly alongside other tools; if you want to understand that mechanism, our explainer on Claude Code hooks covers how these lifecycle events fire.
How to install claude-mem
Two supported paths: the interactive installer via npx, which detects your coding tools and wires up the hooks, or Claude Code's plugin commands against the thedotmack marketplace followed by a restart. The project README is the source of truth.
There are two supported paths, and the project's official GitHub repository is the source of truth for the exact, current commands. Always prefer its README over any memorized instruction, since tools like this iterate quickly. That said, here is the general shape.
Option 1 — The interactive installer (recommended)
Run the installer with npx:
npx claude-mem install
The interactive installer runs a runtime check, detects the AI coding tools you have installed (Claude Code, and depending on the version, others like Cursor, Codex, or OpenCode), and lets you multi-select which ones to wire up. It handles registering the plugin hooks and starting the background worker for you.
Option 2 — As a Claude Code plugin
If you'd rather do it from inside a session, use Claude Code's plugin commands:
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
Then restart Claude Code so the hooks load. This uses the same plugin marketplace system Anthropic documents for extending Claude Code.
One important gotcha
The project ships on npm, but running a plain npm install -g claude-mem installs the library/SDK only — it does not register the plugin hooks or start the worker service that actually captures memory. In other words, installing the npm package by itself won't make the plugin work. Use the interactive installer shown above, or the /plugin commands, so the hooks get wired up properly. When in doubt, follow the current install steps in the official repo, because the exact package name and flow can change between releases.
Once installed and running, you generally don't have to do anything else: the plugin captures memory in the background, and context from previous sessions starts appearing automatically in new ones.
How it compares to Claude Code's built-in memory options
Four approaches, four trade-offs. A hand-written CLAUDE.md is transparent and version-controlled. Built-in memory needs no setup. An MCP memory server gives you a structured, queryable store. The auto-capture plugin trades vetting effort for zero maintenance.
This is one approach among several. Before you add a third-party tool, it's worth knowing what Claude Code and the wider Claude ecosystem already give you — because sometimes a simpler option is enough.
The main options break down like this:
| Memory approach | What it is | Best for |
|---|---|---|
CLAUDE.md | A plain Markdown file in your repo that Claude reads on every session. You write and maintain it by hand. | Stable project facts: conventions, architecture, commands, "always do X." |
| Claude's built-in memory | Claude's own memory features that recall facts and preferences you've shared across conversations. | Personal preferences and cross-session recall without extra tooling. |
| MCP memory server | A Model Context Protocol server that exposes a memory/knowledge store Claude can read and write via tools. | Structured, queryable memory you control, shareable across tools. |
| Auto-capture plugin | A community plugin that auto-captures, compresses, and re-injects session context via hooks. | Hands-off, automatic recall of what you actually did last session. |
Each has a different trade-off. CLAUDE.md is manual but transparent and version-controlled — you decide exactly what Claude remembers, and it's the first place most teams should invest. Claude's built-in memory works without any setup; our guide to Claude memory explains what it retains and how to manage it. An MCP memory server gives you a structured store that Claude can query through tools — if that's new to you, start with what is Claude Code and the walkthrough on how to add an MCP server to Claude Code, plus our deeper reference on the Claude Code MCP ecosystem.
Where the tool differs is automation: instead of you writing memory by hand or standing up a server, it observes the session and does the capture-and-recall loop for you. That convenience is the whole point — and also the reason to vet it.
Security: what to check before you trust any memory tool
A memory tool sees code, file paths, commands and whatever you discuss. Install only from the official source, read what the local database actually stores, keep secrets out with the <private> tag, and remember that hooks execute code on your machine.
A memory tool sees a lot. To do its job, the tool reads what happens in your session and writes summaries to disk — which can include code, file paths, commands, and whatever context you discuss. That's not a knock on the project; it's inherent to the category. It does mean you should be deliberate:
- Install only from the official source. Use the project's real GitHub repo or its documented installer. Don't grab a random fork or a copycat npm package with a similar name.
- Review what it stores. The database lives locally on your machine; open it or read the docs to understand what's being kept.
- Keep secrets out. Use the project's
<private>tag mechanism (or your own hygiene) so API keys, tokens, and credentials never land in the memory store. - Understand it runs on your machine. Hooks execute code around your sessions. Skim the source or release notes so you know what you're enabling.
None of this is unique to this tool — it's the same due diligence you'd apply to any plugin. If you want to go deeper on running Claude Code well and safely, our roundup of Claude Code tips and tricks is a good companion, and if you organize work across long-running efforts, Claude Projects pairs naturally with persistent memory.
When persistent memory actually helps
It earns its place on long, multi-session projects where the reasoning behind decisions matters — a week-long refactor, an unfamiliar codebase. For a one-off script the overhead is not worth it; a good CLAUDE.md covers most of the value.
Persistent memory shines on long, multi-session projects: a refactor that spans a week, a codebase where the "why" behind decisions matters, or a workflow where you're constantly re-establishing the same context. For a quick one-off script, the overhead isn't worth it — a good CLAUDE.md or even nothing at all is fine.
Maintaining this site in Claude Code every day, we've landed firmly in that second camp so far: a carefully kept CLAUDE.md holding our stable facts — the commands, the architecture split, the conventions — plus Claude's built-in memory has covered the recall we actually miss between sessions. What convinced us was seeing how much of the "Claude forgot everything" pain was really just context we'd never written down anywhere durable; once it lived in CLAUDE.md, the daily reset stopped stinging. We'd reach for an auto-capture tool like this one the day a project's running history outgrows what we're willing to curate by hand, but we haven't hit that wall yet.
The honest takeaway: the tool solves a real problem elegantly, but it's a community tool, so weigh the convenience against the fact that it watches and stores your session. For many developers that trade is clearly worth it. For others, a well-maintained CLAUDE.md plus Claude's built-in memory covers 80% of the value with zero third-party code.
Frequently Asked Questions

Written by
InnovateTechie
Writing about Claude and the Anthropic toolkit — models, Claude Code, pricing, features, and fixes, in clear, practical, hands-on guides tested by daily use.
View all posts →


