Add Claude Code plugin scaffold for single-repo install

Consolidates plugin components (hooks, commands, skills, MCP config)
into this repo so it can be installed with:
  claude plugins install github:ViktorBarzin/claude-memory-mcp

- .claude-plugin/plugin.json: manifest with all hook events
- mcp/memory-mcp.json: MCP server config using existing src/
- hooks/: compaction survival, auto-recall, auto-learn, auto-approve
- commands/: /remember and /recall slash commands
- skills/: memory-management skill
- Bump MCP server to v2.0.0 with metaclaw migration fallback
- Update README with quick install and plugin hooks docs
This commit is contained in:
Viktor Barzin 2026-03-14 14:49:18 +00:00
parent 66bb407bae
commit 0d1cff3038
No known key found for this signature in database
GPG key ID: 0EB088298288D958
12 changed files with 653 additions and 2 deletions

View file

@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
PROTOCOL_VERSION = "2024-11-05"
SERVER_NAME = "claude-memory"
SERVER_VERSION = "1.1.0"
SERVER_VERSION = "2.0.0"
# API configuration — support both MEMORY_* (primary) and CLAUDE_MEMORY_* (fallback) env vars
API_BASE_URL = os.environ.get("MEMORY_API_URL") or os.environ.get("CLAUDE_MEMORY_API_URL", "http://localhost:8080")
@ -72,7 +72,16 @@ def _get_db_path(db_path: str | None = None) -> str:
"MEMORY_DB",
os.path.join(memory_home, "memory", "memory.db"),
)
return os.path.expandvars(os.path.expanduser(db_path))
resolved = os.path.expandvars(os.path.expanduser(db_path))
# Migration fallback: if the new path doesn't exist but legacy metaclaw path does, use that
if not os.path.exists(resolved):
legacy_home = os.path.expanduser("~/.claude/metaclaw")
legacy_db = os.path.join(legacy_home, "memory", "memory.db")
if os.path.exists(legacy_db):
return legacy_db
return resolved
def _init_sqlite(db_path: str | None = None):