Give Claude Code a memory in two commands: claude-mem
The short version
Claude Code starts every session from scratch: close it on Monday and on Tuesday it has to be told about your project again. Alex Newman (GitHub @thedotmack) built claude-mem to fix that. It works like a note-taker sitting next to Claude: while you work it writes down what changed, when you close the session it boils that into short notes saved on your computer, and next session it hands the useful ones back so Claude already knows where you left off.
| What | The number |
|---|---|
| GitHub stars | 102,278 |
| Forks | 9,012 |
| First public commit | 6 September 2025 |
| Latest version | 15.0.1 (20 October 2026) |
| Price | Free, open source (Apache-2.0). An optional hosted service is paid after a 30-day trial. |
Source: the claude-mem GitHub repository (README and releases), checked 23 Oct 2026.
Why it matters: "Claude forgot what we did yesterday" is the first wall most people hit in their first weeks of Claude Code. You can write a CLAUDE.md file by hand, but claude-mem does it for you: it watches, takes the notes and brings them back.
Your links
| What | Link |
|---|---|
| The source and README | github.com/thedotmack/claude-mem |
| The docs | docs.claude-mem.ai |
| Node.js (you need version 20 or newer) | nodejs.org |
The setup
| Step | What you do | Time |
|---|---|---|
| 1. Check Node.js | Run node -v in Terminal. You need 20 or newer; if it's missing, install it from nodejs.org and restart your terminal. Also run bun -v: claude-mem needs Bun. Without it the plugin installs but memory stays off (its own message says "memory hooks are not active: Bun was not found"). Install Bun from bun.sh. |
1 min |
| 2. The two commands | Type them in the Claude Code prompt (below), then restart Claude Code. | 2 min |
| 3. Ask it to check its notes | From the next session, Claude sees a list of its notes. Start with "check your notes from last time, then …" so it actually opens them (see the habit below). | 0 min |
Copy these commands
Inside Claude Code (the two commands)
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
Then restart Claude Code.
Or one line in Terminal
npx claude-mem install
Don't use npm install -g claude-mem: the README says that installs the library only, without the hooks or the background worker.
Skip the 30-day hosted trial
The one-line installer asks you to sign in by email and starts a 30-day free trial of the hosted "claude-mem observer". The README's exact words: "Prefer to skip the sign-in? Pass an explicit --provider flag, set CLAUDE_MEM_ONLINE_OPTIN=false, or run in CI/non-interactive shells — the installer completes without any account interaction." For example:
CLAUDE_MEM_ONLINE_OPTIN=false npx claude-mem install
The habit that makes it work
claude-mem saves the notes, but Claude doesn't always open them on its own. In our own runs (23 Oct 2026, claude-mem 15.0.1), a brand colour mentioned in one session was saved in its notes, yet in the next session Claude asked for it again in 3 of 3 runs. When the next session started with "check your notes from last time, then make the button our brand colour", it used the right colour in 2 of 3 runs. So start a new session like this:
check your notes from last time, then …
Keep secrets out
Anything you wrap in <private> … </private> tags is left out of storage. Use it for keys, passwords and anything personal you paste into a prompt.
See what it remembered
claude-mem runs a small local worker. Open the worker URL it prints on startup and go to /viewer to browse memory, sessions and settings. Settings also live in ~/.claude-mem/settings.json.
Turning it off
The README has no uninstall section. If you installed with /plugin, type /plugin in Claude Code to open the plugin manager, where installed plugins can be disabled or removed.
The catch
- The installer nudges you to sign in. The trial runs memory off your plan; when it ends, memory "automatically falls back to your Anthropic plan unless you subscribe". Skip it with the option above.
- Note-taking uses your Claude plan. It uses a model to write the summaries, so it eats into your usage (unless you pick the hosted observer or your own OpenRouter or Gemini key).
- It records what you do. Secrets can end up in memory unless you wrap them in
<private>tags. - It moves fast. Version 15 shipped three days before this guide. If something breaks,
npx claude-mem doctorchecks the install. - You may not need it yet. Claude Code's own CLAUDE.md file is free and may be enough for a small project.
If you are building with Claude Code
What this repo does that you can copy:
- Lifecycle hooks, one command each. It hooks SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop and SessionEnd; each hook runs
claude-mem hook claude-code <event>. - Local first. Notes go in a local SQLite database, served by a worker with an HTTP API, a web viewer and search.
- Search in three small steps:
searchfor an index,timelinefor context,get_observationsfor full details by ID, so Claude pulls in only the notes it needs. - One setting for mode and language.
CLAUDE_MEM_MODEswitches the workflow mode and the language the notes are written in.
Run this on your codebase
Before I close this session, write a short "where we left off" section into CLAUDE.md:
1. What we changed today (files and why), in 5 bullets or fewer.
2. Decisions we made and the reason for each.
3. Bugs we fixed and how, so they don't come back.
4. The next step for tomorrow.
Replace the old section instead of adding a new one. Leave out keys, passwords and anything personal.