Add codex platform support for Codex CLI memory capture (read now, write when hooks land)
#1271
Replies: 3 comments 2 replies
|
oh-my-codex(omx) supports hooks |
|
Hi! I prepared two upstream-ready branches for this work, but GitHub is currently blocking PR creation because the repository only allows collaborators to open pull requests.
Both branches were sculpted in clean worktrees, split into bounded commits, and re-verified before push. If useful, I can also provide request-pull summaries / patch bundles. If you prefer, please either:
Happy to adjust scope if you’d rather review one of the two first. |
|
I also put together a Codex lifecycle hook branch, then found this discussion and saw @xiaojiou176's work here. My branch: Compare: The angle is similar to the original "read now, write when hooks land" request, but using current Codex lifecycle hooks rather than only notify/transcript capture. It implements:
Verification: npm run build
git diff origin/main --check |
Uh oh!
There was an error while loading. Please reload this page.
Summary
I use both Claude Code and OpenAI Codex CLI heavily - Claude Code for complex
agentic work, Codex for its generous context limits and strong reasoning on
large tasks. Having shared persistent memory between the two would make them
genuinely complementary rather than siloed.
Current State
claude-mem already supports
claude-codeandcursorplatforms. Codex CLIsupports MCP servers natively (via config.toml), so Codex can already READ
from claude-mem today by connecting to the mcp-server.cjs MCP server.
The gap is WRITING. Codex CLI does not yet have a PostToolUse or SessionStart
hooks system equivalent to Claude Code's. It only has a
notifyconfig thatfires on
agent-turn-complete. This means automatic per-tool observationcapture isn't possible yet.
What I'm Requesting
A
codexplatform for therawhook — similar to howcursoris asupported platform. The worker already accepts
hook raw observationbutneeds to know the expected JSON input format Codex should send (message
history format, tool call format, etc.) so that observations actually get
saved rather than filtered out.
A
notify-compatible endpoint — since Codex'snotifyfires onagent-turn-completewith a JSON payload (thread-id, last-assistant-message,input-messages, cwd), the worker could accept this payload and generate a
session summary observation from it. This would give Codex at minimum
end-of-turn memory capture today, without waiting for full hooks support.
Documentation — a section in the README showing how to configure Codex
CLI's config.toml to point at the MCP server and use the notify hook.
Why This Matters
Claude Code excels at long agentic sessions, hooks-driven automation, and
complex multi-step work. Codex CLI excels at large context tasks, has a more
generous plan, and reasons well about big codebases. Used together they cover
each other's gaps. Shared memory via claude-mem would make the combination
dramatically more powerful — work done in a Codex session would be available
in Claude Code and vice versa.
Technical Details
hook raw observationalready returns exitCode 0 when calledpayload passed on stdin matters for whether observations are actually saved
notifypayload includes: type, thread-id, turn-id, cwd,input-messages, last-assistant-message
All reactions