examples/claude-code-memory-plugin/MIGRATION.md
This guide helps you migrate from the legacy claude-memory-plugin to the new claude-code-memory-plugin.
| Aspect | Old Plugin (claude-memory-plugin) | New Plugin (claude-code-memory-plugin) |
|---|---|---|
| Architecture | Bash hooks + Python bridge (ov_memory.py) | Native MCP server + Node.js hooks |
| Auto-Recall | Skill-based, requires explicit invocation | Transparent, injected via UserPromptSubmit hook |
| Memory Capture | Accumulates on Stop, commits on SessionEnd (async) | Incremental capture on each Stop (sync, safer) |
| Crash Safety | Risk of losing accumulated turns if Claude crashes before SessionEnd | Each turn persisted independently — no data loss |
| Type Safety | Shell + Python, no compile-time checks | TypeScript MCP server, compiled JS artifact |
| Tool Discovery | Custom skill file | Standard MCP tools (memory_recall, memory_store, etc.) |
| Config Scope | Project-local (./ov.conf) | Global (~/.openviking/ov.conf) — works across all projects |
| Runtime Bootstrap | Manual setup required | Auto-bootstrap on first SessionStart into ${CLAUDE_PLUGIN_DATA} |
Incremental Capture = Crash-Resilient: The old approach batches all turns until SessionEnd. If Claude crashes or the user kills the session, those memories are lost. The new plugin extracts on every Stop, so each turn is independently persisted.
Transparent Auto-Recall: No skill invocation needed — memories are automatically injected into context via systemMessage on every prompt. This matches the mental model of "memory just works."
MCP Native: Standard protocol, better tooling support, type-safe TypeScript implementation. Other MCP-compatible clients can potentially reuse the same server.
Global Configuration: One config file for all projects (~/.openviking/ov.conf), not per-project ./ov.conf files.
One design choice worth explaining in detail:
In practice, auto-capturing assistant turns in coding scenarios has proven problematic:
VLM Token Cost: Each capture triggers an LLM extraction call to OpenViking. Capturing every assistant turn (including tool calls, sub-agent outputs, etc.) quickly becomes expensive.
Signal-to-Noise Ratio: Claude Code's assistant messages often contain verbose tool outputs, file contents, and nested sub-agent traces. These rarely contain memorable personal context — the valuable signal is typically in the user's questions, decisions, and stated preferences.
Coding Workflow Nature: For coding tasks, "memory" is often about:
These almost always originate from the user, not the assistant.
The plugin defaults to captureAssistantTurns: false — only user messages are considered for auto-capture. This keeps token usage manageable while still preserving the most valuable context.
Users can opt-in to full capture by setting "captureAssistantTurns": true in their ov.conf if they want assistant turns included (e.g., for non-coding workflows where assistant insights matter).
Move your config from project root to the global location:
# Old location (per-project)
./ov.conf
# New location (global)
~/.openviking/ov.conf
If you have project-specific configs, merge them into the global config. The new plugin supports a claude_code section for plugin-specific overrides.
The new plugin requires Node.js. Ensure Node.js 18+ is installed:
node --version # Should be 18.x or higher
# Uninstall old plugin (if installed via marketplace)
/plugin uninstall openviking-memory
# Install new plugin
/plugin marketplace add Castor6/openviking-plugins
/plugin install claude-code-memory-plugin@openviking-plugin
Delete the old plugin directory from your project if it was checked in:
rm -rf ./.openviking/memory/
Add the claude_code section to ~/.openviking/ov.conf for plugin-specific settings:
{
"claude_code": {
"agentId": "claude-code",
"recallLimit": 6,
"captureMode": "semantic",
"captureTimeoutMs": 30000,
"captureAssistantTurns": false
}
}
| Old Plugin | New Plugin |
|---|---|
Run /memory-recall <query> manually | Automatic recall on every prompt |
| Skill-based, requires Claude tool call | Transparent, injected as system context |
The new plugin automatically injects relevant memories into the context before each prompt. No manual action needed.
| Old Plugin | New Plugin |
|---|---|
Captures at SessionEnd (batch) | Captures at Stop (incremental) |
| Requires explicit commit | Automatic, real-time |
The new plugin captures memories incrementally after each turn, providing faster feedback and better persistence.
The new plugin provides MCP tools for explicit memory operations:
| Tool | Description |
|---|---|
memory_recall | Manual semantic search |
memory_store | Manually store a memory |
memory_forget | Delete memories by URI or query |
memory_health | Check server status |
These tools are available when you need explicit control over memory operations.
| Issue | Solution |
|---|---|
| MCP tools not available | Start a new Claude session; first run installs runtime deps |
| No memories recalled | Ensure OpenViking server is running: openviking-server |
| Hook timeout | Increase timeout in hooks/hooks.json |