Claude-Mem
A persistent memory plugin: stores observations from agent sessions and injects relevant context into new ones
Install
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-memRestart Claude Code after installing
This is third-party code. Review the repository files before installing.
What it does
The plugin uses lifecycle hooks to record what the agent did and what was decided, storing it in SQLite. In a new session context from past sessions is injected automatically. Memory search runs through the mem-search skill and the search, timeline and get_observations MCP tools, with hybrid search backed by Chroma. It includes a web viewer for the memory stream and tags to exclude sensitive content.
Who it is for. Developers running long projects in Claude Code who are tired of re-explaining context.
Good fit when
- You need to recall how a problem was solved last time
- The project runs for weeks and context gets lost between sessions
- You want natural language search over the agent's work history
Not a fit when
- You cannot store work history outside the project or send it to the cloud
- Short one-off tasks that need no memory
Example request
Did we already fix the auth bug? Search memory for how we solved itLimitations
Per the README the project is renamed Grok Mem, but the package is still claude-mem. The installer asks you to sign in and uses hosted memory by default, which you can skip with --provider or CLAUDE_MEM_ONLINE_OPTIN=false. npm install -g claude-mem installs only the SDK without hooks. Vector search needs uv, and the worker is managed by Bun.
How to disable. Remove the claude-mem plugin in Claude Code. Settings live in ~/.claude-mem/settings.json.
Security check
- Hooks record agent actions and tool output
- Runs a local worker with an HTTP API
- Offers hosted memory storage by default
README in short
The README covers installing via npx claude-mem install for Claude Code, OpenCode, Antigravity and others, and via the plugin marketplace. The architecture includes five lifecycle hooks, a local worker with an HTTP API, SQLite and Chroma. Search follows a three-step pattern to save tokens. Apache 2.0 license, docs at docs.claude-mem.ai.
SKILL.md
--- name: mem-search description: Search claude-mem's persistent cross-session memory database. Use when user asks "did we already solve this?", "how did we do X last time?", or needs work from previous sessions. --- # Memory Search Search past work across all sessions. Simple workflow: search -> filter -> fetch -> (rarely) disclose raw tool I/O. ## When to Use Use when users ask about PREVIOUS sessions (not current conversation): - "Did we already fix this?" - "How did we solve X last time?" - "What happened last week?" ## Layered Workflow (ALWAYS Follow) **NEVER fetch full details without filtering first. 10x token savings.** ### Step 1: Search - Get Index with IDs Use the `search` MCP tool: ``` search(query="authentication", limit=20, project="my-project") ``` **Returns:** Table with IDs, timestamps, types, titles (~50-100 tokens/result) ``` | ID | Time | T | Title | Read | |----|------|---|-------|------| | #11131 | 3:48 PM | 🟣 | Added JWT authentication | ~75 | | #10942 | 2:15 PM | 🔴 | Fixed auth token expiration | ~50 | ``` **Parameters:** - `query` (string) - Search term - `limit` (number) - Max results, default 20, max 100 - `project` (string) - Project name filter - `type` (string, optional) - "observations", "sessions", or "prompts" - `obs_type` (string, optional) - Comma-separated: bugfix, feature, decision, discovery, change - `dateStart` (string, optional) - YYYY-MM-DD or epoch ms - `dateEnd` (string, optional) - YYYY-MM-DD or epoch ms - `offset` (number, optional) - Skip N results - `orderBy` (string, optional) - "date_desc" (default), "date_asc", "relevance" ### Step 2: Timeline - Get Context Around Interesting Results Use the `timeline` MCP tool: ``` timeline(anchor=11131, depth_before=3, depth_after=3, project="my-project") ``` Or find anchor automatically from query:
FAQ
Can I skip the sign-in?
Yes. Pass an explicit --provider flag, set CLAUDE_MEM_ONLINE_OPTIN=false or run the installer in a non-interactive shell.
Why does nothing work after npm install -g?
That installs the library only. Hooks and the worker are registered via npx claude-mem install or the /plugin commands.
Related
A self-improving agent from Nous Research with a TUI, messaging gateway, cron jobs and skills it writes itself
Anthropic's coding agent for the terminal, IDE and GitHub: understands your codebase, runs tasks and handles git
OpenAI's coding agent that runs locally in your terminal, with IDE and desktop versions
Google's open-source terminal agent on Gemini models: code work, shell, web search and MCP