Built from the official docs: GitHub - thedotmack/claude-mem: Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More · raw.githubusercontent.com · checked 13 November 2026
Install for Claude Code (npx)
Check Node.js
You need Node.js 20.19 or later in the 20.x line, or 22.12 or later. On Windows, make sure Node.js and npm are on your PATH, and restart your terminal if you install it.
node --versionRun the installer
The installer finds the agents on your machine and asks which ones to set up. It auto-installs Bun and uv if they are missing.
npx claude-mem installAnswer the setup prompts
The installer sets everything up, then asks you to sign in to claude-mem in your browser with an email magic link (no card required to sign in). After sign-in you pick a memory provider: the claude-mem observer, your own OpenRouter or Gemini key, or your Anthropic plan.
Restart your agent
Restart Claude Code so it loads the hooks. Context from previous sessions will then automatically appear in new sessions.
Start working
Just start working: observations stream in from your first prompt, and your second session in a project opens with memory from the first. Memory injection starts on your second session in a project.
Check it worked
Open a second session in the same project and confirm it starts with a compact index of context from your first session. You can also run `npx claude-mem doctor`, which checks Bun, uv, the hook launcher, and the worker and tells you what to fix.