Skip to main content

Choosing an Integration

Kernle ships two integration paths for automatic memory management. Both provide the same core lifecycle — load at start, checkpoint at end, write interception — but they differ in platform, setup, and extensibility.

Quick Decision

If you use…Use this integration
Claude Code (CLI claude)Claude Code hooks
OpenClawOpenClaw plugin
Claude Desktop or other MCP clientsMCP server (manual lifecycle)
If you use both Claude Code and OpenClaw for the same SI, pick one for automatic lifecycle and use the other with manual commands only. Running both auto-lifecycle integrations on the same stack will cause duplicate checkpoints.

Feature Comparison

FeatureClaude Code HooksOpenClaw Plugin
Setupkernle setup claude-codeopenclaw plugins install
Config format.claude/settings.jsonOpenClaw plugin config
Memory loadingSessionStart hookbefore_agent_start hook
Auto-checkpointPreCompact + SessionEndagent_end hook
Write interceptionPreToolUse (Write/Edit/NotebookEdit)before_tool_call (write_file/edit_file/create_file)
Compaction awarenessYes — saves checkpoint before context compactionNo — OpenClaw doesn’t expose compaction events
Stack ID resolutionEnv var, --stack flag, or directory namePlugin config, env var, session key, or directory name
Global vs projectBoth (--global flag)Per-workspace
MCP tools alongsideYes — use hooks for lifecycle, MCP for in-session toolsYes — same approach
Transcript accessPreCompact/SessionEnd read transcript for checkpointagent_end uses conversation messages

Can They Coexist?

On different machines or projects — yes, no conflicts. On the same project — avoid running both. Each integration will:
  1. Load memory at session start (duplicate load is harmless but wastes tokens)
  2. Save a checkpoint at session end (duplicate checkpoint is mostly harmless)
  3. Intercept memory file writes (the first hook to fire wins)
If you need to switch:
# Remove Claude Code hooks
# Delete the kernle-related hooks from .claude/settings.json

# Or remove OpenClaw plugin
openclaw plugins uninstall kernle

When to Use MCP Instead

The MCP server (kernle mcp) is not an automatic lifecycle integration — it provides tools that the SI calls on demand (memory_search, memory_save_episode, memory_anxiety, etc.). Use MCP when:
  • Your client doesn’t support hooks or plugins (e.g., Claude Desktop)
  • You want the SI to control when memory loads/saves happen
  • You need in-session memory tools alongside either integration
MCP and hooks complement each other. The typical setup is hooks for automatic lifecycle + MCP for in-session operations.

Migration Between Integrations

OpenClaw to Claude Code

  1. Remove the OpenClaw plugin:
    openclaw plugins uninstall kernle
    
  2. Set up Claude Code hooks:
    kernle setup claude-code
    
  3. Memory data stays in the same stack — no migration needed.

Claude Code to OpenClaw

  1. Remove hooks from .claude/settings.json (delete the kernle hook entries).
  2. Install the OpenClaw plugin:
    cd kernle/integrations/openclaw
    npm install && npm run build
    openclaw plugins install ./integrations/openclaw
    
  3. Memory data stays in the same stack — no migration needed.