feat(codex): Hindsight memory integration for OpenAI Codex CLI#713
Closed
benfrank241 wants to merge 1 commit intomainfrom
Closed
feat(codex): Hindsight memory integration for OpenAI Codex CLI#713benfrank241 wants to merge 1 commit intomainfrom
benfrank241 wants to merge 1 commit intomainfrom
Conversation
Hooks-based integration that gives Codex CLI long-term memory via Hindsight.
Three hooks keep memory in sync: SessionStart (daemon pre-warm), UserPromptSubmit
(recall + context injection), Stop (retain conversation to memory).
Key differences from the Claude Code integration:
- Codex transcript format: JSONL with {msg: {type, message}} (user_message/agent_message)
- No CODEX_PLUGIN_ROOT env var — install.sh writes hooks.json with absolute paths
- State stored in ~/.hindsight/codex/state/ (not CLAUDE_PLUGIN_DATA)
- No async: true in hooks (not supported by Codex)
- No SessionEnd event
- hooks.json written to ~/.codex/hooks.json with codex_hooks = true in config.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SessionStart(daemon pre-warm),UserPromptSubmit(recall + context injection),Stop(retain conversation)install.shcopies scripts to~/.hindsight/codex/scripts/, writes~/.codex/hooks.jsonwith absolute paths, and enablescodex_hooks = truein~/.codex/config.tomlhindsight-embeddaemon modeKey differences from Claude Code integration
{type: "user", message: {role, content}}{msg: {type: "user_message", message: "..."}}~/.codex/hooks.json(written byinstall.sh)$CLAUDE_PLUGIN_ROOT$CLAUDE_PLUGIN_DATA/state/~/.hindsight/codex/state/~/.hindsight/claude-code.json~/.hindsight/codex.jsonasync: truesupportedTest plan
python3 -c "from lib.config import load_config; from lib.content import read_transcript"imports cleanlyuser_message→role: user,agent_message→role: assistant, skips other event typesinstall.shwrites hooks.json with correct absolute pathsinstall.sh --uninstallremoves hooks.json and codex_hooks flaghookSpecificOutput.additionalContextJSONFiles