All posts

Claude Code vs Codex CLI vs Gemini CLI: how each one handles approvals

17 November 2026, updated 17 November 2026

All three terminal coding agents will run commands on your Mac, and all three have a way to ask first. They get there differently. Claude Code leans on rules and modes, Codex CLI leans on an operating-system sandbox, and Gemini CLI uses approval modes with tool lists.

This compares them on the things that decide how often you are interrupted and how much can go wrong. Everything was checked against each tool’s own docs on 17 November 2026. These tools change quickly, so treat the links as the source of truth.

The short version

Claude Code Codex CLI Gemini CLI
Main control Permission modes plus allow, ask and deny rules Sandbox mode plus approval policy Approval mode plus tool lists
Asks by default about Edits and most shell commands in Manual mode; a classifier decides in auto mode Actions outside the workspace sandbox, and network use Tool calls, in default mode
Sandbox Optional, off by default On by default Optional
Bypass flag --dangerously-skip-permissions --dangerously-bypass-approvals-and-sandbox (alias --yolo) --yolo
Config file ~/.claude/settings.json ~/.codex/config.toml ~/.gemini/settings.json
Hook that sees a tool call first PreToolUse PreToolUse BeforeTool

Claude Code: modes and rules

Claude Code has six permission modes. Manual (default) asks before edits and most shell commands. acceptEdits lets file edits through. plan is read-only until you approve a plan. auto has a classifier review each action for you. dontAsk denies anything not pre-approved, and bypassPermissions skips the checks.

On top of the mode sit rules in settings.json, such as Bash(npm run *) in allow or Bash(git push *) in deny. They are checked deny first, then ask, then allow, and a deny holds in every mode.

Claude Code’s rules match the text of the command. The docs say outright that a Bash deny rule “isn’t a security boundary around the program”: Bash(curl *) stops curl and does not stop /usr/bin/curl. For a hard boundary there is an optional sandbox, which uses Seatbelt on macOS and is off until you enable it.

There is a longer walk through the modes in Claude Code permission modes explained.

Codex CLI: sandbox first

Codex CLI starts from the other end. Its docs describe two settings. The sandbox mode is read-only, workspace-write or danger-full-access. The approval policy is on-request, never or a granular table.

The default is workspace-write with on-request. Commands and edits inside your project run without a prompt, network access is off, and Codex asks when it needs to go past either limit. On a Mac the sandbox is Seatbelt, applied to every command.

The result is fewer prompts out of the box than Claude Code in Manual mode, because the operating system contains the work and no rule has to recognise each command. The cost is that things which need the network, such as installing a package, hit the edge of the sandbox and ask.

More detail is in Codex CLI approvals and sandbox modes.

Gemini CLI: approval modes and tool lists

Gemini CLI’s configuration reference has a general.defaultApprovalMode setting with three values: "default" prompts for approval, "auto_edit" auto-approves edit tools, and "plan" is read-only. YOLO mode, which approves everything, is not a settings value. It can only be turned on from the command line with --yolo or --approval-mode=yolo, and security.disableYoloMode blocks even that.

Tools are controlled by lists: tools.allowed names tools that skip the confirmation dialog, for example "run_shell_command(git)", and tools.exclude removes tools altogether. Sandboxing is available through tools.sandbox and is not on by default.

One thing to know before you invest in a Gemini CLI setup. The Gemini CLI docs now carry a notice that for unpaid tier and Google One users, Gemini CLI was replaced by Antigravity CLI on 18 June 2026. Check which of the two applies to your account before relying on any of the above.

What does each bypass flag turn off?

Flag Turns off What is left
Claude Code --dangerously-skip-permissions Prompts and safety checks Deny rules, ask rules, critical-path rm checks, denying hooks
Codex --yolo Approvals and the sandbox Nothing built in, apart from hooks you configured
Gemini --yolo Approval prompts Excluded tools, and security.disableYoloMode if an admin set it

All three sets of docs steer you away from these on a machine you care about. Claude Code’s docs say to use the mode only in isolated containers and VMs, and the Codex docs advise against the flag. The Claude Code version is covered in what —dangerously-skip-permissions does.

Can another program answer the prompt?

All three have hooks, and the hooks differ more than anything else here.

Claude Code. A PreToolUse hook runs before every tool call and can return permissionDecision of "allow", "deny" or "ask". Returning "ask", or nothing, hands the request to the normal terminal prompt. There is also a PermissionRequest event that fires only when Claude Code is about to ask you.

Codex CLI. Its hooks include a PermissionRequest event that runs when Codex would prompt, with a decision of allow or deny. If no hook decides, the normal prompt appears. Codex’s PreToolUse supports deny but, per the docs, not ask. New hooks must be reviewed and trusted with /hooks before they run.

Gemini CLI. A BeforeTool hook can return a decision of "deny" to block a tool. The reference documents allow and deny and has no “ask” value, so a hook cannot hand a request back to the terminal prompt. Its Notification hook is observability-only and cannot grant permissions.

Claude Code Codex CLI Gemini CLI
Hook can allow Yes Yes Yes
Hook can deny Yes Yes Yes
Hook can defer to the terminal prompt Yes, "ask" or no decision Yes, no decision No
Where hooks live ~/.claude/settings.json ~/.codex/hooks.json or config.toml ~/.gemini/settings.json

That last row matters to anything that sits between you and the agent, including NotchDaddy. It connects to all three through these hooks and shows each request in the MacBook notch with Allow and Deny. If you do not answer, Claude Code and Codex CLI fall back to their own terminal prompts. Gemini’s protocol has no way to do that, so an unanswered request there is denied with a reason the agent can retry on. In no case is an unanswered request approved.

Which is safest out of the box?

Codex CLI, by a reasonable margin, because its default includes an OS-level sandbox with the network off. Claude Code’s defaults rely on prompts or a classifier, and its sandbox is something you turn on. Gemini CLI’s default prompts for tool calls and its sandbox is also opt-in.

That ranking changes as soon as you configure things. Claude Code with the sandbox enabled, a few deny rules and acceptEdits is well contained and quiet. Codex with --yolo is the least protected of anything here.

What should you do with this?

  1. Leave each tool’s bypass flag for throwaway containers.
  2. In Claude Code, turn on the sandbox or write deny rules for the things you never want, then pick a mode.
  3. In Codex, keep the default, and enable workspace network access only if the prompts for it are constant.
  4. Whatever you run, make sure a waiting prompt reaches you quickly. A notification hook is the free way.

If you run two of these side by side, the prompts arrive in different terminals with different keys to answer them. Answering them from one place is the job NotchDaddy does. If you use one agent in one terminal, you do not need it; the terminal prompt is fine. There is more on the agents page, and you can see how it sits next to other notch apps on the compare page.

Start a 3-day trial for $0. It is $19 once for 2 Macs. NotchDaddy is not affiliated with Anthropic, OpenAI or Google.