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:What Claude Mem does
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.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.
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.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.