⚠️ Experimental. Codex hooks require thecodex_hooksfeature flag, are disabled on Windows, and first shipped in Codex v0.114 (2026). Codex mirrors Claude Code's hook event model, so LoreKit reuses the same adapter — but the exact config key layout can vary between Codex versions. If a hook does not fire, check the Codex docs and adjustconfig.toml.example/hooks.json.
- Merge
config.toml.exampleinto~/.codex/config.toml(feature flag, thelorekitMCP server, and the three hooks). Fill in your endpoint + token. - Or, if your Codex build reads a standalone
hooks.json, usehooks.jsonhere instead of the[hooks.*]tables. - Append
AGENTS.snippet.mdto your project'sAGENTS.md. This is the reliable fallback for builds without hooks and reinforces the behavior when hooks are enabled.
Hooks call npx -y @lorekit/cli; npm i -g @lorekit/cli lowers latency.
Verify the connection with npx @lorekit/cli doctor.
| Event | Behavior |
|---|---|
SessionStart |
Injects scoped lessons read from LoreKit |
PostToolUse |
On a detected tool failure, nudges the agent to record a lesson (once per session) |
Stop |
Injects the retrospective nudge (once per session) |