Practical agent comparison

Codex vs Gemini CLI

Both terminal agents document project guidance, planning, tools, file modification, shell execution, and approval boundaries. Codex uses AGENTS.md, and its prompt claims are scoped to Codex CLI with GPT-5.2. Gemini CLI uses hierarchical GEMINI.md context with a configurable model. Both document web functionality, while Codex CLI distinguishes cached and live search. Recheck context assembly, network needs, and execution controls before moving a workflow.

Reviewed
Products
OpenAI Codex · Gemini CLI
Decision criteria
9 reviewed questions

Comparison orientation

Four reviewed dimensions at a glance

Each dimension links to its detailed evidence row. State labels describe the selected evidence.

Who this comparison is for

How do Codex and Gemini CLI differ for professional terminal coding workflows?

Developers and platform teams choosing or migrating between Codex CLI and Gemini CLI for repository-centered terminal work.

Evidence-bounded scope

Product, surface, and model context

These summaries combine only the scope stated in the reviewed answers. Each criterion keeps its narrower limits.

OpenAI Codex

Surfaces represented
Codex CLI
Model context represented
GPT-5.2

Gemini CLI

Surfaces represented
Gemini CLI
Model context represented
Not established

Practical behavior comparison

What the selected evidence establishes

“Not established” records an evidence gap. It does not mean the product lacks the capability.

Behavior Intelligence comparison of OpenAI Codex and Gemini CLI
CriterionOpenAI CodexGemini CLIInterpretation
Repository / project instructions Repository guidance must be placed in the target agent's documented instruction hierarchy. Documented

AGENTS.md repository guidance

Surface
Codex CLI
Model
Not established
Config/version
Instruction discovery follows the documented repository path and size limits.
Documented

Hierarchical GEMINI.md context

Surface
Gemini CLI
Model
Not established
Config/version
Not established
Read practical implication
Memory / persistent context Durable workflow context should not be assumed to persist across agent environments. Not established

Persistent memory not established

Surface
Not established
Model
Not established
Config/version
Not established
Review the documented evidence gap
Not established

Persistent memory semantics not established

Surface
Not established
Model
Not established
Config/version
Not established
Review the documented evidence gap
Read practical implication
Planning / work decomposition Planning assumptions shape how teams structure, review, and resume multi-step work. Documented

Making and updating plans

Surface
Codex CLI
Model
GPT-5.2
Config/version
Not established
Documented

Planning appears in documented tools

Surface
Gemini CLI
Model
Not established
Config/version
Not established
Read practical implication
Tools / tool calling A portable workflow must use only the tools established by the selected evidence. Documented

Terminal and patch function calls

Surface
Codex CLI
Model
GPT-5.2
Config/version
Actual tool availability and escalation depend on the specific run configuration.
Documented

Filesystem, execution, planning, MCP, and web

Surface
Gemini CLI
Model
Not established
Config/version
Enabled tools and security posture can vary with configuration.
Read practical implication
Filesystem / file modification Repository reads and mutations require the correct workspace and review boundary. Documented

Workspace files and patch calls

Surface
Codex CLI
Model
GPT-5.2
Config/version
Workspace access and patch approval depend on the run configuration.
Documented

Filesystem tools with confirmation for mutation

Surface
Gemini CLI
Model
Not established
Config/version
Sandbox and trusted-folder settings can change the execution boundary.
Read practical implication
Shell / terminal execution Command-heavy automation depends on the target harness's execution controls. Documented

Terminal command function calls

Surface
Codex CLI
Model
GPT-5.2
Config/version
Commands may require user approval depending on the run configuration.
Documented

Shell tools with confirmation and isolation

Surface
Gemini CLI
Model
Not established
Config/version
Sandboxing and trusted-folder settings can constrain execution.
Read practical implication
Browsing / network access Current external information cannot be assumed available when browsing scope is unestablished. Documented

Cached or live CLI web search

Surface
Codex CLI
Model
Not established
Config/version
Current product documentation consulted 2026-09-14; enabled mode, settings, and deployment still determine availability.
Documented

Web tools in official tool reference

Surface
Gemini CLI
Model
Not established
Config/version
Availability depends on enabled tools and security configuration.
Read practical implication
Approvals / permissions Consent, confirmation, and isolation rules determine which delegated actions can proceed. Documented

