AI tool reviews › Tokens and context
What is claude-mem? A memory plugin for Claude Code
claude-mem records what Claude Code does and hands a summary to your next session. How its hooks work, what it costs, and what it keeps on disk.
Every Claude Code session starts with an empty context window, so the agent you worked with yesterday doesn’t remember what you did. If that has bothered you, perhaps you’ve looked for a fix and run into the name claude-mem. When I checked the GitHub API on October 28, 2026, its repository had 103,773 stars, so plenty of people are keeping an eye on it.
claude-mem is a Claude Code plugin made by Alex Newman (thedotmack on GitHub), and its repository first appeared on August 31, 2025. A plugin is a package that adds skills, hooks, and MCP servers to Claude Code in one install. A hook is a command Claude Code runs at a fixed moment, such as when a session starts or right after a tool call. claude-mem uses hooks to watch tool calls, has a separate model write each one up as a short record called an observation, keeps the records in a local database, and hands them to your next session. It’s licensed under Apache-2.0 and changes quickly. Version 15.4.0 came out on October 28, 2026, and it was the 28th version published to npm that month.
What’s inside and when it steps in
Going by the README and the plugin’s files, claude-mem is made of a few parts. Hooks catch the events, and the hooks architecture page explains what each one is for. A worker, a small HTTP server that Bun runs on 127.0.0.1, receives the events and also serves a web viewer. Records pile up in a SQLite database at ~/.claude-mem/claude-mem.db. Search is handled by a mem-search skill and MCP tools (search, timeline, get_observations), and vector search through Chroma is turned on by default as well. Here are the hooks, pulled out of hooks.json with a short script.
Setup sync sh -c '... node scripts/version-check.js'
SessionStart async claude-mem start
SessionStart sync claude-mem hook claude-code context
SessionStart sync node ${CLAUDE_PLUGIN_ROOT}/scripts/ensure-launcher.cjs
UserPromptSubmit sync claude-mem hook claude-code session-init
PostToolUse async claude-mem hook claude-code observation
PostToolUseFailure async claude-mem hook claude-code observation
PreToolUse sync claude-mem hook claude-code file-context
Stop async claude-mem hook claude-code summarize
SubagentStop async claude-mem hook claude-code subagent-stop
SessionEnd async claude-mem hook claude-code session-end
When a session starts, the SessionStart entries start the worker, fetch the context to inject, and make sure the launcher is in place, while Setup runs only for special launches such as claude --init-only. Your prompt is saved by session-init, and after every tool call observation hands that call’s input and output to the worker. The worker then asks an observer model to write the call up as an XML record with a type, a title, facts, and a short narrative. According to the configuration page, that model is claude-haiku-4-5-20251001 by default, and it runs on your Claude plan. In the source, the observer has every tool turned off, and by default it gets one request per tool call plus one summary request each time a turn ends at Stop. And when Claude goes to read a file, file-context adds earlier observations about it, and for a code file of 32 KB or more with a history, it can block the full read.
Some of this rides along in every session. The names and descriptions of the plugin’s 30 skills are visible from the start, about 1,700 tokens by my tiktoken estimate, and a few of them, such as release or slide-deck helpers, have little to do with memory. On top of that comes the text the context hook injects, which Claude Code caps at 10,000 characters, according to the hooks reference. The full mem-search instructions and the details of each observation load only when Claude looks for them.
Two small sessions, with and without it
I didn’t install claude-mem into my own environment. Instead, I loaded a copy of its plugin folder into a single run with --plugin-dir. In that copy I removed the hook that builds a launcher in ~/.local/bin and the Setup hook, and a claude-mem command in my working folder called the plugin’s own launcher instead. I moved the data folder and the hooks’ home folder inside the working folder too, and turned off telemetry and Chroma. The observer took one more detour. Its default path reads the Claude Code login from the macOS keychain, and I don’t hand my login to a tool I’m testing. So I used the documented OpenAI-compatible setting to point it at a small local relay, which ran claude -p with Haiku and no tools for each request. That makes my observer Haiku 5.5 rather than the default Haiku 4.5. I also turned off Claude Code’s auto memory with CLAUDE_CODE_DISABLE_AUTO_MEMORY=1.
The project was a folder with a README and a notes.py holding one function. Here’s what a reader would type. In my runs I added isolation flags, --plugin-dir, and --output-format stream-json --verbose --include-hook-events for the record.
# Session 1: a small task
claude -p "In notes.py, add a function slugify(title) that trims the title, lowercases it, and joins the words with hyphens. Then check it with: python3 -c \"from notes import slugify; print(slugify(' Hello World '))\"" \
--model haiku --allowedTools "Read,Edit,Bash(python3 *)"
# Session 2: a new session in the same folder
claude -p "What did we do in this project last time?" \
--model haiku --allowedTools "Read,Edit,Bash(python3 *)"
Session 1 took 4 turns, 7.4 seconds, and $0.00367, with three tool calls for a listing, an edit, and the test run. Meanwhile the observer sent three requests of about 4 seconds each, and together they came to $0.00420, more than the session itself. claude-mem also resent the conversation so far with each request, so the prompt grew from 2,121 to 8,556 characters. The turn summary never happened, though. When the headless run ended, the Stop hook was canceled, and the run log recorded it as cancelled. Below is the memory part of what session 2 received at startup. With the instructions before and after it, the whole text came to 4,038 characters.
# [notes-app] recent context, 2026-10-28 1:47pm GMT+9
Mode: Code Development (code)
Legend: 🎯session ●bugfix ◆feature ↻refactor ✓change ○discovery ⚖decision ⚠security_alert ⚷security_note ⊘sensitive
Format: ID TIME TYPE TITLE
Fetch details: get_observations([IDs]) | Search: mem-search skill
Stats: 3 obs (563t read) | 0t work
### Oct 28, 2026
1 1:45p ○ notes-app project contains only notes.py with word_count and a README
2 " ✓ slugify(title) added to notes.py
3 " ● slugify verification returned "hello-world" for padded input
With only that, session 2 answered in a single turn without opening a file. I’ve left out the last paragraph of its answer.
Based on the project memory that loaded at session start, the last session on `notes-app` was short:
1. **Discovery:** The project contained only `notes.py` (with a `word_count` function) and a README.
2. **Change:** A `slugify(title)` function was added to `notes.py`.
3. **Issue:** Verifying `slugify` on padded input returned `"hello-world"`. The memory doesn't say whether that output was wrong, so it's unclear whether this is a bug or expected behavior.
It took 3.6 seconds and $0.00243. In a copy of the same folder without the plugin, the same question took 5 turns, 11.4 seconds, and $0.00241, and Claude described the files but said it couldn’t find any record of an earlier session. The run with claude-mem started 4,322 tokens heavier on its first request, at 22,569 tokens, yet fewer turns left the total cost almost the same. The third line deserves a second look, though. The observer filed a passing check as a bugfix, and the next session trusted that label and wondered whether something was broken. Of course, this was a single small experiment, so please don’t read it as a benchmark.
How it differs from built-in memory and remember
According to the memory docs, Claude Code already has two kinds of memory. CLAUDE.md holds instructions you write, and auto memory holds notes Claude keeps for itself, such as your preferences or corrections. I also picked remember, a memory plugin in Anthropic’s official marketplace, for comparison. The Claude Code official plugin list aggregate counted 63,089 unique installs of it as of October 16, 2026.
| Who writes it | Where it lives | What loads at session start | |
|---|---|---|---|
| CLAUDE.md | You | The project or your user folder | The whole file |
| Auto memory | Claude, as it works | Under ~/.claude/projects/ |
First 200 lines or 25 KB of MEMORY.md |
| claude-mem | A separate observer model | ~/.claude-mem/claude-mem.db |
Recent observations, up to 10,000 characters |
| remember | A separate claude -p (Haiku) |
.remember/ inside the project |
A handoff note and daily summaries |
The biggest difference is how much gets recorded. Auto memory writes only what it judges worth keeping, while claude-mem writes up every tool call. remember also summarizes with Haiku, but it saves sessions in batches as markdown inside the project, and its README says the plugin reads no credentials on its own. And claude-mem’s installer asks whether to turn off auto memory, with leaving it on as the default.
When it fits, and what you take on
If you come back to the same project over many sessions and often ask what happened last time, but don’t want to keep notes yourself, claude-mem may suit you. For short one-off tasks, on the other hand, the extra context and model calls buy you little, and if you mostly run headless like I did, the turn summaries may not get saved.
There are things to take on as well. Every tool call adds an observer request, and a worker stays up on a local port. The tool_uses table keeps each tool’s raw input and output, up to 64 KB per field and with no expiry by default, and in my run a whole directory listing went in. As the private tags page says, text wrapped in a private tag isn’t stored, and I confirmed that in a dry run. Anonymous telemetry to PostHog is on by default, and npx claude-mem telemetry disable or DO_NOT_TRACK=1 turns it off (telemetry). The SECURITY.md file also says claude-mem reads the Claude Code OAuth token from the OS credential store and hands it to its worker, without sending it anywhere. On top of that, the injected text told Claude to use claude-mem’s to-do tool instead of the built-in one, and on an empty project it carried a line advertising a 30-day free trial of the paid hosted service. And while the README says its three-step search saves about 10 times the tokens, I didn’t attach the search tools, so I couldn’t check that.
Installing it and the first thing to try
claude-mem installs from its author’s own marketplace, not the official one. Inside Claude Code you run the first two lines, and in a terminal you run the interactive installer.
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
npx claude-mem install
According to the installation guide, the interactive installer preselects CMEM Pro, a hosted observer that needs a cmem.ai sign-in, and --provider claude uses your own Claude plan without signing in. With the marketplace install, the first session builds the launcher in ~/.local/bin and adds a PATH line to your shell’s rc file if needed, so memory shows up from the second session. To remove it, run npx claude-mem uninstall, but ~/.claude-mem stays behind, so delete that folder yourself. If you try it, I’d suggest opening the viewer at the local address printed when a session starts and checking which tool calls turned into which records. I ran these tests on October 28, 2026, on macOS with Claude Code 2.1.304 and claude-mem 15.4.0 (release), using Haiku 5.5 for both the sessions and the observer.
AI tools helped with the research for this post.