claude-mem: persistent memory for Claude Code
A third-party plugin that records what Claude Code does and feeds it back next session: how to install it, what it stores, what it costs and how to remove it.
Short answer
A free plugin that gives Claude Code memory across sessions.
claude-mem is an open-source plugin by Alex Newman, not by Anthropic. Hooks record what Claude reads, edits and runs, a second model turns that into short notes, and the next session in the project starts with an index of them. It is Apache-2.0 licensed and installs with one npx command or two plugin commands.
115kGitHub stars
third-party pluginInstall, use or remove claude-mem
Pick a task. The commands are the ones the claude-mem README, its docs and Anthropic’s Claude Code docs give today, for claude-mem v15.13.0.
- 01Check you have Node.js 20.19 or later (or 22.12 or later) and Claude Code 2.1.139 or later. The installer adds Bun and uv if they are missing.
- 02In a terminal, run
npx claude-mem install --provider claude(the command below). It asks which agents to set up and whether to turn off Claude Code’s own auto memory. - 03With
--provider claudethe notes are written by Claude Haiku on your own Claude plan and there is no sign-in. Plainnpx claude-mem installpre-selects the paid CMEM Pro observer, which needs a browser sign-in. - 04Restart Claude Code. Memory shows up from your second session in a project.
Our pick: the npx installer. The plugin route, /plugin marketplace add thedotmack/ then /plugin install claude-mem inside Claude Code, also works, but the docs say its first session can run without memory while the hook launcher compiles.
- 01Work as usual. Every tool call is recorded, and a summary is written when Claude finishes responding.
- 02Ask in plain words, such as “what did we fix last session?”. The mem-search skill looks it up in three steps: index, timeline, details.
- 03Open the web viewer at the localhost address the worker prints when it starts; memory, sessions and settings are under /viewer.
- 04Wrap anything you never want stored in <private> and </private> tags in your prompt.
If memory does not appear, run the doctor command below. It checks Bun, uv, the hook launcher and the worker, and says what to fix.
- 01To pause it, run the command below in your shell, or open /plugin in a session, press Tab for Installed, select claude-mem and press Space.
- 02To keep the start-of-session context but stop recording tool calls, add CLAUDE_MEM_DISABLE_TOOL_HOOKS set to 1 in the env block of ~/
.claude/ settings.json. - 03To stop the anonymous usage analytics, which are on by default, run
npx claude-mem telemetry disableor set DO_NOT_TRACK=1.
The auto-update docs say claude-mem does not update itself while it is turned off in Claude Code, so a paused plugin stays paused.
- 01Run
npx claude-mem uninstall(below). It stops the worker, removes the plugin, its marketplace entry and the hook launcher, and undoes the auto memory switch it set. - 02Your memory stays in ~/
.claude-mem. The uninstaller prints the command to delete it; on Mac and Linux that is rm -rf ~/, which cannot be undone..claude-mem - 03It leaves your shell profile alone and prints the PATH line to remove by hand.
Installed only through the marketplace? /plugin uninstall in a session works too, but the uninstall command also cleans up the launcher and settings.
What is claude-mem?
claude-mem is a memory plugin for Claude Code and other coding agents. Its GitHub repository, thedotmack/claude-mem, describes it as persistent context across sessions: it captures what your agent does, compresses it with AI and injects the relevant part back into future sessions. The author is Alex Newman (GitHub user thedotmack). It is a third-party project: Anthropic did not make it and does not list it in its official plugin marketplace, though the README says it is built with Anthropic’s Claude Agent SDK.
On November 9, 2026 the repository had 115,263 stars and 10,009 forks, and the latest release was v15.13.0, published that day. The code is TypeScript under the Apache License 2.0, so claude-mem itself is free. People search for it as claude-mem, claude mem or claude mem github; it is all the same project, with docs on docs.claude-mem.ai and a paid hosted service on cmem.ai.
The README says it also works with Codex, Cursor, OpenCode and 11 more agents; Copilot CLI, Goose, Roo Code and Warp can only search the memory.
How claude-mem works: hooks, observer and summaries
Claude Code runs hooks, small commands it calls at fixed moments in a session. claude-mem registers one command for each of these events: Setup, SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure, Stop, SubagentStop and SessionEnd. From there, according to the README and the Getting Started page:
- 01Capture: after every tool call (Read, Write, Edit, Bash, Grep and the rest) the hook hands what happened to a small local worker, a background HTTP service run by Bun.
- 02Compression: a second agent, the observer, turns that activity into observations. Each has a title, a narrative, key facts, a type such as decision or bugfix, and the files involved.
- 03Summary: when Claude finishes responding, the Stop hook writes a session summary with what you asked, what was investigated, learned and completed, and next steps.
- 04Injection: when a new session starts, the SessionStart hook adds an index of recent observations for the project, 50 by default, plus the latest summary if nothing newer has been captured since.
Claude pulls in full details only when it needs them. To front-load a whole repository instead, the README offers an optional /learn-codebase command, about five minutes on a typical repo.
claude-mem search and the mem-search skill
Search runs through three tools that claude-mem serves over MCP, the same protocol Claude uses for any connected tool (see how MCP servers plug into Claude). search returns a compact index with IDs, timeline shows what happened around a result, and get_observations fetches full details for the IDs you pick. A bundled skill, mem-search, drives the three steps, so you just ask a question. Storage is SQLite with full-text search, plus Chroma for semantic search.
How to install claude-mem
The README gives two routes for Claude Code, and the picker above has both. The first is the installer, npx claude-mem install. It finds your agents, asks which to set up, registers the hooks and puts a small claude-mem launcher on your PATH. The second is the plugin marketplace inside Claude Code:
/plugin marketplace add thedotmack/
/plugin install claude-mem
Then restart Claude Code. The docs warn that npm install -g claude-mem installs only the library and registers no hooks, so it gives you no memory. If you are new to the CLI itself, start with how to install Claude Code.
claude-mem requirements
- Node.js 20.19 or later in the 20 line, or 22.12 or later (README).
- Claude Code 2.1.139 or later. The installation docs say an older version ignores the hook arguments and captures nothing, with no error shown; update with
claude update. - Bun and uv, which the installer adds if missing. SQLite comes bundled.
Choosing the memory provider
Someone has to write the observations, and the installer asks who. The installation docs list four choices: the claude-mem observer (CMEM Pro, pre-selected), your own OpenRouter key, your own Gemini key, or your Anthropic plan. CMEM Pro needs a sign-in to claude-mem in your browser and starts a 30-day free trial on a checkout page that asks for a payment method; cmem.ai lists it at $30 a month after the trial. Pass --provider claude and the installer skips the sign-in and uses your Claude plan, with Claude Haiku as the default model.
What claude-mem stores and where
Everything lives in ~/
| File | What it holds |
|---|---|
| claude-mem.db | Sessions, observations and summaries (SQLite) |
| settings.json | Provider, model, port and what to inject |
| logs | One worker log per day |
| media-v1 | Copies of tool screenshots, kept by default |
The worker listens on 127.0.0.1 at a per-user port, 37700 plus a number from your user ID unless you set CLAUDE_MEM_WORKER_PORT. The same address serves the web viewer: My Work, a live view of requests and progress, at the root, and your memory, sessions and settings at /viewer. Every observation has an ID you can open there. An option to write activity notes into CLAUDE.md files in your project folders is off by default.
SKLclaude-mem token cost
- Context it adds to Claude. The Getting Started page puts the index shown at session start at about 50 to 200 tokens. Search results cost about 50 to 100 tokens each, and a full observation about 500 to 1,000 by the README’s count (the Getting Started page says 100 to 500).
- Tokens the observer spends. Every session’s tool activity goes through a model to become observations. On the Anthropic plan option that model runs on your own Claude login, so the installation docs say memory shares your plan’s usage. CMEM Pro, OpenRouter or Gemini move that work off your plan.
If you already hit your limits, see Claude usage limits. A quieter mode, code--chill, records fewer observations, and CLAUDE_MEM_CONTEXT_OBSERVATIONS sets how many are injected.
Is claude-mem safe? Privacy and what leaves your machine
From the README, the telemetry page and the installation docs, read November 9, 2026:
- Local by default. The memory database stays on your machine. Cloud Sync, which copies observations to cmem.ai across your devices, is opt-in and part of CMEM Pro.
- The observer model. Your activity is sent to whichever provider writes the observations: Anthropic, OpenRouter, Google or the cmem.ai gateway.
- Analytics are on by default. claude-mem sends anonymous usage events through PostHog, keyed to a random install ID. The telemetry page says prompts, paths, project names, code and model output are never sent, but redacted error messages are. Turn it off with
npx claude-mem telemetry disableor DO_NOT_TRACK=1; the installer asks once at the end. - The installer may contact cmem.ai with an optional email you type, and a numbers-only usage summary when it creates a sign-in link.
- Secrets. Text inside <private> tags is never stored. Automatic redaction of API keys and other secret patterns exists but is off until you set CLAUDE_MEM_REDACT_ENABLED to true.
- The local worker has no request authentication; the docs say binding to 127.0.0.1 is its only defence, so do not expose its port.
- Updates. claude-mem updates itself once a day to the release its owner promotes.
Like any plugin, its hooks run code on your machine on every tool call. Anthropic’s plugin docs note that a plugin can run hooks and MCP servers and ask you to review it before you install; claude-mem’s code is public on GitHub for anyone who wants to read it first. The same caution applies to skills from other authors, such as the grill-me skill.
claude-mem vs Claude Code’s own memory (CLAUDE.md and auto memory)
Claude Code already has two memory systems, per Anthropic’s memory docs. CLAUDE.md files are instructions you write, loaded in full at every session. Auto memory is notes Claude writes itself, on by default: your preferences, corrections, project decisions and where to find things, saved as markdown in ~/
| Feature | claude-mem | Auto memory |
|---|---|---|
| Made by | Alex Newman, open source | Anthropic, built in |
| What it records | Every tool call, summarized | Only what Claude judges worth keeping |
| Storage | SQLite database | Markdown files you can edit |
| Search | Full-text and semantic, three MCP tools | Claude reads the files |
| Extra model cost | Yes, the observer | No separate model |
| Other agents | Codex, Cursor and more | Claude Code only |
The installer asks whether to turn auto memory off, so the two do not overlap. If you only want Claude to remember your preferences and decisions, auto memory and a short CLAUDE.md need no install; /memory in a session shows both. claude-mem fits when you want a searchable log of what was actually done across many sessions, or one memory shared by several agents.
claude-mem alternatives
Besides the built-in auto memory, Anthropic’s official plugin marketplace lists one memory plugin, remember, from Digital-Process-Tools, another third party. Its listing says it extracts, summarizes and compresses conversations into tiered daily logs. We read only that listing, not its code or docs.
FAQ
What is claude-mem?
An open-source plugin that records what Claude Code does in a session, has a second model compress it into short observations and summaries, and feeds an index of them into the next session. It is made by Alex Newman, not Anthropic.
Is claude-mem free?
The plugin is free and Apache-2.0 licensed. The model that writes your notes is not: it runs on your Claude plan, your own OpenRouter or Gemini key, or CMEM Pro, which cmem.ai lists at $30 a month after a 30-day trial.
Does claude-mem actually work?
Its docs describe memory appearing from the second session in a project. We found no independent benchmark of how much it helps, so the fair test is your own project over a few sessions. If nothing shows up, run npx claude-mem doctor.
Is claude-mem safe to use?
The memory stays on your machine and the code is public, but your tool activity goes to the observer model you choose, anonymous analytics are on until you turn them off, and the plugin updates itself daily. The README also promotes a crypto token named CMEM, made by a third party and endorsed by the author; you do not need it to install or use the plugin.
Where is claude-mem on GitHub?
In the repository thedotmack/claude-mem, with 115,263 stars and release v15.13.0 on November 9, 2026.
Does claude-mem work with Codex or Cursor?
Yes. npx claude-mem install detects supported agents, including Codex CLI, Cursor and OpenCode, and asks which to set up.
What port does claude-mem use?
The worker listens on 127.0.0.1 at 37700 plus a number taken from your user ID, so each user on a machine gets a different port. Set CLAUDE_MEM_WORKER_PORT in ~/.claude-mem/settings.json to fix it.
Is there a claude-mem skill?
Yes, mem-search comes with the plugin. It drives the three search tools when you ask Claude about past work, so you do not call them yourself.
Sources
- GitHub, thedotmack/claude-mem: README, plugin.json, marketplace.json, uninstall command source, repository and release data, read November 9, 2026
- Claude-Mem docs: Introduction, Installation, Getting Started, Configuration, Telemetry, Troubleshooting, Private Tags, Auto-Redaction, Cloud Sync, Auto-update and Folder Context, read November 9, 2026
- cmem.ai, CMEM Pro plan and price, read November 9, 2026
- Claude Code Docs, How Claude remembers your project (CLAUDE.md and auto memory), read November 9, 2026
- Claude Code Docs, Discover and install plugins, and the plugins reference, read November 9, 2026
- GitHub, anthropics/claude-plugins-official marketplace list, read November 9, 2026
Spotted a mistake? Write to support@gptx.io and we will check it.
Next up5 minClaude Code guidesCLIInstall, skills, plans, limits and live status for Anthropic’s coding agent.