Configuration-dependent approval escalation

Surface
Codex CLI
Model
GPT-5.2
Config/version
The specific run determines which calls require escalation.
Documented

Confirmation, sandbox, and trusted folders

Surface
Gemini CLI
Model
Not established
Config/version
Security policy and isolation settings shape the actual boundary.
Read practical implication
Context scope / inheritance Instructions and tools remain dependable only when their surface, model, and configuration boundaries are preserved. Documented

Harness, workspace, and repository context

Surface
Codex CLI
Model
Not established
Config/version
The current instruction-discovery claim covers Codex CLI; the historical harness excerpt remains scoped to GPT-5.2.
Documented

Global, workspace, just-in-time, and dynamic context

Surface
Gemini CLI
Model
Not established
Config/version
The product uses a configurable Gemini model and can fully replace its built-in system prompt.
Read practical implication

Criterion-by-criterion interpretation

Scope, limitations, and evidence

Behavior Intelligence supplies the factual answers. Editorial implications remain separate.

01

How do AI agents use repository or project instructions?

Open evidence across six products

Why it matters. Repository guidance must be placed in the target agent's documented instruction hierarchy.

OpenAI Codex

Documented
Direct factual answer

Codex supports repository-scoped guidance through AGENTS.md and AGENTS.override.md in the documented context assembly. Codex home guidance loads before project guidance; project discovery selects at most one file per directory from the project root to the working directory.

Surface
Codex CLI
Model context
Not established
Configuration / version
Instruction discovery follows the documented repository path and size limits.
Limits and uncertainty
  • The selected evidence does not establish every runtime instruction input.

Gemini CLI

Documented
Direct factual answer

Gemini CLI documents global, workspace, and just-in-time GEMINI.md files as hierarchical project and task context.

Surface
Gemini CLI
Model context
Not established
Configuration / version
Not established
Limits and uncertainty
  • The context hierarchy is distinct from the replaceable built-in system prompt.
02

Does the product document memory or persistent context?

Open evidence across six products

Why it matters. Durable workflow context should not be assumed to persist across agent environments.

OpenAI Codex

Not established
Direct factual answer

The limited Codex excerpt and repository-guidance source do not establish a separate persistent memory mechanism.

Surface
Not established
Model context
Not established
Configuration / version
Not established
Limits and uncertainty
  • Workspace context and AGENTS.md instructions are not treated as memory.

No source link is attached because the reviewed evidence does not establish this answer.

Gemini CLI

Not established
Direct factual answer

The selected Gemini CLI tools reference names memory among its categories, but does not establish enough persistence or scope behavior for this question.

Surface
Not established
Model context
Not established
Configuration / version
Not established
Limits and uncertainty
  • A tool category alone is not treated as proof of cross-session persistence.

No source link is attached because the reviewed evidence does not establish this answer.

03

How is planning or work decomposition documented?

Open evidence across six products

Why it matters. Planning assumptions shape how teams structure, review, and resume multi-step work.

OpenAI Codex

Documented
Direct factual answer

The selected Codex prompt excerpt explicitly names making and updating plans as part of the assistant's working interface.

Surface
Codex CLI
Model context
GPT-5.2
Configuration / version
Not established
Limits and uncertainty
  • The excerpt does not prescribe one universal decomposition procedure.

Gemini CLI

Documented
Direct factual answer

The selected Gemini CLI tools reference includes planning among the documented tool categories available to the CLI.

Surface
Gemini CLI
Model context
Not established
Configuration / version
Not established
Limits and uncertainty
  • The selected evidence does not establish one fixed planning sequence across configurations.
04

What tools or tool-calling capabilities are documented?

Open evidence across six products

Why it matters. A portable workflow must use only the tools established by the selected evidence.

OpenAI Codex

Documented
Direct factual answer

Codex's selected prompt excerpt names function calls for terminal commands and patch application.

Surface
Codex CLI
Model context
GPT-5.2
Configuration / version
Actual tool availability and escalation depend on the specific run configuration.
Limits and uncertainty
  • The excerpt is not a complete tool inventory.

Gemini CLI

Documented
Direct factual answer

