codex - 💡(How to fix) Fix unable to trust hooks, error in CLI

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  1. Error: Failed to trust hook: config/batchWrite failed while updating hook trust in TUI

Code Example

not available

---

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

---

{
  "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
          }
        ]
      }
    ]
  }
}
RAW_BUFFERClick to expand / collapse

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

<img width="1800" height="441" alt="Image" src="https://github.com/user-attachments/assets/f335531c-769e-4570-8889-49bbab709b62" />

~/.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
          }
        ]
      }
    ]
  }
}

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING