Add handler-level quiet mode for command hooks

Open 💬 1 comment Opened May 31, 2026 by lukehinds

What version of Codex CLI is running?

0.135.0

What subscription do you have?

pro

Which model were you using?

gpt-5.5

What platform is your computer?

Darwin 24.6.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

N/A

Codex doctor report

What issue are you seeing?

Hook messages warning: hook context: and the tool name verbose in the TUI which leads to a cluttered view , with no option to opt-in or out.

What steps can reproduce the bug?

Create /tmp/demo-session-hook.sh:

#!/usr/bin/env bash
printf '%s\n' '{
  "systemMessage": "demo hook diagnostic: this should not be printed in chat when quiet",
  "hookSpecificOutput": {
    "hookEventName": "SessionStart",
    "additionalContext": "The model should still receive this hidden demo context."
  }
}'

`chmod +x /tmp/demo-session-hook.sh`

Add a hook entry (e.g. `~/.codex/hooks.json`):

```json
{
    "hooks": {
      "PreToolUse": [
        {
          "hooks": [
            {
              "type": "command",
              "command": "/tmp/demo-session-hook.sh"
            }
          ]
        }
      ]
    }
}

Start codex and "trust" the new hook and type a prompt sufficient to trigger a tool:

> ls /tmp

<img width="692" height="359" alt="Image" src="https://github.com/user-attachments/assets/173801da-d2cf-475a-a599-f981c7550f36" />

With hooks that contain many lines of text for context used by the model - this can be many lines rendered onto the screen making it ugly and unrefined.

What is the expected behavior?

allow users to set a silent flag per hook. I figure opt-in to silence is the right way so that way nothing is concealed by the user, unless they choose it to be so. We already have a 'hook' trust system, that should be sufficient.

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "some-hook.sh",
            "silent": true
          }
        ]
      }
    ]
  }
}

Additional information

Happy to make a PR, I have this fixed in a local branch. We have a codex plugin for nono, but get many reports from users who are frustrated with the lack of hook logging control in the plugin: https://registry.nono.sh/packages/always-further/codex

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