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 |
| OpenClaw | OpenClaw plugin |
| Claude Desktop or other MCP clients | MCP server (manual lifecycle) |
Feature Comparison
| Feature | Claude Code Hooks | OpenClaw Plugin |
|---|---|---|
| Setup | kernle setup claude-code | openclaw plugins install |
| Config format | .claude/settings.json | OpenClaw plugin config |
| Memory loading | SessionStart hook | before_agent_start hook |
| Auto-checkpoint | PreCompact + SessionEnd | agent_end hook |
| Write interception | PreToolUse (Write/Edit/NotebookEdit) | before_tool_call (write_file/edit_file/create_file) |
| Compaction awareness | Yes — saves checkpoint before context compaction | No — OpenClaw doesn’t expose compaction events |
| Stack ID resolution | Env var, --stack flag, or directory name | Plugin config, env var, session key, or directory name |
| Global vs project | Both (--global flag) | Per-workspace |
| MCP tools alongside | Yes — use hooks for lifecycle, MCP for in-session tools | Yes — same approach |
| Transcript access | PreCompact/SessionEnd read transcript for checkpoint | agent_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:- Load memory at session start (duplicate load is harmless but wastes tokens)
- Save a checkpoint at session end (duplicate checkpoint is mostly harmless)
- Intercept memory file writes (the first hook to fire wins)
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
Migration Between Integrations
OpenClaw to Claude Code
-
Remove the OpenClaw plugin:
-
Set up Claude Code hooks:
- Memory data stays in the same stack — no migration needed.
Claude Code to OpenClaw
-
Remove hooks from
.claude/settings.json(delete thekernle hookentries). -
Install the OpenClaw plugin:
- Memory data stays in the same stack — no migration needed.