Add initial documentation for Claude-Mem plugin

- Created docs structure including introduction, installation, troubleshooting, and usage guides.
- Added detailed installation instructions with quick start and advanced options.
- Documented the automatic operation of Claude-Mem and its session management features.
- Introduced MCP search tools with usage examples and query strategies.
- Provided troubleshooting steps for common issues related to worker service, hooks, database, and search tools.
- Included system requirements and upgrade notes for transitioning from v3.x to v4.0.0.
This commit is contained in:
Alex Newman
2025-10-24 18:04:03 -04:00
parent 12149470a2
commit 8b4c962e62
25 changed files with 272 additions and 4548 deletions
@@ -1,3 +1,8 @@
---
title: "Database Architecture"
description: "SQLite schema, FTS5 search, and data storage"
---
# Database Architecture
Claude-Mem uses SQLite 3 with the better-sqlite3 native module for persistent storage and FTS5 for full-text search.
@@ -1,3 +1,8 @@
---
title: "Plugin Hooks"
description: "5 lifecycle hooks that power Claude-Mem"
---
# Plugin Hooks
Claude-Mem integrates with Claude Code through 5 lifecycle hooks that capture events and inject context.
@@ -1,3 +1,8 @@
---
title: "MCP Search Server"
description: "7 search tools with examples and usage patterns"
---
# MCP Search Server
Claude-Mem includes a Model Context Protocol (MCP) server that exposes 7 specialized search tools for querying stored observations and sessions.
@@ -1,3 +1,8 @@
---
title: "Architecture Overview"
description: "System components and data flow in Claude-Mem"
---
# Architecture Overview
## System Components
@@ -148,13 +153,13 @@ claude-mem/
## Component Details
### 1. Plugin Hooks
See [hooks.md](hooks.md) for detailed hook documentation.
See [Plugin Hooks](/architecture/hooks) for detailed hook documentation.
### 2. Worker Service
See [worker-service.md](worker-service.md) for HTTP API and endpoints.
See [Worker Service](/architecture/worker-service) for HTTP API and endpoints.
### 3. Database Layer
See [database.md](database.md) for schema and FTS5 search.
See [Database Architecture](/architecture/database) for schema and FTS5 search.
### 4. MCP Search Server
See [mcp-search.md](mcp-search.md) for search tools and examples.
See [MCP Search Server](/architecture/mcp-search) for search tools and examples.
@@ -1,3 +1,8 @@
---
title: "Worker Service"
description: "HTTP API and PM2 process management"
---
# Worker Service
The worker service is a long-running HTTP API built with Express.js and managed by PM2. It processes observations through the Claude Agent SDK separately from hook execution to prevent timeout issues.
@@ -1,3 +1,8 @@
---
title: "Configuration"
description: "Environment variables and settings for Claude-Mem"
---
# Configuration
## Environment Variables
@@ -293,6 +298,6 @@ If port 37777 is already in use:
## Next Steps
- [Architecture Overview](architecture/overview.md) - Understand the system
- [Troubleshooting](troubleshooting.md) - Common issues
- [Development](development.md) - Building from source
- [Architecture Overview](architecture/overview) - Understand the system
- [Troubleshooting](troubleshooting) - Common issues
- [Development](development) - Building from source
+8 -3
View File
@@ -1,3 +1,8 @@
---
title: "Development"
description: "Build from source, run tests, and contribute to Claude-Mem"
---
# Development Guide
## Building from Source
@@ -552,6 +557,6 @@ rm -rf plugin/scripts/*.js plugin/scripts/*.cjs
## Next Steps
- [Architecture Overview](architecture/overview.md) - Understand the system
- [Configuration](configuration.md) - Customize Claude-Mem
- [Troubleshooting](troubleshooting.md) - Common issues
- [Architecture Overview](architecture/overview) - Understand the system
- [Configuration](configuration) - Customize Claude-Mem
- [Troubleshooting](troubleshooting) - Common issues
+70
View File
@@ -0,0 +1,70 @@
{
"$schema": "https://mintlify.com/schema.json",
"name": "Claude-Mem",
"logo": {
"dark": "/logo/dark.svg",
"light": "/logo/light.svg"
},
"favicon": "/favicon.svg",
"colors": {
"primary": "#3B82F6",
"light": "#EFF6FF",
"dark": "#1E40AF",
"background": {
"dark": "#0F172A",
"light": "#FFFFFF"
}
},
"topbarLinks": [
{
"name": "GitHub",
"url": "https://github.com/thedotmack/claude-mem"
}
],
"topbarCtaButton": {
"name": "Install",
"url": "https://github.com/thedotmack/claude-mem#quick-start"
},
"tabs": [
{
"name": "Documentation",
"url": "/"
},
{
"name": "Architecture",
"url": "/architecture"
}
],
"navigation": [
{
"group": "Get Started",
"pages": [
"introduction",
"installation",
"usage/getting-started",
"usage/search-tools"
]
},
{
"group": "Configuration & Development",
"pages": [
"configuration",
"development",
"troubleshooting"
]
},
{
"group": "Architecture",
"pages": [
"architecture/overview",
"architecture/hooks",
"architecture/worker-service",
"architecture/database",
"architecture/mcp-search"
]
}
],
"footerSocials": {
"github": "https://github.com/thedotmack/claude-mem"
}
}
@@ -1,3 +1,8 @@
---
title: "Installation"
description: "Install Claude-Mem plugin for persistent memory across sessions"
---
# Installation Guide
## Quick Start
@@ -99,10 +104,10 @@ v4.0.0 introduces breaking changes:
- **MCP Search Server**: 7 new search tools with full-text search and citations
- **Enhanced Architecture**: Improved plugin integration and data organization
See [CHANGELOG.md](../CHANGELOG.md) for complete details.
See [CHANGELOG](https://github.com/thedotmack/claude-mem/blob/main/CHANGELOG.md) for complete details.
## Next Steps
- [Getting Started Guide](usage/getting-started.md) - Learn how Claude-Mem works automatically
- [MCP Search Tools](usage/search-tools.md) - Query your project history
- [Configuration](configuration.md) - Customize Claude-Mem behavior
- [Getting Started Guide](usage/getting-started) - Learn how Claude-Mem works automatically
- [MCP Search Tools](usage/search-tools) - Query your project history
- [Configuration](configuration) - Customize Claude-Mem behavior
+96
View File
@@ -0,0 +1,96 @@
---
title: "Introduction"
description: "Persistent memory compression system for Claude Code"
---
# Claude-Mem
**Persistent memory compression system for Claude Code**
Claude-Mem 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 projects even after sessions end or reconnect.
## Quick Start
Start a new Claude Code session in the terminal and enter the following commands:
```bash
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
```
Restart Claude Code. Context from previous sessions will automatically appear in new sessions.
## Key Features
- 🧠 **Persistent Memory** - Context survives across sessions
- 🔍 **7 Search Tools** - Query your project history via MCP
- 🤖 **Automatic Operation** - No manual intervention required
- 📊 **FTS5 Search** - Fast full-text search across observations
- 🔗 **Citations** - Reference past decisions with `claude-mem://` URIs
## How It Works
```
┌─────────────────────────────────────────────────────────────┐
│ Session Start → Inject context from last 10 sessions │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ User Prompts → Create session, save user prompts │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Tool Executions → Capture observations (Read, Write, etc.) │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Worker Processes → Extract learnings via Claude Agent SDK │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Session Ends → Generate summary, ready for next session │
└─────────────────────────────────────────────────────────────┘
```
**Core Components:**
1. **5 Lifecycle Hooks** - SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd
2. **Worker Service** - HTTP API on port 37777 managed by PM2
3. **SQLite Database** - Stores sessions, observations, summaries with FTS5 search
4. **7 MCP Search Tools** - Query historical context with citations
See [Architecture Overview](architecture/overview) for details.
## System Requirements
- **Node.js**: 18.0.0 or higher
- **Claude Code**: Latest version with plugin support
- **PM2**: Process manager (bundled - no global install required)
- **SQLite 3**: For persistent storage (bundled)
## What's New in v4.2.3
**Security:**
- Fixed FTS5 injection vulnerability in search functions
- Added comprehensive test suite with 332 injection attack tests
**Fixes:**
- Fixed ESM/CJS compatibility for getDirname function
- Fixed Windows PowerShell compatibility in SessionStart hook
- Cross-platform dependency installation now works on Windows, macOS, and Linux
## Next Steps
<CardGroup cols={2}>
<Card title="Installation" icon="download" href="/installation">
Quick start & advanced installation
</Card>
<Card title="Getting Started" icon="rocket" href="/usage/getting-started">
Learn how Claude-Mem works automatically
</Card>
<Card title="Architecture" icon="sitemap" href="/architecture/overview">
System components & data flow
</Card>
<Card title="Search Tools" icon="magnifying-glass" href="/usage/search-tools">
Query your project history
</Card>
</CardGroup>
@@ -1,3 +1,8 @@
---
title: "Troubleshooting"
description: "Common issues and solutions for Claude-Mem"
---
# Troubleshooting Guide
## Worker Service Issues
@@ -664,6 +669,6 @@ If none of these solutions work:
## Next Steps
- [Configuration](configuration.md) - Customize Claude-Mem
- [Development](development.md) - Build from source
- [Architecture](architecture/overview.md) - Understand the system
- [Configuration](configuration) - Customize Claude-Mem
- [Development](development) - Build from source
- [Architecture](architecture/overview) - Understand the system
@@ -1,3 +1,8 @@
---
title: "Getting Started"
description: "Learn how Claude-Mem works automatically in the background"
---
# Getting Started with Claude-Mem
## Automatic Operation
@@ -166,6 +171,6 @@ When you use `/clear`, the session doesn't end - it continues with a new prompt
## Next Steps
- [MCP Search Tools](search-tools.md) - Learn how to search your project history
- [Architecture Overview](../architecture/overview.md) - Understand how it works
- [Troubleshooting](../troubleshooting.md) - Common issues and solutions
- [MCP Search Tools](/usage/search-tools) - Learn how to search your project history
- [Architecture Overview](/architecture/overview) - Understand how it works
- [Troubleshooting](/troubleshooting) - Common issues and solutions
@@ -1,3 +1,8 @@
---
title: "MCP Search Tools"
description: "Query your project history with 7 specialized search tools"
---
# MCP Search Tools Usage
Once claude-mem is installed as a plugin, 7 search tools become available in your Claude Code sessions for querying project history.
@@ -416,6 +421,6 @@ search_sessions with query="[YOUR PROJECT NAME]" and orderBy="date_desc"
## Next Steps
- [MCP Search Architecture](../architecture/mcp-search.md) - Technical details
- [Database Schema](../architecture/database.md) - Understanding the data
- [Getting Started](getting-started.md) - Automatic operation
- [MCP Search Architecture](/architecture/mcp-search) - Technical details
- [Database Schema](/architecture/database) - Understanding the data
- [Getting Started](/usage/getting-started) - Automatic operation