Claude-Mem
Claude-Mem is a persistent memory compression system built for Claude Code. It seamlessly preserves context across sessions by automatically capturing tool usage observations, generating semantic summaries, and making them available to future sessions. This enables Claude to maintain continuity of knowledge about your projects even after sessions end or reconnect.Claude-Mem operates entirely automatically. Once installed, no manual intervention is required — every session start, tool execution, and session end is handled by the plugin’s lifecycle hooks.
Key Features
Persistent Memory
Context survives across sessions. Observations from tool use, file reads, edits, and commands are stored in SQLite and re-injected into every new session.
Folder Context Files
Auto-generated
CLAUDE.md files appear in your project folders with activity timelines, giving Claude immediate project awareness on session start.MCP Search Tools
Query your full project history with natural language. Claude auto-invokes MCP tools following a 3-layer workflow for token-efficient recall.
Web Viewer UI
A real-time memory stream visualization runs at
http://localhost:37777 with infinite scroll, SSE updates, and version channel switching.Privacy Control
Wrap any content in
<private>...</private> tags to exclude it from storage entirely. Stripping happens at the hook layer before data reaches the database.Multilingual Modes
Supports 28 languages including Spanish, Chinese, French, Japanese, Portuguese, Korean, German, and more.
FTS5 Full-Text Search
Fast full-text search across all captured observations using SQLite’s FTS5 engine. Reference past observations directly by ID.
Context Configuration
11 settings for fine-grained control over what context gets injected, how many observations appear, and how summaries are displayed.
How It Works
Claude-Mem hooks into five Claude Code lifecycle events to build a complete picture of every session:Session Start — Context Injection
The
SessionStart hook queries the database for observations and summaries from the last 10 sessions in your project. Formatted context is injected into Claude’s initial context window, so Claude immediately knows what was done before.User Prompts — Session Tracking
The
UserPromptSubmit hook creates or continues a session record and saves the user’s prompt for later summarization.Tool Executions — Observation Capture
The
PostToolUse hook fires after every tool call (Read, Write, Edit, Bash, Glob, Grep, and all others). Raw tool output is sent to the worker service for processing.Worker Processing — Semantic Extraction
A background worker service (managed by Bun on port 37777) uses the Claude Agent SDK to extract structured learnings from each observation: title, narrative, facts, concepts, file references, and a classification type.
Core Components
4 Lifecycle Hooks
4 Lifecycle Hooks
Claude-Mem registers hooks for
SessionStart, UserPromptSubmit, PostToolUse, and Stop. Each hook is a compiled TypeScript ESM script built to plugin/scripts/. The hooks coordinate with the worker service via HTTP on localhost:37777.Worker Service
Worker Service
An Express HTTP API managed by Bun that runs on port 37777. It handles all AI processing asynchronously so hooks return quickly without blocking Claude. It also serves the Web Viewer UI and all search endpoints.
SQLite Database
SQLite Database
Persistent storage at
~/.claude-mem/claude-mem.db using Bun’s native bun:sqlite driver. Stores sessions, observations, and summaries with FTS5 full-text search indexing across all content.MCP Search Tools
MCP Search Tools
Three MCP tools (
search, timeline, get_observations) that Claude can invoke to query project history. Follow a 3-layer workflow for ~10x token savings: search for an index, check timeline context, then fetch full details only for relevant IDs.Web Viewer UI
Web Viewer UI
A React interface at
http://localhost:37777 with real-time SSE updates, infinite scroll, observation details, session history, and version channel management (stable ↔ beta).System Requirements
| Requirement | Version |
|---|---|
| Node.js | 18.0.0 or higher |
| Claude Code | Latest version with plugin support |
| Bun | Auto-installed if missing |
| uv | Auto-installed if missing (provides Python for Chroma) |
| SQLite 3 | Bundled |
What’s New
v9.0.0 — Live Context
v9.0.0 — Live Context
- Folder Context Files: Auto-generated
CLAUDE.mdin project folders with activity timelines - Worktree Support: Unified context from parent repos and git worktrees
- Configurable Observation Limits: Control how many observations appear in context
- Windows Fixes: Resolved IPC detection and hook execution issues
- Settings Auto-Creation:
settings.jsonnow auto-creates on first run - MCP Tools Naming: Updated terminology from “mem-search skill” to “MCP tools”
v7.1.0 — Bun Migration
v7.1.0 — Bun Migration
- Replaced PM2 with native Bun process management
- Switched from
better-sqlite3tobun:sqlitefor faster database access - Simplified cross-platform support across Windows, macOS, and Linux
v7.0.0 — Context Configuration
v7.0.0 — Context Configuration
- 11 settings for fine-grained control over context injection
- Dual-tag privacy system with
<private>tags processed at the hook layer
Next Steps
Installation
Two-command plugin install, system requirements, advanced source install, and post-install verification steps.
Getting Started
Learn how Claude-Mem works automatically: what gets captured, how context injection works, and how to search your history.
Beta Features
Try Endless Mode — an experimental biomimetic memory architecture that extends sessions beyond the standard context window limit.
Search Tools
Query your full project history with natural language using the 3-layer MCP search workflow.