hey, love the hooks system — been using it heavily.
one thing that's missing compared to claude code's hook model is a PermissionRequest event (or something equivalent). in claude code, you can hook into permission decisions like plan mode exit and auto-approve them programmatically. this is super useful for power users who want uninterrupted agentic flows.
what claude code has that codex doesn't
claude code fires a PermissionRequest hook with matchers like ExitPlanMode. your hook script receives the event on stdin, and you return a json decision:
you can also inject additional context alongside the approval:
{
"decision": {"behavior": "allow"},
"additionalContext": "execute step by step, use subagents for parallel work"
}
this lets you build things like:
- auto-approve plan mode exit without clicking through the dialog every time
- inject orchestrator directives that guide execution after approval
- conditionally deny certain permission requests based on custom policy
i built a small tool around this for claude code: https://github.com/yigitkonur/hooks-claude-code — it auto-approves plans and optionally injects an orchestrator prompt. would love to build the same thing for codex.
what i'd like to see
a new hook event (maybe PermissionRequest or PlanApproval) that fires whenever codex needs user confirmation for something — plan approval, dangerous command confirmation, etc. the hook should be able to:
- return allow/deny decisions
- optionally attach context or instructions
- use matchers to target specific permission types
the existing PreToolUse deny flow is close but only covers bash commands. this would generalize that pattern to any permission gate in the system.
current workaround
there isn't really one. Stop hook can force continuation but that's not the same as approving a plan before execution starts.
thanks for considering!
hey, love the hooks system — been using it heavily.
one thing that's missing compared to claude code's hook model is a
PermissionRequestevent (or something equivalent). in claude code, you can hook into permission decisions like plan mode exit and auto-approve them programmatically. this is super useful for power users who want uninterrupted agentic flows.what claude code has that codex doesn't
claude code fires a
PermissionRequesthook with matchers likeExitPlanMode. your hook script receives the event on stdin, and you return a json decision:{"behavior": "allow"}you can also inject additional context alongside the approval:
{ "decision": {"behavior": "allow"}, "additionalContext": "execute step by step, use subagents for parallel work" }this lets you build things like:
i built a small tool around this for claude code: https://github.com/yigitkonur/hooks-claude-code — it auto-approves plans and optionally injects an orchestrator prompt. would love to build the same thing for codex.
what i'd like to see
a new hook event (maybe
PermissionRequestorPlanApproval) that fires whenever codex needs user confirmation for something — plan approval, dangerous command confirmation, etc. the hook should be able to:the existing
PreToolUsedeny flow is close but only covers bash commands. this would generalize that pattern to any permission gate in the system.current workaround
there isn't really one.
Stophook can force continuation but that's not the same as approving a plan before execution starts.thanks for considering!