Skip to content
FossShelf
Home / Categories / For AI Engineers

claude-mem

Stop re-explaining your codebase to every new agent session

Replaces Contextpool, Pinecone, Qdrant Cloud, Weaviate Cloud, Anthropic Agentcore Memory, Mem0

117.72K starsApache-2.0reviewed 28 Aug 2026last commit 14 Nov 2026
Screenshot of claude-mem

Who it's for

Developers on long-running codebase projects

On a project active for weeks or months, accumulated context (architectural decisions, dead ends, conventions, dependency choices) is valuable. claude-mem captures that context automatically and injects it at the start of each session, so the agent picks up where it left off rather than starting from the README.

Your project is a short-lived script or one-session task. The memory engine's value scales with session count; on a two-session project the overhead of setup outweighs the benefit.

Teams using multiple agents and IDEs simultaneously

When a team uses Claude Code for one task and Cursor for another, each agent normally operates in isolation. claude-mem writes all observations to a shared local database (or a shared CMEM Cloud timeline on the paid tier), so context captured in one agent is available to the others without any manual sync.

Your team's agents are intentionally siloed and sharing context between them would create interference. Use per-project database directories to keep observations separate in that case.

AI engineers studying agent memory architectures

claude-mem provides a working implementation of observation capture, vector indexing, semantic retrieval, and MCP serving in a single installable package. Engineers exploring how to build agent memory into their own tooling can study the hooks architecture, the SQLite schema, and the 3-layer MCP workflow as a reference implementation.

You are building a multi-tenant product that needs a scalable memory API for end-users. claude-mem is designed for local, single-developer or small-team use; managed services like Mem0 or Pinecone are a better starting point for multi-tenant workloads.

The problem

AI coding agents start every session without any memory of previous work. The agent does not know which architectural decisions were already made, which approaches were tried and discarded, or what conventions the project follows. Developers spend the first minutes of every session re-explaining context that was already established, or watching the agent repeat a mistake from three sessions ago. The problem compounds on larger codebases. Context that would take seconds to recall from memory takes minutes to re-establish from scratch, and in practice it often never fully comes back. The alternative of manually maintaining a memory file or README is a second job on top of the actual work.

How it works

Lifecycle hook-based observation capture

Five hooks (SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd) intercept every agent action automatically. Each observation is structured and written to a local SQLite database without any manual input. The engine runs in the background via a Bun worker process, so no intervention is needed between sessions.

Hybrid semantic and keyword search

Memory retrieval combines SQLite full-text search (FTS5) with a Chroma vector database for semantic matching. At session start, the most relevant prior observations are ranked and injected into context. A 3-layer MCP workflow (search index, timeline, get_observations) delivers roughly 10x token savings over naive full-history injection.

Multi-IDE and multi-agent support

Installs natively into Claude Code, OpenCode, Codex CLI, Cursor, Gemini CLI, and other MCP-compatible clients. A single observation database is shared across all of them, so context captured in one agent is available in another. The CMEM Cloud tier extends this across machines via a private MCP link.

Privacy control with private tags

Wrap any content in <private> tags to exclude it from observation storage. This lets developers keep sensitive credentials, client-specific details, or personal notes out of the memory database without disabling capture for the whole session.

Configurable workflow modes and languages

The CLAUDE_MEM_MODE setting controls both the capture behavior (code, chill, investigation) and the language used in generated observations. Built-in modes include English (default), Simplified Chinese, and Japanese, with ISO 639-1 language codes available for additional locales.

Optional CMEM Cloud sync for cross-device access

The local SQLite database mirrors to CMEM Cloud behind a private MCP link, making the full memory timeline accessible from any machine or agent. The free, open source engine runs without a cloud account; the $20/month cloud tier adds cross-device sync, a live mobile feed, and end-to-end private key scoping.

Features

  • Lifecycle hook-based observation capture
  • Hybrid semantic and keyword search
  • Multi-IDE and multi-agent support
  • Privacy control with private tags
  • Configurable workflow modes and languages
  • Optional CMEM Cloud sync for cross-device access

How to install

