codex - 💡(How to fix) Fix Support "Edit|Write" matcher in PostToolUse and PreToolUse [1 comments, 2 participants]

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…
GitHub stats
openai/codex#18295Fetched 2026-04-18 05:56:36
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×4unlabeled ×2commented ×1renamed ×1

Code Example

{ 
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": ""
          }
        ]
      }
    ],
  }
}
RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

analyze generated code and tools calling.

What feature would you like to see?

like claude code, support Edit|Write matcher in PostToolUse

{ 
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": ""
          }
        ]
      }
    ],
  }
}

Additional information

the raw request from this issue, https://github.com/openai/codex/issues/2109#issuecomment-4263194142

extent analysis

TL;DR

The issue can be addressed by modifying the PostToolUse hook configuration to correctly support the Edit|Write matcher.

Guidance

  • Review the PostToolUse hook configuration to ensure the matcher field is correctly set to Edit|Write and the command field is properly defined.
  • Verify that the Codex version being used supports the Edit|Write matcher in the PostToolUse hook.
  • Check the documentation for any specific requirements or limitations for using the Edit|Write matcher.
  • Test the modified configuration to ensure it works as expected.

Example

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "echo 'Edit or Write command executed'"
          }
        ]
      }
    ],
  }
}

Notes

The provided configuration snippet seems to be missing a command for the Edit|Write matcher. The example above includes a simple command for demonstration purposes.

Recommendation

Apply workaround: Modify the PostToolUse hook configuration to include a valid command for the Edit|Write matcher, as shown in the example.

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