claude-mem: CLAUDE.md files, usage costs, and where its data lives
claude-mem is a memory plugin for Claude Code and a dozen other coding agents. A second AI, which its docs call the observer, watches each tool step and writes notes into a database on your machine; the next session opens with those notes already in context, with no tool call needed. It’s popular (over 100,000 GitHub stars in early November), it runs on Windows, Mac and Linux, and it ships fixes most days.
The three complaints people search for, as of version 15.9.0 (released 2 November 2026):
| Complaint | Where it stands in 15.9.0 | What to do |
|---|---|---|
| CLAUDE.md files appear in every folder | Off by default since 9.1.0 (February 2026) | Leave |
| It uses a lot of your plan or API money | Partly fixed: 13.30.0 cut one model call per prompt; a report that each observer turn can re-read about 100,000 tokens is still open | Turn the observer off, shrink its conversation budget, or skip tool capture (settings below) |
| Data in places you didn’t expect | Mostly | Move it with |
An AI drafted this page from claude-mem’s own README, docs, changelog and source (version 15.9.0, read 5 November 2026) and its GitHub issues, and another AI checked it. No person has run any step here, and nobody installed claude-mem for this page. AI reviewers ran claude-mem’s cleanup script, the file search and the .gitignore patterns below on test folders and a test git repository, with a temporary home directory, on 5 November; nothing else here was run, and this page doesn’t ask you to run that script. Counterparts, named below as one alternative, is ours: Mike LaPeter makes it.
Does claude-mem put CLAUDE.md files in every folder?
Not on its current defaults. Version 9.0.0 (6 January 2026) added folder context files: after each note, claude-mem wrote a CLAUDE.md with a “Recent Activity” table into every folder Claude had touched. People found dozens to hundreds of them in their repos.
#609 asked “why does this leave CLAUDE.md files literally all over?”, and #641 reported them in subfolders and in doubled folders like backend/backend/. The maintainer later called it “the single most-reported bug category” (#793).
9.1.0 (7 February 2026) made the feature opt-in: CLAUDE_ “now defaults to false”. In the 15.9.0 code, the folder writer runs only when that setting is "true". Its docs say the feature “is disabled by default”.
Two cautions:
- The loud reports are from old versions. One user in #609 set the flag to false and still got files in January: at the time the setting was documented but the code didn’t read it yet. 9.1.0 fixed that. A 21 October report of 178
CLAUDE.mdfiles across someone’s repos (#4965) was on claude-mem 9.0.12. If you’re still seeing new files, check your version and your settings file first. - Turning it off doesn’t remove files already written. They’re still in your repo, and Claude Code loads a subfolder’s
CLAUDE.mdonce Claude reads or edits a file there, so old activity tables keep reaching the context. Until you deal with them, Claude Code’sclaudeMdExcludessetting can stop listed files from loading (below).
To check or set it, the docs say to open ~/.claude-mem/settings.json and set:
{
"CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED": "false"
}Changes “take effect immediately (no restart needed)”. If you turn the feature on deliberately, the docs suggest keeping the files out of git with **/CLAUDE.md and !CLAUDE.md in .gitignore. That pattern has a slip: !CLAUDE.md with no slash matches at every level, so it un-ignores the subfolder files too, and in a test repository on 5 November (an AI reviewer, git 2.46.0) git still listed them. **/CLAUDE.md with !/CLAUDE.md (note the leading slash) ignored the subfolder files and kept the top-level one. The project root (a folder with a .git directory) is always skipped, so your own top-level CLAUDE.md is left alone. Anything you write outside the <claude-mem-context> tags in a folder file is kept when it’s regenerated.
Finding old files. Search your project for the tag <claude-mem-context>: in a terminal, grep -rl --include=CLAUDE.md 'claude-mem-context' ., or your editor’s search on Windows. Then run git status --untracked-files=all to see which of them git counts as new (plain git status shows a new folder, not the file in it); if your .gitignore hides CLAUDE.md files, git won’t list them, so rely on the search. The search lists any file that contains the tag, including one where you mention the tag in your own words.
Open each file before you decide anything. A file holding only a “Recent Activity” block under the tag is claude-mem’s. A file with other text beside the block has your notes in it. Removing the files, or just the block, by hand is your choice, one file at a time.
Stopping old files loading, without deleting anything. Claude Code’s claudeMdExcludes setting skips CLAUDE.md files by path or glob (its memory docs). Its docs match patterns against absolute file paths and suggest your project’s .claude/settings.local.json (create it if it isn’t there), which keeps the exclusion on your machine. We haven’t tried it on claude-mem’s files:
{
"claudeMdExcludes": [
"/path/to/your/project/some-folder/CLAUDE.md"
]
}List the files by path. A broad pattern like **/CLAUDE.md would also skip your own.
About claude-mem’s cleanup script. Its folder-context docs describe scripts/regenerate-claude-md.ts --clean, which “Deletes files that become empty after stripping” and “Preserves files that have user content outside the tags”. We don’t suggest running it on a real project. On 5 November, AI reviewers ran it on test folders, not real repositories. It did what the docs say for files with a block only, or a block next to other text. But in a CLAUDE.md whose own text mentions <claude-mem-context> above claude-mem’s block, it deleted everything from that mention to the end of the block, the person’s notes included. Its pattern starts at the first opening tag it finds, even one written in prose (line 315 of the script). Its --dry-run listed that file as “Would clean”, the same label as any other. The script also creates ~/.claude-mem/settings.json if you don’t have one, even on a dry run. No person has run it.
What does claude-mem cost?
The observer is a second model call, so claude-mem uses model time on top of your own session. Who pays depends on how you installed it:
npx claude-mem install, interactively: after a browser sign-in, “CMEM Pro is pre-selected”. That runs the observer on cmem.ai’s servers, off your Claude plan. The sign-in needs no card; choosing CMEM Pro opens a checkout that does. By its pricing page, the trial runs 30 days, and billing can start sooner if the trial’s included usage runs out. After that it’s $30 a month, with $70 and $100 tiers, and automatic-upgrade settings that can move you up a tier. If the hosted observer stops serving your account, memory “then uses your Anthropic plan”.npx claude-mem install --provider claude: “memory shares your Claude plan usage”, using Claude Haiku by default. It skips the sign-in step. An install with no terminal attached (an AI running it, say) defaults to this on a fresh install./plugin marketplace add thedotmack/claude-mem, then/plugin install claude-mem: has “no installer step”, so it runs on the default provider,claude: your plan.- Your own OpenRouter or Gemini key: billed to that key.
What people report:
- On a separate Flash key, one user measured $65.82 of claude-mem spend against $102.94 for their coding model over a month, “63.9% on top of my actual coding model spend” (#3848). It was folded into a tracking issue; another user commented on 17 October that it was still not fixed.
- On a Max plan with 15.0.1, a user found each observer turn re-reading a conversation of up to about 100,000 tokens. After one long session, the observer spent seven hours on its backlog and used 2% of the weekly limit while they did almost nothing (#5023). One part (whole files sent along with edits) was fixed in 15.1.0; the default conversation size is still open, and
CLAUDE_still defaults toMEM_ OBSERVER_ MAX_ CONVERSATION_ CHARS 400000in 15.9.0. - On 9.0.12, observer sessions used 245.5 million tokens against 348.4 million for all of one user’s own work over four days (#4965). That version is from January.
What’s changed since: 13.30.0 (4 October) stopped giving each prompt “a model call of its own”, which it says was “a full prompt for a nine-token reply”, and turned off observer thinking that had taken “roughly 70% of the observer’s output tokens” on Sonnet 4.5. With subscription auth, a quota guard stops the observer when your five-hour window reaches 95% or the weekly one 93%. 15.9.0 logs each observer turn’s token counts in the worker log, so you can see what it spends.
To spend less, from its configuration and troubleshooting docs:
| Setting | Where | Effect, by its docs |
|---|---|---|
CLAUDE_: "false" |
| “stops new observation and session-summary model calls”; existing memories, search and session-start context keep working |
CLAUDE_: lower than 400000 | same | Retires the observer’s conversation sooner. In #5023, |
CLAUDE_: "true" | same | Skips every subagent’s tool calls; the docs recommend it for heavy workflow users |
CLAUDE_: glob patterns | same | Leaves whole projects out |
CLAUDE_: "1" | the | Stops capturing tool calls (and the file history added before reads); session start and summaries keep working |
claude-mem also puts context into your own session: up to 50 recent notes at each start, by default (CLAUDE_). That uses context in the model you’re paying for, the same as any memory that loads itself.
Where does claude-mem keep its data?
On your machine, in ~/.claude-mem/, by its docs and source:
claude-mem.db, the SQLite database of notes, session summaries, your prompts, and the raw input and output of each tool call it captured (up to 64 KB each, kept forever unless you setCLAUDE_)MEM_ TOOL_ USES_ RETENTION_ DAYS settings.jsonandlogs/chroma/, the vector index for search by meaningbackups/auto/, if you turn on backupsdeliverables/, copies of documents, images and other files a session made outside your source tree (CLAUDE_:MEM_ DELIVERABLES_ ENABLED "false"turns it off; copies already made stay)
CLAUDE_MEM_DATA_DIR moves all of it. The installer also puts a small hook launcher at ~/.local/bin/claude-mem (on Windows, %LOCALAPPDATA%\claude-mem\bin), and appends a PATH line to your shell’s rc file if that folder isn’t already on your PATH. You can mark text you don’t want stored with <private> tags; redaction of common secrets is available but off by default.
What can leave your machine:
- CMEM Pro, the hosted observer the installer pre-selects: the observer itself runs “off-plan through
https://cmem.ai/api/inference/v1”, so what it watches (your tool calls and their results, which can include file contents) goes to cmem.ai to be written up. Choosing CMEM Pro also turns on its cloud sync (the installer’s summary says “Cloud sync: ON”). That stores your notes, session summaries and “the prompts you typed” in your cmem.ai account, with no further step. By its docs, sync is off whenCLAUDE_is empty inMEM_ CLOUD_ SYNC_ HUB_ URL ~/.claude-mem/settings.json; we haven’t tried it. - The installer’s browser setup: from 15.2.0 (25 October) a fresh install’s setup read the last 30 days of prompts from your coding agents and uploaded them to cmem.ai without asking (#5176). 15.8.3 (2 November) added a consent step: “Nothing leaves the machine until you answer”, and “Keep everything local” uploads nothing. Its changelog adds that “Prompts already uploaded by earlier versions are not removed by this update.” Neither the changelog nor #5176 says how to have them deleted. #5176 was still open on 5 November.
- Usage statistics and error reports: on by default. The statistics are anonymous counts; error reports carry redacted error text. The interactive installer asks once at the end.
npx claude-mem telemetry disableturns both off, as doesDO_NOT_TRACK=1. - A local
--provider claudeinstall contacts cmem.ai once, by its docs, with a numbers-only usage summary.
One open question. Reports on 9.0.12 and 12.6.2 found observer transcripts under ~/.claude/projects/ (449 MB in one, a single 54 GB file in another, #3606). In 15.9.0’s source the main observer runs with --no-session-persistence, so its turns no longer land there. By the source, two smaller jobs still do, which fits the configuration docs saying internal sessions persist there: condensing an oversized tool result, and the knowledge corpus. Expect the folder to grow more slowly, not to disappear; we haven’t measured how much. CLAUDE_ moves it. To check your own machine, look for a folder ending in claude-mem-observer-sessions under ~/.claude/projects/.
Removing claude-mem
From its installation docs, not run by us: npx claude-mem uninstall “removes the launcher binary. It leaves your shell rc file and user Path alone and prints the line to remove.” By its source, it also keeps ~/.claude-mem and prints a note telling you how to delete it yourself. Folder CLAUDE.md files stay until you remove them yourself (see above), and so does any claude-mem-observer-sessions folder under ~/.claude/projects/ (see above).
Alternatives, by complaint
Pick by what bothered you. For how Claude Code’s memory works overall, see our Claude Code memory guide.
- “I want a record of every coding step.” claude-mem does this better than most; keep it and use the settings above. Counterparts, ours, doesn’t keep a step-by-step log of coding sessions.
- “Nothing in my repo.” In Claude Code, claude-mem with the folder setting off writes nothing there. Claude Code’s built-in auto memory keeps its notes in
~/.claude/projects/<project>/memory/. Counterparts keeps one SQLite file in~/.counterpartsand doesn’t read or index your repository. - “No second AI on every tool call.” Claude Code’s auto memory is written by Claude itself as it works. With Counterparts, the Claude you’re talking to writes its memories in its own words at the end of a session, and a background Claude run once a day, on your plan, writes up anything a session left unwritten and tidies the rest.
- “No cloud account.” claude-mem with
--provider claude, the built-in memory, and Counterparts all work with none. - “I’m on Windows.” claude-mem runs there; Counterparts doesn’t (Mac and Linux only).
- “I want Claude to know me and our work across projects,” not only the code: that’s what Counterparts is for. Each session opens with a short note Claude wrote itself about who you are and where you left off. In Claude Code, run
/plugin marketplace add mlapeter/counterpartsand/plugin install counterparts@counterparts, then restart; there’s no API key or account. The Claude Code page has the rest.
Questions people ask
Is claude-mem good?
For a running record of what happened in your coding sessions, yes: it captures without you asking, works across many agents and on Windows, and has search tools, a local viewer, backups and redaction. The costs are a second model working alongside you, a heavier install (Bun, uv, a background worker and a vector index), and a fast release pace. Set it up with --provider claude if you’d rather not have the hosted trial, watch your usage the first week, and lower the observer’s budget if it runs high.
What is claude-mem, and how does it work?
A plugin by Alex Newman (thedotmack). Hooks run at session start, at each prompt, around tool calls and at the end. After each tool call, the observer writes a note; after each reply, a summary. The next session opens with recent notes, and search tools let Claude look further back.
claude-mem or Claude Code’s built-in auto memory?
Auto memory is on by default, and Claude writes its notes itself as it works: about you, your feedback and the project, skipping what the code already shows. Its docs describe no separate model. claude-mem records much more, every tool step, using a second model. claude-mem can import auto memory’s notes with npx claude-mem memory ingest, with no model calls, by its docs.
claude-mem or Counterparts?
They do different jobs. claude-mem keeps a detailed log of coding work. Counterparts, which we make, gives Claude its own memory of you and your work together, written by the Claude you’re talking to, across every project, on Mac or Linux.
Should I commit claude-mem’s CLAUDE.md files?
Its docs call it “your choice”: committing shares recent activity with a team but adds files that “change frequently”, and ignoring them keeps the repo clean. On current defaults no folder files are made, so the question only comes up if you turn them on.
How do I install claude-mem without the cloud sign-in?
npx claude-mem install --provider claude skips the sign-in and runs memory on your Claude plan. The README also mentions a CLAUDE_ switch, but the installation docs don’t list it and the 15.9.0 code doesn’t read it, so use the flag.
Does claude-mem work with Codex, Cursor or OpenCode?
Yes. The interactive installer detects and pre-selects OpenCode, Cursor, Codex CLI and others, and npx claude-mem install --ide opencode installs for OpenCode alone.
Questions? Ask in r/AIMemorySystems.