Install the plugin into Claude Code or any supported agent IDE with one command.

npx claude-mem install

Recommended for this setup

Strengths

  • Apache-2.0 license with full self-hosting: The entire engine runs on your own machine with no licensing fees, no usage caps, and no cloud dependency. Apache-2.0 permits commercial use, modification, and redistribution without restriction. Unlike Pinecone or Mem0 Cloud, there is no per-query billing and no vendor dependency on the data path.
  • Single-command install across IDEs: npx claude-mem install handles dependency detection, hook wiring, database creation, and worker startup automatically. The installer checks for Bun and uv/Python and installs them if missing, so the only explicit prerequisite is Node.js 20 or higher. The same install pattern works for Claude Code, OpenCode, and other supported clients with one flag.
  • Token-efficient progressive disclosure: The 3-layer MCP workflow surfaces a compact index first (~50-100 tokens per result), then timeline context, then full details only for the IDs that are relevant. This approach delivers roughly 10x token savings compared to injecting all prior observations at the start of each session, which keeps cloud API costs predictable.
  • Active development and broad community: The repository shows sustained development, with the last push within two days of this writing and 92,000+ GitHub stars. The project is listed in Awesome Claude Code and ships multilingual README translations across 30+ languages, reflecting a broad, active contributor community. Version 13.4.0 is published on npm.

Trade-offs

  • Requires Bun and uv for full functionality: The Bun JavaScript runtime manages the local worker process, and uv (a Python package manager) installs the Chroma vector database for semantic search. Both are auto-installed by the installer if missing, but this adds startup overhead on first install and introduces two non-obvious system dependencies that users maintain independently.
  • Node.js 20 or higher required: The minimum Node.js version is 20.0.0. Developers on older Node versions (common in enterprise environments with locked-down toolchains) need to upgrade before install. The README notes that Windows users may need to update PATH manually after a Node.js installation.
  • High open issue count reflects active edge cases: With 312 open issues, the project is actively used and actively developed, but some rough edges exist. Users on Windows, non-standard IDE configurations, or less common MCP clients may encounter setup issues not yet covered by the official troubleshooting guide.

Tech stack

Languages
TypeScript, JavaScript, Python, HTML, Shell, CSS, Dockerfile, Java, C++, C, Kotlin, PHP, Swift, Rust, Zig, Go, Scala
Frameworks
Express, React
Databases
Redis, PostgreSQL, SQLite
Tooling
esbuild

FAQ

Does claude-mem require a cloud account or internet connection to work?

No. The core engine runs entirely on your local machine with no internet connection required. It writes observations to a local SQLite database and serves them via a local HTTP API. The optional CMEM Cloud tier ($20/month) adds cross-device sync and a private MCP link, but the free open source version has no cloud dependency.

Which AI agents and IDEs does claude-mem support?

claude-mem installs natively into Claude Code and OpenCode via npx. It also supports Cursor, Codex CLI, Gemini CLI, Copilot, Hermes, and other MCP-compatible clients. The CMEM Cloud private MCP link extends compatibility to any agent that can connect to an MCP server. The README lists the full set of supported clients.

How does claude-mem protect sensitive information from being stored?

Wrap any content in <private> tags during a session and claude-mem will exclude it from the observation database. This handles credentials, client-specific details, or anything else you do not want persisted. All data is stored locally on your machine by default; the cloud tier uses end-to-end private keys scoped to your account.

Is the CMEM Cloud paid tier required to use claude-mem?

No. The open source engine (Apache-2.0) is fully functional without a cloud account. It stores all observations locally, runs semantic search locally via Chroma, and serves context via a local MCP worker. The $20/month CMEM Cloud tier adds cross-device sync, a mobile feed, and a private MCP link accessible from any machine.

How is claude-mem different from manually maintaining a context file?

claude-mem captures observations automatically during every agent session via lifecycle hooks, without requiring manual updates. It indexes them with semantic vector search, so retrieval at the start of a new session is ranked by relevance rather than requiring you to know what to look for. A manually maintained context file requires discipline to keep current; claude-mem requires no maintenance after the initial install.

Similar tools

More in AI Engineers