Claude Code vs Codex CLI: Permission Models Compared
Just want to govern Codex? If you're here to actually see, control, and price every Codex tool call, that's one command — hooks for Bash plus an MCP connector for everything else, in a single installer:
curl -sf https://agenticcontrolplane.com/install.sh | bash
irm https://agenticcontrolplane.com/install.ps1 | iex
Full Codex install guide → · see your first governed call → · free up to 5 agents
Claude Code and OpenAI’s Codex CLI both have permission prompts, both have hooks, and both get run with the prompts off by people who read neither manual. The hook systems look alike: PreToolUse, PostToolUse, JSON in, JSON out. They differ in what a hook can decide and in what happens when nobody is watching. This is the side by side as of November 2026. The first version of this post described a narrower Codex than ships today; the Codex hooks reference is the page we keep current.
The comparison
| Dimension | Claude Code | Codex CLI |
|---|---|---|
| Hook config | ~/.claude/settings.json (user, project and managed scopes) |
~/.codex/hooks.json, merged with <repo>/.codex/hooks.json; every matching hook runs |
| Hook events | PreToolUse, PostToolUse, plus session and prompt events |
PreToolUse, PostToolUse, PermissionRequest, SessionEnd |
| On by default | Yes | Yes on current builds (older builds needed [features].codex_hooks = true). A non-managed hook runs only after you trust it in /hooks |
| Tools the hooks see | All native tools (Bash, Edit, Read, Write) and MCP |
Shell (including exec_command), apply_patch edits, MCP and other local tools. Hosted tools such as web search never fire a hook. Older builds: shell only |
What PreToolUse can decide |
allow, deny, ask, or rewrite the input |
deny (JSON or exit 2) and allow with updatedInput. ask is parsed but not supported: the hook is marked failed and the tool runs |
| After the call | PostToolUse can block or change what the model reads |
PostToolUse is a record. It cannot undo the call or change the result |
| Prompts off | --dangerously-skip-permissions: prompts off, hooks and deny rules still run |
codex exec: read-only sandbox by default, --sandbox workspace-write for edits, network off unless granted. --full-auto is deprecated. Hooks still run. --dangerously-bypass-approvals-and-sandbox drops the sandbox too |
| Hooks off | disableAllHooks: true in settings; allowManagedHooksOnly pins them at org scope |
[features].hooks = false |
| Hook timeout | 60 s default, set per hook | 600 s default for most events, set per hook |
| Approval prompt | Per call, allow once or always; auto mode decides for you and tags the rule it applied | Per step, yes or no; a PermissionRequest hook can answer it, and any deny wins |
Both are real permission systems. Neither is complete.
Where Claude Code is stronger: what a hook can decide
A Claude Code hook can do four things with a call: let it run, block it, hold it for the person at the keyboard (ask), or rewrite the input first. After the call, PostToolUse can change what the model reads, so “take the secret out of that tool output” is a hook you can write. Codex cannot do the last two. There is no hook-side ask, and a Codex PostToolUse hook is a log entry.
The weak point is the flag people use for automation. --dangerously-skip-permissions turns off the prompts. It does not turn off hooks: PreToolUse still fires and a deny still blocks. So under the flag, the deny rules you wrote beforehand are the whole boundary. Removing the hooks takes a separate setting (disableAllHooks), and a hook can set onFailure: "block" so a crashed hook stops the call instead of letting it through. More in our dangerously-skip-permissions breakdown.
Where Codex is stronger: the defaults when nobody is watching
codex exec starts in a read-only sandbox. You opt into writes (--sandbox workspace-write), you opt into network (sandbox_workspace_write.network_access=true), and hooks fire the whole time. For CI jobs and scheduled runs that is the right default: the person is removed, the policy stays.
The gap is the hold. A Codex hook can block a call but cannot pause it for a yes. Return ask and Codex marks the hook failed and runs the tool. So anything you would want a person to approve has to be a hard deny, or go through Codex’s own approval flow. The rest, including the trust prompt that stops a new hook from running at all, is in the Codex CLI hooks reference.
The shared gap
Both decide one call at a time, on one machine, from config on that machine. Neither answers:
- Who. Which person is accountable for this agent, and does the record outlive the laptop?
- The series. The 400th
curlin an hour is not the 1st. Per-call rules cannot see the count. - Cost. Neither prices a call when it decides. A retry loop at 3am shows up on the invoice.
- Fleet. A deny list edited per machine drifts. There is no “this rule, everywhere, now.”
ACP sits in both hook systems as one more hook and adds that layer: the same rules keyed the same way (Bash.git.push, Bash.rm), one log, a spend meter, and a safety floor that holds a force-push, destructive SQL through a database client, or curl | sh for approval on either harness. The two differ in how a hold reaches you. In Claude Code the force-push waits in the session until you click approve. In Codex the call is blocked, you approve it on the console or from the email, and the agent retries, because Codex cannot show a hook’s ask as a prompt. Model spend is metered on Claude Code from the session transcript; on Codex, launch through codex-acp so the meter sees it. A new workspace starts in audit mode: everything recorded, nothing held except by the floor. And ACP is a client-side hook like any other, so disableAllHooks removes it on Claude Code too. Per-harness detail: the coverage matrix.
Choosing, if you must
- Interactive daily use: either. Both prompts work with a person present.
- Unattended, with rules you need enforced: Codex’s sandbox defaults are the better start; write hard denies, since a hook cannot hold a call. Unattended Claude Code keeps hooks alive under
--dangerously-skip-permissions; write the denies first and setonFailure: "block"on the hooks you depend on. - Redacting tool output before the model sees it: Claude Code. Its
PostToolUseis the only one that can change the result. - Mixed fleet: stop choosing per harness. Put the rules in a layer both route through and let the native systems be the local reflexes.
Frequently asked questions
What's the main difference between Claude Code and Codex CLI permissions?
What a hook can decide. Claude Code hooks see every native tool and MCP call and can allow, deny, ask, or rewrite the input. Codex hooks see shell, apply_patch edits, MCP and other local tools, and can deny or allow with a rewrite, but cannot ask: Codex marks an ask as a failed hook and runs the tool. Both keep hooks running when the prompts are off.
Do Claude Code hooks work with --dangerously-skip-permissions?
Yes. The flag puts the session in bypassPermissions, which removes the prompts. PreToolUse hooks still fire and a hook deny still blocks. What disappears is the human confirmation, so the deny rules you wrote beforehand are the whole boundary. disableAllHooks in settings.json is what turns hooks off.
Do Codex hooks work in --full-auto or sandbox mode?
Yes. codex exec runs in a read-only sandbox by default; –sandbox workspace-write allows edits and keeps network off unless you grant it. –full-auto still works but is deprecated and prints a warning. Hooks fire in all of these modes. Only the per-step approval prompt is gone.
Can Codex hooks block a tool call the way Claude Code's can?
Yes. Return permissionDecision “deny” with a reason, or exit 2 with the reason on stderr. PreToolUse fires for shell, apply_patch edits, MCP tool calls and other local tools; hosted tools such as web search never reach a hook. What a Codex hook still cannot do is ask: Codex treats ask as a failed hook and continues.
Which is safer to run unattended?
Neither, on configuration alone. Claude Code gives a hook the most decisions but one flag turns the prompts off. Codex sandboxes by default and keeps hooks running, but a hook can only block, never hold a call for a yes. On both, unattended safety is deny rules written ahead of time, a sandbox, and a record of what ran.
Where to read more
- Codex CLI hooks reference: the full Codex hook surface, with source cites
- Claude Code’s dangerously-skip-permissions: what the flag does and does not disable
- Which Claude Code tools to deny out of the box: posture, tool by tool
- The Tool Surface Index: Claude Code’s 76 declared tools next to Codex’s 17, captured from live traffic in July 2026
- Ways to set up ACP: install on either harness, ending with your coverage state