Skip to main content
Claude Mem is a Claude Code plugin that gives your AI coding sessions a long-term memory. Every tool call, file read, bug fix, and architectural decision gets captured, compressed using Claude’s Agent SDK, and injected back into future sessions — automatically, with no manual intervention.

Quick Start

Install Claude Mem in two commands and start your first session with persistent memory.

How It Works

Learn how lifecycle hooks capture your work and how context gets injected into new sessions.

Memory Search

Query your entire project history with natural language using MCP search tools.

Architecture

Explore the system design: hooks, worker service, SQLite, and hybrid semantic search.

Install in two commands

Open a new Claude Code session and run:
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
Restart Claude Code. Context from your previous sessions will automatically appear at the start of every new session.

What Claude Mem does

1

Captures every tool use

The PostToolUse hook fires after every file read, write, bash command, and search. Each tool execution is sent to the background worker for AI processing.
2

Compresses into structured observations

The worker service uses the Claude Agent SDK to extract structured observations — title, narrative, facts, file references, and semantic concepts — from raw tool data.
3

Injects context into new sessions

When you start a new Claude Code session, the SessionStart hook queries the database and injects a timeline of recent observations into your session context.
4

Lets you search your history

Use the built-in MCP tools (search, timeline, get_observations) to query your entire project history with natural language — in any session.

Key features

Progressive disclosure search

3-layer MCP workflow: search index → timeline context → full details. ~10x token savings vs. naive RAG.

Privacy control

Wrap any content in <private> tags to exclude it from memory storage at the hook level.

Web viewer UI

Real-time memory stream at http://localhost:37777 with infinite scroll, project filtering, and settings.

Multiple AI providers

Use Claude, Gemini (free tier available), or any OpenRouter model for observation processing.

Mode system

Switch between coding, email investigation, and chill modes. 28+ languages supported.

OpenClaw integration

Add persistent memory to autonomous agents running on OpenClaw gateways.
Claude Mem is open source under AGPL-3.0. Source code is available at thedotmack/claude-mem.

Build docs developers (and LLMs) love