עברית 📰 Blog
← Back to Blog
AI Tools

claude-mem: Give Claude Code a Memory Between Sessions

Stav Adam
Founder, Masterphub
November 3, 2026

Share this article

claude-mem: Give Claude Code a Memory Between Sessions
Short answer: claude-mem is a free, open source plugin that gives Claude Code (and a long list of other coding agents) a memory between sessions. It records what the agent did, turns it into short summaries, and feeds the useful parts back in when you start again. The core runs on your machine. A hosted "observer" with a 30-day trial and an optional cloud sync are the parts that can cost money.

What it does

Every coding agent forgets. You close the session, open a new one, and spend the first ten minutes explaining the project again. claude-mem tries to fix that.

It hooks into the agent's session: when it starts, when you send a prompt, before and after each tool call, and when the session ends. Each step becomes an "observation". An AI model then compresses those observations into short summaries and stores them in a local SQLite database. Next time you open a session, the relevant summaries are added to the start, so the agent already knows what you were working on.

There is also a local web viewer where you can browse sessions, see what was saved, and change settings. Search works by keyword and by meaning, through four MCP tools. The agent first searches, then looks at a timeline, and only then pulls full details. The project says this saves around 10x tokens compared to loading everything at once. That number comes from the project itself, not from an outside test.

How to set it up

  • You need Node.js 20 or newer and a current version of Claude Code with plugin support.
  • Run npx claude-mem install, or inside Claude Code add the plugin from the marketplace with /plugin marketplace add thedotmack/claude-mem and then /plugin install claude-mem.
  • Bun and uv are installed for you if they are missing. SQLite comes bundled.
  • Other agents get their own flag, for example npx claude-mem install --ide opencode. The README lists Codex, Gemini, Copilot, OpenCode, Hermes, Cursor and more.

Note: npm install -g claude-mem only gives you the library, without the hooks. Use one of the install routes above.

Free and paid parts

The code is Apache-2.0, around 108,000 stars on GitHub. Running it is free. The catch is the compression step, which needs an AI model somewhere:

  • The installer asks you to sign in and gives a 30-day trial of the hosted observer.
  • After the trial, compression runs on your own Anthropic plan usage, unless you subscribe. The README does not list a price.
  • You can skip sign-in and use your own OpenRouter or Gemini key instead.
  • Cloud Sync (backup to the project's servers) and a shared team space are optional extras, with no pricing on the page.

Who it's for

  • People who build with Claude Code every day and are tired of repeating context.
  • Agent builders who switch between several tools and want one memory across them.
  • Creators running long projects (a site, a course platform, a book pipeline) where the agent keeps losing track of past decisions.

What to watch out for

  • Your session content is sent to whichever model does the compression. Wrap anything sensitive in <private> tags to keep it out of storage, and read the privacy policy before turning on cloud sync.
  • Memory grows. Check the viewer now and then and remove things that are wrong or outdated, or the agent will keep acting on old information.
  • On Windows, Node and npm must be on your PATH. If hooks fail, run npx claude-mem doctor.
  • Paid plans and data retention are not described in the README. Check before you rely on the hosted parts.

Source: thedotmack/claude-mem on GitHub

More AI tools and ready prompts at masterphub.io

Share this article