plugin
npx claudepluginhub viablesys/claude-memfork
This fork is in maintenance mode. No new features — a complete rewrite is in design. Updates here will only address latent bugs.
~4k tokens to access ~400k tokens of work.
- By reference — inject a semantic index, fetch full observations on-demand
- By vectorization — retrieve relevant memories via similarity search
Fork of thedotmack/claude-mem with additional features for standalone deployment, Cursor IDE integration, and alternative vector backends.
For base documentation, see upstream: github.com/thedotmack/claude-mem
This fork removes automatic CLAUDE.md file generation. Memory is accessed via MCP tools only:
mcp__plugin_claude-mem_mcp-search__search # Search observations
mcp__plugin_claude-mem_mcp-search__timeline # Get context around results
mcp__plugin_claude-mem_mcp-search__get_observations # Fetch full details
Removed:
<claude-mem-context> sections in CLAUDE.md files/do and /make-plan planner commands (separation of concerns)Cleanup existing auto-generated content:
bun scripts/regenerate-claude-md.ts --clean
Path resolution supports running claude-mem without Claude Code marketplace:
| Priority | Location | Purpose |
|---|---|---|
| 1 | CLAUDE_PLUGIN_ROOT env var | Explicit override |
| 2 | ~/.claude-mem/plugin/ | Standalone installation |
| 3 | ~/.claude/plugins/marketplaces/bpd1069/ | Marketplace fallback |
Installation:
# Build from source
cd /path/to/claude-mem
bun install && bun run build
# Install to standalone location
mkdir -p ~/.claude-mem/plugin/scripts
cp plugin/scripts/*.cjs ~/.claude-mem/plugin/scripts/
cp plugin/package.json ~/.claude-mem/plugin/
cp -r plugin/modes ~/.claude-mem/plugin/
cp -r plugin/skills ~/.claude-mem/plugin/
cp -r plugin/ui ~/.claude-mem/plugin/
# Start worker
cd ~/.claude-mem && bun plugin/scripts/worker-service.cjs start
Configure MCP server and hooks for Cursor:
1. MCP Server (~/.cursor/mcp.json):
{
"mcpServers": {
"claude-mem": {
"command": "bun",
"args": ["/home/YOUR_USER/.claude-mem/plugin/scripts/mcp-server.cjs"]
}
}
}
2. Hooks (~/.cursor/hooks.json):
{
"version": 1,
"hooks": {
"beforeSubmitPrompt": [
{ "command": "bun \"/home/YOUR_USER/.claude-mem/plugin/scripts/worker-service.cjs\" hook cursor session-init" },
{ "command": "bun \"/home/YOUR_USER/.claude-mem/plugin/scripts/worker-service.cjs\" hook cursor context" }
],
"afterMCPExecution": [
{ "command": "bun \"/home/YOUR_USER/.claude-mem/plugin/scripts/worker-service.cjs\" hook cursor observation" }
],
"afterShellExecution": [
{ "command": "bun \"/home/YOUR_USER/.claude-mem/plugin/scripts/worker-service.cjs\" hook cursor observation" }
],
"afterFileEdit": [
{ "command": "bun \"/home/YOUR_USER/.claude-mem/plugin/scripts/worker-service.cjs\" hook cursor file-edit" }
],
"stop": [
{ "command": "bun \"/home/YOUR_USER/.claude-mem/plugin/scripts/worker-service.cjs\" hook cursor summarize" }
]
}
}
Replace YOUR_USER with your username. Restart Cursor after creating these files.
Note: Uses bun runtime (not node) due to bun:sqlite dependency.
| Hook | Purpose |
|---|---|
beforeSubmitPrompt | Initialize session, inject context |
afterMCPExecution | Capture MCP tool usage |
afterShellExecution | Capture shell commands |
afterFileEdit | Capture file edits |
stop | Generate session summary |
Local LLM inference via LM Studio:
{
"AI_PROVIDER": "lmstudio",
"LMSTUDIO_BASE_URL": "http://localhost:1234/v1",
"LMSTUDIO_MODEL": "ibm/granite-4-h-tiny"
}
Configure via web UI at http://localhost:37777 or in ~/.claude-mem/settings.json.
Recommended model: ibm/granite-4-h-tiny (4.2GB) — native 1M context window, efficient at ~259 output tokens/call. Load with at least 32k context: lms load ibm/granite-4-h-tiny -c 32768 -y.
Important: The init prompt is sent as role: 'system' to prevent hallucination with small models. Earlier versions sent it as role: 'user', which caused models to fabricate observations. The CLAUDE_MEM_OPENROUTER_MAX_TOKENS setting in settings.json must match the server-side context window.
The worker tracks SDK observer subprocesses to prevent accumulation: