claude-mem
CLI Toolthedotmack/claude-mem
Claude Code plugin for persistent AI memory across sessions.
Overview
Claude-Mem automatically captures and compresses Claude's observations during coding sessions, storing them for future context injection. It uses AI summarization and vector search to retrieve relevant memories, enabling continuity across sessions.
README Preview
\n \n \n \n \n \n \n \n \n \n\n\n\n 🇨🇳 中文 •\n 🇹🇼 繁體中文 •\n 🇯🇵 日本語 •\n 🇵🇹 Português •\n 🇧🇷 Português •\n 🇰🇷 한국어 •\n 🇪🇸 Español •\n 🇩🇪 Deutsch •\n 🇫🇷 Français •\n 🇮🇱 עברית •\n 🇸🇦 العربية •\n 🇷🇺 Русский •\n 🇵🇱 Polski •\n 🇨🇿 Čeština •\n 🇳🇱 Nederlands •\n 🇹🇷 Türkçe •\n 🇺🇦 Українська •\n 🇻🇳 Tiếng Việt •\n 🇵🇭 Tagalog •\n 🇮🇩 Indonesia •\n 🇹🇭 ไทย •\n 🇮🇳 हिन्दी •\n 🇧🇩 বাংলা •\n 🇵🇰 اردو •\n 🇷🇴 Română •\n 🇸🇪 Svenska •\n 🇮🇹 Italiano •\n 🇬🇷 Ελληνικά •\n 🇭🇺 Magyar •\n 🇫🇮 Suomi •\n 🇩🇰 Dansk •\n 🇳🇴 Norsk\n\n\nPersistent memory compression system built for Claude Code.\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n \n \n \n \n \n \n \n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n Quick Start •\n How It Works •\n Search Tools •\n Documentation •\n Configuration •\n Troubleshooting •\n License\n\n\n\n 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.\n\n\n---\n\n## Quick Start\n\nInstall with a single command:\n\n```bash\nnpx claude-mem install\n```\n\nOr install for Gemini CLI (auto-detects `~/.gemini`):\n\n```bash\nnpx claude-mem install --ide gemini-cli\n```\nOr install for OpenCode:\n\n```bash\nnpx claude-mem install --ide opencode\n```\n\nOr install from the plugin marketplace inside Claude Code:\n\n```bash\n/plugin marketplace add thedotmack/claude-mem\n\n/plugin install claude-mem\n```\n\nRestart Claude Code or Gemini CLI. Context from previous sessions will automatically appear in new sessions.\n\n> **Note:** Claude-Mem is also published on npm, but
FAQ (5)
TroubleshootingWhy does claude-mem auto-load a specific model in LM Studio, causing high memory usage?
claude-mem previously hardcoded a default model (e.g., claude-haiku-4-5-20251001), which forced LM Studio to load that model even when not needed. Update to claude-mem v13.4.0 or later—this version changes the default CLAUDE_MEM_MODEL to an empty string, so observer sessions inherit the parent session’s model and avoid unwanted model loads. For older versions, manually set CLAUDE_MEM_MODEL to "" in your settings.
TroubleshootingHow to reduce high AI compression costs in claude-mem by switching to DeepSeek?
Upgrade claude-mem to v13.4.0 or later. In the worker's provider dropdown, select DeepSeek as the native provider. Enter your DeepSeek API key (sk-...). Configure models: use deepseek-v4-flash for simple tier and deepseek-v4-pro for summary tier (DeepSeek costs ~1/10th of Claude Haiku). Alternatively, set environment variables: CLAUDE_MEM_PROVIDER=deepseek, CLAUDE_MEM_DEEPSEEK_API_KEY=sk-xxx, CLAUDE_MEM_MODEL=deepseek-v4-flash. This replaces the old workaround of editing ~/.claude-mem/.env manually.
TroubleshootingHow to prevent claude-mem from polluting directories with empty CLAUDE.md skeleton files?
Upgrade to claude-mem v13.4.0 (released with PR #2701) which introduces a configurable deny-list to suppress skeleton injection in directories like .git, .venv, fixtures, etc. For versions prior to v13.4.0, a workaround is to add **/CLAUDE.md to your project's .gitignore and then use ! un-ignore patterns for legitimate tracked CLAUDE.md files (e.g., !/CLAUDE.md).
TroubleshootingWhy are file observations not injected during PreToolUse when working in subdirectories in claude-mem?
This bug was caused by a path inconsistency: PostToolUse stored observation paths relative to the current working directory, while PreToolUse looked them up relative to the project root. This broke context injection when the working directory changed. Fixed in claude-mem v13.4.0—upgrade to that version or later. If you cannot upgrade immediately, a temporary workaround is to keep your working directory at the project root during all file operations.
TroubleshootingWhy do I get 'printf: write error: Permission denied' when using claude-mem hooks in Claude Code on Windows?
This is a known MSYS2 bug where bash's printf fails inside process substitution $() on Windows. Workaround: replace printf '%s\\n' with echo in all hooks/hooks.json files (marketplace and cached copies). Reinstalling claude-mem overwrites changes, so reapply after updates. If the error persists, temporarily disable hooks in Claude Code settings. A permanent fix is tracked in the issue.