Lesson 6: claude-mem Installation, Initialization, and Directory Structure
6.1 Recommended Installation Method
Within a Claude Code session, use the following commands to install claude-mem via the plugin marketplace:
# 1. Add the marketplace source
/plugin marketplace add thedotmack/claude-mem
# 2. Install the plugin (Format: plugin_name@marketplace_name)
/plugin install claude-mem@thedotmack
# 3. Reload plugins to apply changes
/reload-plugins
Note: Avoid installing via
npm install -g claude-mem. This method only installs the SDK and will not register the necessary Hooks or the Worker process.
6.2 Verifying the Installation
After installation, you can verify it using several methods:
- Check the config file:
cat ~/.claude/plugins/installed_plugins.json | grep claude-mem - Check the plugin cache:
ls ~/.claude/plugins/cache/thedotmack/claude-mem/
6.3 Post-Initialization Directory Structure
Once you trigger a claude-mem operation for the first time (or after auto-initialization at session start), the system creates the ~/.claude-mem/ folder in your home directory:
~/.claude-mem/
├── claude-mem.db # SQLite DB for metadata and full-text index
├── chroma/ # Vector database folder
├── settings.json # Plugin settings with default values
└── logs/ # Background Worker process logs
6.4 Cross-Project Identification Logic
claude-mem automatically infers the Project ID using the Git Remote URL and current path:
- Different Worktrees of the same repository are identified as the same project.
- Different repositories are identified as separate projects.
- This mechanism ensures that cross-project searches (like
mem-search) can accurately filter relevant content.