Illustration of what claude-mem does: Saves what your coding agent does and feeds the useful parts back into later sessions

thedotmack /

claude-mem

Saves what your coding agent does and feeds the useful parts back into later sessions

  • 102.3k stars
  • 7.2k stars since 3 Oct
  • TypeScript
  • Updated today
  • Some experience
  • Memory, RAG & data

Coding agents forget everything when a session ends. You then have to explain the project, past decisions and old bugs all over again. Claude-mem keeps a running memory of what the agent did, so the next session starts with that background.

It works through lifecycle hooks in Claude Code: session start, prompt submit, tool use, stop and session end. The hooks capture observations about what the agent did. A local worker service, run with Bun, turns them into summaries and stores them in SQLite. A Chroma vector database adds semantic search alongside keyword search. When a new session starts, relevant context is injected back in.

Search is layered to keep token use down. The agent first gets a compact index of results, then a timeline around the interesting ones, and only then full details for the IDs it picked. The README claims about 10x token savings from this. It also lists installers for OpenCode, OpenClaw, Antigravity and others. For the memory provider, you can use the hosted claude-mem observer, your own OpenRouter or Gemini key, or your Anthropic plan.

What it does

  • Automatic capture through hooks

    Five lifecycle hooks record tool usage and generate summaries without manual steps.

  • Three-step memory search

    The search, timeline and get_observations MCP tools let the agent filter an index first and fetch full details only for the IDs that matter.

  • Hybrid local storage

    Sessions, observations and summaries live in SQLite with full-text search. Chroma adds semantic search.

  • Web viewer and privacy tags

    A web UI shows the memory stream in real time. Wrapping text in <private> tags keeps it out of storage.

  • Many agent installers

    One npx command installs it for Claude Code, OpenCode, Antigravity, OMP and Grok Bot. A separate script handles OpenClaw gateways.

What you could build

  • Continue a multi-day coding task in Claude Code without re-explaining earlier decisions.
  • Search your project history for a past bugfix by asking in natural language.
  • Browse what your agent did in a session through the web viewer.
  • Keep sensitive snippets out of stored memory by marking them private.
  • Add persistent memory to an OpenClaw gateway and stream observations to Telegram, Discord or Slack.

Get started

Run the installer, then sign in through the browser or pass an explicit --provider flag to skip sign-in. Restart your agent and context from earlier sessions appears in new ones. Don't use npm install -g, because that installs only the SDK and not the plugin hooks.

npx claude-mem install
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem

Commands are copied from the project's README. Read it on GitHub for the full setup.

More in Memory, RAG & data

    ↑↓ to move, Enter to open, Esc to close