Gemini CLI's selected official reference covers filesystem, execution, planning, memory, MCP, and web tool categories.

Surface
Gemini CLI
Model context
Not established
Configuration / version
Enabled tools and security posture can vary with configuration.
Limits and uncertainty
  • The selected evidence does not establish one immutable tool set.
05

Can the agent read or modify files?

Open evidence across six products

Why it matters. Repository reads and mutations require the correct workspace and review boundary.

OpenAI Codex

Documented
Direct factual answer

Codex's selected excerpt says the harness can supply workspace files and that the assistant can emit patch function calls.

Surface
Codex CLI
Model context
GPT-5.2
Configuration / version
Workspace access and patch approval depend on the run configuration.
Limits and uncertainty
  • The selected excerpt does not establish unrestricted filesystem access.

Gemini CLI

Documented
Direct factual answer

Gemini CLI documents filesystem tools, with mutating file operations subject to confirmation and configured security boundaries.

Surface
Gemini CLI
Model context
Not established
Configuration / version
Sandbox and trusted-folder settings can change the execution boundary.
Limits and uncertainty
  • Tool availability varies by configuration and version.
06

Can the agent execute shell or terminal commands?

Open evidence across six products

Why it matters. Command-heavy automation depends on the target harness's execution controls.

OpenAI Codex

Documented
Direct factual answer

Codex's selected excerpt explicitly names function calls that run terminal commands.

Surface
Codex CLI
Model context
GPT-5.2
Configuration / version
Commands may require user approval depending on the run configuration.
Limits and uncertainty
  • The selected excerpt does not establish unrestricted command execution.

Gemini CLI

Documented
Direct factual answer

Gemini CLI documents shell execution tools whose requests pass through confirmation and configured security policies.

Surface
Gemini CLI
Model context
Not established
Configuration / version
Sandboxing and trusted-folder settings can constrain execution.
Limits and uncertainty
  • The enabled tool set is configuration-dependent.
07

Can the product browse or access web and network resources?

Open evidence across six products

Why it matters. Current external information cannot be assumed available when browsing scope is unestablished.

OpenAI Codex

Documented
Direct factual answer

Interactive Codex CLI defaults to cached web search; --search selects live web search. This tool capability does not establish unrestricted shell network access or every session configuration.

Surface
Codex CLI
Model context
Not established
Configuration / version
Current product documentation consulted 2026-09-14; enabled mode, settings, and deployment still determine availability.
Limits and uncertainty
  • This claim does not update the dated prompt snapshot or establish every runtime configuration.

Gemini CLI

Documented
Direct factual answer

Gemini CLI's selected official tools reference includes web capabilities among the available tool categories.

Surface
Gemini CLI
Model context
Not established
Configuration / version
Availability depends on enabled tools and security configuration.
Limits and uncertainty
  • The selected evidence does not establish unrestricted network access.
08

What approval or permission controls are documented?

Open evidence across six products

Why it matters. Consent, confirmation, and isolation rules determine which delegated actions can proceed.

OpenAI Codex

Documented
Direct factual answer

Codex's selected excerpt says terminal and patch calls may be escalated to the user for approval depending on configuration.

Surface
Codex CLI
Model context
GPT-5.2
Configuration / version
The specific run determines which calls require escalation.
Limits and uncertainty
  • The excerpt does not define every sandbox or approval mode.

Gemini CLI

Documented
Direct factual answer

Gemini CLI documents confirmation for mutating file and shell tools, with sandboxing and trusted-folder boundaries.

Surface
Gemini CLI
Model context
Not established
Configuration / version
Security policy and isolation settings shape the actual boundary.
Limits and uncertainty
  • The selected evidence does not establish every enterprise policy.
09

How is context scoped or inherited across products and agents?

Open evidence across six products

Why it matters. Instructions and tools remain dependable only when their surface, model, and configuration boundaries are preserved.

OpenAI Codex

Documented
Direct factual answer

Codex's selected sources establish harness-supplied workspace context and authored guidance from Codex home followed by project instruction files. Current discovery documentation is separate from the pinned GPT-5.2 prompt excerpt.

Surface
Codex CLI
Model context
Not established
Configuration / version
The current instruction-discovery claim covers Codex CLI; the historical harness excerpt remains scoped to GPT-5.2.
Limits and uncertainty
  • The complete runtime context assembly is not established.

