Claude-Mem
Records agent sessions, compresses with AI, and pulls relevant context back into later ones.
What it is
After you install it and restart your agent, Claude-Mem listens for lifecycle events and tool calls during each session, compresses changed code, troubleshooting steps and project background into semantic summaries, and stores them along with the raw records in a local SQLite database; when a new session starts, it puts the relevant records back into context as needed, so you can carry on from the previous session without re-explaining the current state of the codebase and existing decisions. It runs locally and is a layer that gives coding agents cross-session memory; it was originally built around Claude Code and now also hooks into OpenCode, Codex, Gemini, OpenClaw, Hermes, Copilot and others.
Compared with maintaining documentation by hand or pasting whole chat logs, capture and retrieval happen automatically with the session, and reading is layered: a compact index first, then the timeline and the full records when needed, rather than stuffing the entire history into context at once.
How it runs
Requires Node.js 20 or later. Claude Code and OpenCode are hooked up through the installer:
npx claude-mem install
npx claude-mem install --ide opencodeThe installer registers the plugin hooks and starts the Worker; running npm install -g claude-mem globally only installs the SDK and does not complete these integration steps. After installing, restart the corresponding agent so that new sessions automatically read the existing memories.
Core mechanics
- Lifecycle capture: records activity at nodes such as session start, prompt submission, after tool calls, stop and end.
- Local persistence: the Worker runs as a local HTTP service, and SQLite stores sessions, observations and summaries.
- Hybrid retrieval: full-text search plus Chroma vector search to find relevant content in the history.
- Layered reading: returns a compact index first, then the timeline on demand, and finally reads the full record by ID, controlling how much information is injected into context.
Who it is for
It suits individual developers who maintain the same codebase long term and switch sessions frequently, and teams that want multiple compatible agents to carry forward project decisions, troubleshooting processes and implementation details. Search results come with observation IDs, so you can trace the history behind a given change.
Boundaries
Running it depends on Node.js; Bun and the uv needed for vector search are handled by the install process. Data is stored on your machine by default, but sensitive content is not excluded automatically — you need to actively block storage with the <private> tag. The project is licensed under Apache-2.0, local memory does not depend on a hosted service; cloud sync is an optional entry point.