Compatibility matrix
Each agent's hook protocol and the lifecycle events it emits. All seven are detected automatically — no --agent flag required.
Claude Code
Anthropic. Marker: stop_hook_active / precompact. Events: stop, precompact, session_start.
Codex CLI
OpenAI. Marker: session_id + context_dir. Events: session_start, session_stop, stop, precompact.
Gemini CLI
Google. Marker: conversation_id + extensions. Events: stop, session_start.
OpenCode
anomalyco/sst. Marker: provider dict + openCodeVersion. Events: stop, session_stop, session_start, precompact.
Pi
kachow-compatible. Marker: event in the Pi event set. Events: session_start, session_shutdown, pre_compact, tool_call, turn_end.
OpenClaw
Marker: openclaw in payload. Events: stop, session_stop, precompact, session_start.
Generic
Fallback for any unrecognized payload. Works with any agent that can pipe JSON to a hook — including custom frameworks.
Use the generic adapterDetection priority
When multiple markers could match, the most-specific wins. Order is fixed:
OpenClaude → Claude Code → Codex → Gemini CLI → OpenClaw → OpenCode → Pi → Generic
You can override auto-detection with --agent <name> on any memorius-hook command.
Three ways to integrate
| Method | Best for | How |
|---|---|---|
| MCP server | Any MCP-compatible agent (Claude Code, Codex, Gemini, Cursor, Aider…) | Point the agent at memorius serve. See MCP Server. |
| Agent hooks | Auto-capture at session boundaries | Generate per-agent hook scripts with memorius-plugin-gen. See Hooks. |
| Agent skill | Hermes-compatible agents that should use memorius proactively | One npx command. See Install the skill. |
Plug in your own agent
Memorius is agent-agnostic by design. Two paths for a custom agent:
- Generic hook adapter. Pipe your agent's event JSON to
memorius-hook. TheGenericfallback handles any unrecognized payload — no marker needed. - A new marker. Add a recognition rule to the hook engine's detection table so your agent gets its own adapter (events, actions) instead of the generic path.
Repository
Memorius is MIT-licensed and fully open source. Star the repo, open an issue, or dig into the source on GitHub.