Skip to content

Codex CLI renders hook additionalContext as visible developer message #16933

@FasterPHP

Description

@FasterPHP

Summary

Codex CLI is rendering hook hookSpecificOutput.additionalContext as a visible developer message in the session transcript.

This appears to contradict the documented behavior used by the Hindsight Codex integration, which says auto-recall should be "invisible to the transcript, visible to Codex".

Environment

  • Codex CLI version: 0.118.0
  • Platform: Linux
  • Hook integration: Hindsight Codex integration

Expected behavior

When a UserPromptSubmit hook returns:

{
  "hookSpecificOutput": {
    "hookEventName": "UserPromptSubmit",
    "additionalContext": "..."
  }
}

the additionalContext should be available to the model without being shown in the user-visible transcript.

Actual behavior

The additionalContext payload is inserted into the session as a visible developer message containing the full Hindsight memory block.

In the same setup, Codex also shows visible UI status like:

• Running Stop hook

The main bug here is the visible transcript rendering of additionalContext.

Reproduction

  1. Enable Codex hooks.
  2. Configure a UserPromptSubmit hook that returns hookSpecificOutput.additionalContext.
  3. Use the Hindsight Codex integration, or any minimal hook that returns hidden context this way.
  4. Start a session and submit a prompt.
  5. Observe that the hook context is shown in the transcript as a visible developer message.

Relevant docs

Hindsight integration docs state that auto-recall is:

  • "invisible to the transcript"
  • "visible to Codex"

Reference:

Local evidence

The Hindsight hook returns additionalContext here:

output = {
    "hookSpecificOutput": {
        "hookEventName": "UserPromptSubmit",
        "additionalContext": context_message,
    }
}
json.dump(output, sys.stdout)

And the resulting session log contains it as a visible developer message:

{"type":"response_item","payload":{"type":"message","role":"developer", ... "<hindsight_memories> ... </hindsight_memories>"}}

Notes

This may be:

  • a Codex CLI regression in how hook additionalContext is rendered, or
  • a mismatch between current Codex behavior and the documented hook contract relied on by integrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workinghooksIssues related to event hooks

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions