Claude Mem0 Project Memory Plugin
🧠 Intelligent long-term memory management for Claude Code using Mem0

Features
- ✅ Auto-Capture: Automatically captures decisions, patterns, and learnings during coding sessions
- 🔍 Semantic Search: Find relevant context from past work using natural language
- 🔄 Smart Sync: Keeps your CLAUDE.md updated with important patterns
- 🎯 Project-Scoped: Memory is organized per-project with semantic tagging
- 🧠 Agent Skill: Claude automatically recalls relevant memories when needed
- 🛠️ Explicit Control: Slash commands for manual memory management
- 🪝 Hook-Based: Automated workflows via SessionStart, SessionEnd, and PostToolUse hooks
Installation
Prerequisites
- Mem0 Account: Sign up at mem0.ai and get your API key
- Node.js: Required for
@mem0/mcp-server
- jq: For JSON processing in hooks (
brew install jq / apt install jq)
Setup
1. Clone this repository
git clone https://github.com/evgenygurin/claude-mem0-project-memory.git
cd claude-mem0-project-memory
2. Make scripts executable
chmod +x scripts/*.sh
3. Install in your project
cd /path/to/your/project
mkdir -p .claude/plugins
cp -r /path/to/claude-mem0-project-memory .claude/plugins/
4. Configure environment
Add to your shell profile or .env:
export MEM0_API_KEY="your-mem0-api-key"
export MEM0_USER_ID="your-user-id" # optional, defaults to project name
5. Enable in Claude Code
/settings plugins
# Enable claude-mem0-project-memory
Usage
🤖 Automatic Mode
Once enabled, the plugin automatically:
- Initializes at session start
- Tracks changes as you edit code (Write/Edit tool usage)
- Recalls memories when relevant context exists (via agent skill)
- Auto-saves to Mem0 at session end (SessionEnd hook)
- Captures session summary with change count
- Stores directly to Mem0 via API (no manual intervention needed)
- Includes metadata: project, timestamp, type, changes count
- Notifies when sync threshold is reached (5+ changes)
📝 Manual Commands
Capture Memory
/mem0-capture We standardized error handling to always use Result<T, AppError> pattern
Search Memory
/mem0-search error handling patterns
/mem0-search database migration decisions
Sync to CLAUDE.md
/mem0-sync # Sync all memories
/mem0-sync decisions # Sync only decisions
Reflect on Sessions
/mem0-reflect # Analyze last 5 sessions
/mem0-reflect 10 # Analyze last 10 sessions
Configuration
Edit .claude/plugins/claude-mem0-project-memory/config/memory-config.json:
{
"auto_capture": true, // Enable hooks (tracking, notifications)
"auto_add_to_mem0": true, // Auto-save session summaries to Mem0
"sync_to_claude_md": true, // Auto-sync to CLAUDE.md
"auto_load_context": false, // Load memories at session start
"reflection_threshold": 5, // Changes before suggesting sync
"skill_settings": {
"auto_recall_enabled": true, // Enable automatic memory recall
"recall_threshold": 0.75, // Minimum relevance for auto-recall
"max_context_memories": 5 // Max memories to load per recall
},
"hook_settings": {
"session_start_init": true, // Initialize at session start
"track_tool_usage": true, // Track Write/Edit events
"log_mem0_calls": false, // Debug logging (verbose)
"min_changes_for_capture": 3, // Minimum edits before capture
"capture_session_summary": true, // Capture session summaries
"capture_significant_changes": false // Capture individual changes (verbose)
}
}
Key Settings
auto_add_to_mem0: When true, SessionEnd hook automatically adds session summary to Mem0 via API
capture_session_summary: Control whether session summaries are captured
capture_significant_changes: (Future) Capture individual significant code changes
Architecture