Skip to content

unable to trust hooks, error in CLI #22847

@Moulick

Description

@Moulick

What version of Codex CLI is running?

codex-cli 0.130.0

What subscription do you have?

Enterprise

Which model were you using?

N/A

What platform is your computer?

Darwin 25.5.0 arm64 arm

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

iTerm2

Codex doctor report

not available

What issue are you seeing?

■ Failed to trust hook: config/batchWrite failed while updating hook trust in TUI


  PreToolUse hooks
  1 hook needs review before it can run.

  [!] Hook 1 · new

  Event     PreToolUse
  Matcher   *
  Source    User config - ~/.codex/hooks.json
  Command   gryph _hook codex PreToolUse
  Timeout   30s
  Trust     New hook - review required

What steps can reproduce the bug?

  1. Launch codex
  2. type /hooks
  3. select any hook, Press enter to view hooks
  4. Press t to trust
  5. Error: Failed to trust hook: config/batchWrite failed while updating hook trust in TUI

What is the expected behavior?

Hooks are trusted and exectue

Additional information

Image

~/.codex/hooks.json

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "gryph _hook codex PostToolUse",
            "timeout": 30
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "gryph _hook codex PreToolUse",
            "timeout": 30
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "gryph _hook codex SessionStart",
            "timeout": 30
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "gryph _hook codex Stop",
            "timeout": 30
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "gryph _hook codex UserPromptSubmit",
            "timeout": 30
          }
        ]
      }
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething 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