Skip to content

Add handler-level quiet mode for command hooks #25403

Open

Description

@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

Image

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

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    hooksIssues related to event hooks
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on May 31, 2026
  2. lukehinds commented on May 31, 2026

    @lukehinds
    Author

    I attempted to contribute a fix , but I think I was blocked by branch protections:

    fe4b378

  3. removed
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    CLIIssues related to the Codex CLI
    bugSomething isn't working
    on May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthooksIssues related to event hooks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions