Task-led comparison · official docs checked Nov 3, 2026
Codex CLI vs Gemini CLI for a bounded local coding task
Choose a terminal coding workflow by how you want to grant write access and recover from edits. Codex documents a read-only starting sandbox for exec; Gemini CLI documents folder trust, approval modes, optional sandboxing, and optional checkpoints.
Which CLI should I try for a small change in a local repository?
Start with Codex CLI if you want `codex exec` to begin in a read-only sandbox and require an explicit workspace-write choice before it edits files. Try Gemini CLI if you want to review its folder-trust and checkpoint settings as part of an interactive task. Gemini's folder trust and checkpointing are disabled by default, and its sandbox is optional, so configure the controls you intend to evaluate first. These documented workflows do not establish which tool is safer or writes better code.
How do the documented starting permissions differ?
OpenAI documents `codex exec` as read-only by default, with `--sandbox workspace-write` as an opt-in for edits. Gemini CLI's configuration docs describe `default` approval mode as prompting for each tool call; its sandbox documentation says process sandboxing is disabled by default and can be enabled with `-s` or configuration. These are separate controls: approval prompts and sandbox boundaries are not interchangeable. Check the current behavior for the exact CLI version and settings you run.
What does Gemini CLI folder trust change?
Google documents folder trust as a setting that must first be enabled. When enabled, Gemini CLI prompts you to trust a project before loading project-specific configuration; untrusted folders use restricted behavior. In headless runs, an enabled trust check can stop on an untrusted workspace unless you explicitly configure a documented bypass. Treat repository hooks, skills, commands, and local settings as part of the project you are reviewing.
What recovery options are documented?
Gemini CLI offers optional checkpointing that snapshots project state before AI-powered file modifications and can restore with `/restore`; Google says checkpointing is disabled by default and configured in `settings.json`. Codex documentation describes sandbox and approval boundaries, but these sources do not describe an equivalent per-edit checkpoint workflow. Use version control or a disposable branch for either tool and inspect the final diff.
How can I compare both tools on the same task?
Choose one small issue with explicit acceptance criteria and create two clean, restorable copies of the same repository state. For Codex, record the `codex exec` sandbox and approval settings. For Gemini CLI, record approval mode, folder-trust state, sandbox choice, and checkpoint setting. Use the same prompt and checks, inspect both diffs, and run the same project checks yourself. This measures fit for your setup, not general coding ability.
Does this comparison rank safety, quality, or price?
No. It summarizes controls and workflows described in OpenAI and Google documentation checked November 3, 2026. Settings, platform behavior, and product access can change. The page does not establish comparative safety, coding quality, reliability, performance, or cost; verify the current documentation and your local configuration before use.
Sources
- OpenAI Codex docs: sandbox and approvals · checked Nov 3, 2026
- OpenAI Codex docs: non-interactive mode · checked Nov 3, 2026
- Google Gemini CLI: trusted folders · checked Nov 3, 2026
- Google Gemini CLI: checkpointing · checked Nov 3, 2026
- Google Gemini CLI: sandboxing · checked Nov 3, 2026
- Google Gemini CLI: configuration reference · checked Nov 3, 2026