claude-mem
БесплатноБез исполняемых скриптовНе проверенPersistent memory compression system for Claude Code enabling context preservation across sessions with automatic observations, semantic search, and privacy…
от enuno★ 17 звёзд на GitHubОб этом скилле
Claude-Mem
Claude-Mem is a persistent memory compression system for Claude Code that enables context preservation across multiple sessions. It automatically captures tool usage observations, generates semantic summaries, and makes them available to future sessions, maintaining project knowledge continuity.
Key Features
- Persistent Memory - Context survives between sessions automatically
- Folder Context Files - Auto-generated
CLAUDE.mdfiles with activity timelines - Multilingual Support - 28+ languages including Spanish, Chinese, French, Japanese
- Mode System - Switchable workflows (Code, Email Investigation, Chill)
- MCP Search Tools - Natural language queries across project history
- Web Viewer UI - Real-time memory visualization at
http://localhost:37777 - Privacy Controls -
<private>tags exclude sensitive content from storage - FTS5 Search - Full-text search across all observations
- Citation System - Reference past observations by ID
System Requirements
- Node.js: 18.0.0 or higher
- Claude Code: Latest version with plugin support
- Bun: JavaScript runtime (auto-installed if missing)
- SQLite 3: Bundled for persistent storage
Installation
Quick Start (Recommended)
# In Claude Code terminal
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
Restart Claude Code after installation. Context from previous sessions will automatically appear.
Advanced Installation (Source Build)
git clone https://github.com/thedotmack/claude-mem.git
cd claude-mem
npm install
npm run build
npm run worker:start
npm run worker:status
Verification
# Check hook installation
cat plugin/hooks/hooks.json
# View worker logs
npm run worker:logs
# Test context injection
npm run test:context
How It Works
Five-Stage Pipeline
- Session Start - Injects context from last 10 sessions
- User Prompts - Creates session and saves user input
- Tool Executions - Captures observations from Read, Write, Bash operations
- Worker Processes - Extracts learnings via Claude Agent SDK
- Session End - Generates summaries for next session
Hook Architecture
| Hook | Timeout | Purpose |
|---|---|---|
| SessionStart | 120s | Inject context from recent sessions |
| UserPromptSubmit | 60s | Create session, save prompt |
| PostToolUse | 120s | Capture tool observations |
| Stop | 60s | Generate session summary |
Captured Activities
The system records every tool interaction:
- File operations (reads, writes, edits)
- Command executions via bash
- File pattern searches and content queries
- All other Claude Code tools
Processing Pipeline
Captured observations produce:
- Brief titles describing what occurred
- Contextual subtitles
- Detailed narrative explanations
- Key learnings as bullet points
- Relevant concept tags
- Work classifications (bugfix, feature, decision, etc.)
- Affected file listings
Configuration
Environment Variables
AI Model Selection:
export CLAUDE_MEM_MODEL=sonnet # haiku, sonnet, opus
export CLAUDE_MEM_PROVIDER=claude # claude, gemini, openrouter
Provider-Specific:
# Gemini
export CLAUDE_MEM_GEMINI_API_KEY="your-key"
export CLAUDE_MEM_GEMINI_MODEL="gemini-2.5-flash-lite"
# OpenRouter
export CLAUDE_MEM_OPENROUTER_API_KEY="your-key"
export CLAUDE_MEM_OPENROUTER_MODEL="xiaomi/mimo-v2-flash:free"
Storage & Networking:
export CLAUDE_MEM_DATA_DIR=~/.claude-mem # Database location
export CLAUDE_MEM_WORKER_PORT=37777 # Service port
export CLAUDE_MEM_WORKER_HOST=127.0.0.1 # Service address
export CLAUDE_MEM_LOG_LEVEL=INFO # DEBUG, INFO, WARN, ERROR, SILENT
Context Injection:
export CLAUDE_MEM_CONTEXT_SESSION_COUNT=10 # Recent sessions to retrieve
export CLAUDE_MEM_CONTEXT_OBSERVATIONS=50 # Injected observations count
export CLAUDE_MEM_CONTEXT_FULL_COUNT=5 # Expanded observations
export CLAUDE_MEM_CONTEXT_FULL_FIELD=narrative # narrative or facts
Display Options:
export CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS=true
export CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS=true
export CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT=true
export CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY=false
export CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE=false
Tool Exclusions:
# Comma-separated list of tools to skip
export CLAUDE_MEM_SKIP_TOOLS="ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion"
Settings File
Edit ~/.claude-mem/settings.json:
{
"CLAUDE_MEM_MODEL": "sonnet",
"CLAUDE_MEM_MODE": "code",
"CLAUDE_MEM_CONTEXT_OBSERVATIONS": 50,
"CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED": false
}
Or run interactive setup:
./claude-mem-settings.sh
MCP Search Tools
Available Tools
search - Memory index lookup
Parameters:
query FTS5 search syntax
limit
Установить claude-mem в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл claude-mem?
Persistent memory compression system for Claude Code enabling context preservation across sessions with automatic observations, semantic search, and privacy controls
Как установить скилл claude-mem?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл claude-mem запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic