Memory across Claude Code sessions, and what it costs
The job is starting a fresh session without losing what the last one learned. claude-mem is one plugin built for it: it records what Claude does, writes short notes, and hands the next session a list of them. On 5 November 2026 I tested it (plugin version 15.9.0) on a small test project, one headless run at a time.
How I ran it
Nothing went into my real Claude Code setup. The plugin was loaded per run with --plugin-dir, its data went to a scratch folder, and its background worker was stopped after each run. I removed two of its startup hooks first, because they put a claude-mem program in ~/.local/bin and edit shell startup files. Every background claude call it made went through a logging wrapper so I could count its tokens.
# session 1: do some work that prints a value
claude -p "read README.md, run compute.py, grep src/ for TODO, tell me the BUILD_TAG" --model haiku --plugin-dir plug ...
rm compute.py
# session 2: can it remember?
claude -p "What BUILD_TAG did compute.py print last session?" --model haiku --plugin-dir plug ...
# overhead probe, with and without the plugin
claude -p "Reply with the single word OK." --model haiku --max-turns 1 [--plugin-dir plug]
Did it remember?
Yes, but only when asked to look. The list it gives a new session holds titles, not facts. The note for this test read "tidewater project BUILD_TAG identifier". With tools blocked, Claude answered UNKNOWN. Allowed to use claude-mem's search tools, it found the right value, walrus-6304, at the cost of two extra turns, each re-reading the whole context.
What it cost
- About 1,720 extra tokens on every model call, every turn. Measured as 37,525 against 35,806, the same on both probes. About 1,000 of that is the note list with one note. With 50 notes it grows to about 1,700.
- A model call for every tool call. The note-taker runs Haiku once per tool call, on your subscription. Three tool calls in session 1 cost 10,132 input and 829 output tokens. It resends the whole note-taking conversation each time, so the calls grow as a session runs on, up to about 100,000 tokens before it starts over.
- A background job nobody asked for. Its "My Work" feature starts with the worker, checks every 10 minutes, and runs a chain of Claude calls to group your requests into a "story". A refresh it started on its own took 7 calls (4 on Sonnet, 3 on Haiku), 4 minutes 20 seconds, 215,780 input and 24,992 output tokens, about $0.65 at API prices.
- Recall was dearer than not remembering. Session 2 with memory used 114,953 input tokens over 3 turns. Without claude-mem, the same question took 42,855 tokens in 1 turn (and couldn't be answered, of course).
Tokens saved in this test: none. The whole test cost about $2 at API prices against a $1 budget, mostly from two "My Work" refreshes I didn't expect.
What surprised me
- It read transcripts outside the folder I gave it. "My Work" went into Claude Code's own projects folder, copied some of my typed prompts from other projects into its own folder, and sent them to Sonnet. I deleted the copies.
- Anonymous usage telemetry is on by default. You have to opt out.
- The interactive installer pre-selects a paid hosted note-taker. With that choice every tool call's input and output goes to their server instead of Anthropic. Secret redaction is off by default.
- It stores your prompts word for word, plus each tool's input and output, in a local SQLite file, with a web viewer on 127.0.0.1.
- It needs Bun, and its hooks call a program it installs on your PATH, so installing the plugin alone does not work.
- Its session-start text tells Claude to keep all to-do lists in claude-mem "instead of any built-in to-do tool", which can override whatever planning setup you already use.
- The "95% savings" figure in its start block is the note-taker's own token spend minus the size of the list. It isn't a measured saving.
What I'd take instead
The one idea worth keeping is the shape: a short index scoped to the current project at session start, with the details fetched only when needed. A plain memory index file loaded at session start already does most of that for me, without a model running on every tool call.
Tiếng Việt