feat(hook): add Codex PreToolUse integration#368
Conversation
|
@dergachoff I am looking into this. Will report back soon. |
Filter Verification ReportChanged FiltersNo filter files changed in this PR. All Filters Summary✅ 143/143 test cases passed across 51 filters Generated by |
|
@mpecan I refactored the shared hook install helpers into a separate module so |
|
Hey, @dergachoff, looks good overall, but I had a couple of questions:
|
|
Thanks @mpecan, all fair points!
I also set codex back to Finally, I added a short comment documenting that codex rewrite responses intentionally drop the engine reason in favor of the exact rerun hint. In my personal testing this was enough to get intended result from codex. "Why spend many tokens when few do trick" :) |
|
@mpecan Noticed that codex 0.131.0 alpha has updatedInput enabled: openai/codex#20527 |
|
@dergachoff I think the value proposition is higher with an actual |
752b76a to
29efdf1
Compare
|
@mpecan codex 0.131.0 finally landed so I've updated PR with |
Closes #367.
Problem
Codex installs only got tokf guidance skills, so output filtering depended on Codex remembering to run
tokf run .... Claude Code already gets a real hook that rewrites matching commands before execution.Root cause
tokf had no Codex
PreToolUsehook integration. Newer Codex supportsupdatedInput, but older builds parse it without applying it, so unconditional transparent rewrites would fail open.Fix
Add first-class Codex hook support:
tokf hook handle --format codextokf hook install --tool codexwrites.codex/hooks.json/~/.codex/hooks.jsoncodex --versionselects the generated shim mode:0.131.0+: transparentupdatedInputrewriteRun with tokf: ...--format codexdefaults to the conservative deny-rerun modeCodex still has no native ask flow, so ask decisions stay conservative.
Validation