Skip to content

hooks: add permission request event for parity with claude code's auto-approve flow #16301

Description

@yigitkonur

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:

{"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:

  • 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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentIssues related to the core agent loopenhancementNew feature or requesthooksIssues related to event hooks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions