DEV Community

Deduped
Deduped

Posted on Originally published at dedupedai.com

Give Claude Code a memory between sessions with claude-mem

Every new Claude Code session starts blank. You re-explain the architecture, the decision you made on Tuesday and the bug you already ruled out. claude-mem is a persistent memory plugin that captures what Claude did, compresses it into summaries, and feeds the relevant parts back into later sessions. The short version is on the Deduped use-case page. Here is the install and how to use it, using the commands in the README.

What it does

Per the README, claude-mem automatically captures tool usage observations, generates semantic summaries, and makes them available to future sessions. Claude keeps continuity of knowledge about your project even after a session ends or reconnects. Search is layered (progressive disclosure), so you can see the token cost of what you pull in.

Install

The one-command route:

npx claude-mem install
Enter fullscreen mode Exit fullscreen mode

The installer sets everything up, then offers a browser sign-in for the hosted memory option. You can skip that: pass an explicit --provider flag, set CLAUDE_MEM_ONLINE_OPTIN=false, or run it in CI or a non-interactive shell and it completes without any account step. After sign-in you choose a memory provider: the claude-mem observer, your own OpenRouter or Gemini key, or your Anthropic plan.

Or install from the plugin marketplace inside Claude Code:

/plugin marketplace add thedotmack/claude-mem

/plugin install claude-mem
Enter fullscreen mode Exit fullscreen mode

Restart Claude Code. Context from previous sessions will appear in new sessions automatically.

One warning from the README: npm install -g claude-mem installs only the SDK and library. It does not register the plugin hooks or start the worker service. Use npx claude-mem install or the /plugin commands.

Other tools it supports

The same installer takes an --ide flag:

npx claude-mem install --ide opencode
npx claude-mem install --ide t3code
npx claude-mem install --ide antigravity
npx claude-mem install --ide omp
npx claude-mem install --ide pi
Enter fullscreen mode Exit fullscreen mode

For OpenClaw gateways there is a separate script, described on the OpenClaw use-case page.

Using it day to day

Start a new session in a project you worked on yesterday. Previous context shows up on its own. When you need something specific, ask Claude to search memory, for example "what did we decide about the auth middleware last week." The README describes a three-step mem-search skill for this, and there is a walkthrough in searching past decisions in Claude Code.

Keep secrets out

claude-mem has a privacy control: wrap sensitive text in the exclusion tags described in the README and it is not stored. Do this for anything like tokens or customer data before you rely on it.

Things to know before you rely on it

  • It runs a local worker service, so expect an extra background process.
  • Summaries are generated by a model provider you pick, which affects cost and where your session text goes. Pick deliberately.
  • Restart your tool after installing, or the hooks will not load.

If you only want Claude to follow better rules rather than remember more, pair it with a short CLAUDE.md. For more repos in this category see the Deduped page for claude-mem.

Want the setup commands for 50 AI repos people actually ship with? Get the free AI Repos That Actually Ship pack: https://dedupedai.com/ship-pack/?utm_source=devto&utm_medium=article&utm_campaign=shippack

Top comments (0)