Gemini CLI

Documented
Direct factual answer

Gemini CLI documents global, workspace, and just-in-time GEMINI.md context plus dynamic injection of enabled skills, subagents, and tools.

Surface
Gemini CLI
Model context
Not established
Configuration / version
The product uses a configurable Gemini model and can fully replace its built-in system prompt.
Limits and uncertainty
  • No single immutable runtime assembly is claimed.

Workflow guidance

Migration considerations

These implications follow from the reviewed criteria. They do not express a product preference.

Example: preserve nested scope in a two-service repository

Transfer a narrow service exception without letting it become a global instruction.

  1. Suppose repository AGENTS.md names the normal test command, services/payments/AGENTS.override.md supplies a payment-specific command, and Codex home AGENTS.md holds a personal output preference. Start Codex from services/payments when evaluating that documented discovery chain.
  2. Map the shared team guidance into workspace GEMINI.md and the personal preference into global GEMINI.md context. Preserve the payment exception only where Gemini’s documented contextual discovery applies to that service; do not place it in the global file.
  3. AGENTS.override.md selects a file at one Codex directory level. Do not assume renaming it to GEMINI.md preserves that replacement behavior: inspect the resulting global, workspace, and just-in-time context and resolve conflicting commands explicitly.
  4. For a task that checks current API documentation before editing, verify live versus cached Codex search and the enabled Gemini web tools. Ask for the checked source URL and its version, then review the plan before permitting repository mutation.
  5. Handoff condition: a payment task receives the payment command while another service retains the shared command. Confirm each destination context and its shell controls separately. Keep plan and progress notes explicit; neither selected record establishes comparable automatic memory.

Keep planning and state explicit

The reviewed evidence establishes planning for both products, but not comparable persistent memory. Keep plan and state artifacts outside assumed memory.

Audit network dependencies

For current release information, select live search in Codex CLI when available and inspect the Gemini CLI web-tool configuration. Require cited page evidence in both; shell network permission remains a separate check.

Comparison-specific evidence

Differences in available evidence

First-party evidence covers project context, planning, tools, file changes, command execution, and approval boundaries for both terminal coding agents. Their prompt and configuration scopes remain distinct. The analysis below adds prompt and product context to the shared behavior criteria.

  1. 01

    The available prompt evidence has different boundaries

    Codex provides a limited pinned prompt excerpt. Gemini CLI documents built-in prompt export and full replacement. Both retain completeness and configuration limits.

  2. 02

    Both are terminal agent products

    Each product harness remains distinct from its selected or configurable model context.

Source-specific detail

Product and prompt evidence

These criteria cover prompt visibility, product identity, and other evidence specific to this comparison.

OpenAI Codex and Gemini CLI source-specific evidence comparison
CriterionOpenAI CodexGemini CLI
Product and model roleEditorial interpretation. Both are terminal coding agents whose model context is separately scoped. documented

Codex CLI is the represented product surface; GPT-5.2 is the model named by the selected pinned prompt rather than every Codex runtime.

documented

Gemini CLI is the represented terminal product, with a configurable Gemini model kept separate from instruction assembly.

Prompt evidence postureEditorial interpretation. The available prompt artifacts differ, and each retains its own completeness and configuration limits. documented

Promptcred maps a limited excerpt from a pinned first-party Codex prompt file; it does not claim the complete runtime assembly.

documented

Gemini CLI documentation establishes built-in prompt export and complete replacement workflows whose resolved content can depend on configuration.

Using the evidence

How to read this evidence

Keep product and model scope separate

Codex CLI with the selected GPT-5.2 prompt and Gemini CLI with a configurable Gemini model are bounded evidence, not universal model claims.

Use each artifact according to its publication posture

A limited pinned excerpt and a documentation-defined export or replacement workflow support different prompt-level conclusions.

Primary-source trail

Sources used in this comparison

Each source links to its product evidence, with provenance and publication limits preserved.

OpenAI Codex

Gemini CLI

Read the comparison and publication methodology

Deeper cross-agent context

Open the six-product answer for broader evidence and scope.

Continue comparing

Available pages

Search Promptcred

Type to search available pages.