Codex CLI
Best as a local coding agent with OpenAI login, AGENTS.md, /review, sandbox and approval profiles, Codex Cloud, and script mode through codex exec.
Codex CLI, Claude Code, and Gemini CLI can all read code, propose changes, write files, and run commands. They overlap, but they are not the same product. The right first CLI depends mostly on your ecosystem, how much automation you want, and how tightly you want to control permissions.
Codex CLI
Best as a local coding agent with OpenAI login, AGENTS.md, /review, sandbox and approval profiles, Codex Cloud, and script mode through codex exec.
Claude Code
Best for longer development flows, conversation, memory, hooks, skills, subagents, CI/CD, Slack, desktop/web, and teams that want one agent workflow.
Gemini CLI
Best for the Google ecosystem, high free starting quota, Gemini API/Vertex AI, hierarchical GEMINI.md, checkpointing, and worktree-based experiments.
| Profile | Choose first | Avoid starting with |
|---|---|---|
| You just want to learn AI CLIs | Gemini CLI or Codex CLI | Three tools at once. |
| You want serious work in a Git repo | Codex CLI | Full access before you understand diff and approval flow. |
| You want long dialogue and project memory | Claude Code | Too many hooks and rules on day one. |
| You want Google Cloud or Vertex AI | Gemini CLI | API keys without budget and quota visibility. |
| You want a second opinion on critical diffs | Codex /review plus Claude/Gemini read-only review | Two agents editing the same files at once. |
The point is not to choose one CLI forever. Start with one, learn its permission model, then use the others as reviewers or specialist tools.
A strong practical model:
Example:
Read the diff as an independent reviewer.Focus on concrete bugs, security, performance, and missing tests.Do not make changes and suggest fixes only with file locations.| If you mainly want to… | First choice | Why |
|---|---|---|
| Use a strong local agent in a Git repo | Codex CLI | Good defaults, OS sandboxing, read-only/auto/full-access modes, and local /review. |
| Work through long tasks and ongoing dialogue | Claude Code | Memory, plan/permission modes, hooks, skills, subagents, and many surfaces. |
| Start free with a high daily quota | Gemini CLI | Google sign-in gives 1,000 requests per user per day on the individual tier according to the docs. |
| Automate through scripts or CI | Codex CLI or Gemini CLI | codex exec and Gemini headless mode have good non-interactive and JSON flows. Claude can also run claude -p, but watch token usage. |
| Use Google Cloud, Vertex AI, or Gemini API | Gemini CLI | Auth, quotas, and pay-as-you-go fit naturally with Google Cloud. |
| Use ChatGPT, Codex Cloud, or code review | Codex CLI | ChatGPT plans include Codex, and the CLI can work with local and cloud Codex tasks. |
| Use Slack, GitHub/GitLab CI, web/desktop, and team processes | Claude Code | Claude Code is designed as a broader agent system, not just a terminal command. |
| Compare outputs from several models | Use two CLIs | Let one write the change and another read the diff. They often catch different issues. |
| Topic | Codex CLI | Claude Code | Gemini CLI |
|---|---|---|---|
| Provider | OpenAI | Anthropic | |
| CLI command | codex | claude | gemini |
| Primary model direction | GPT-5.4 and Codex models | Claude models, especially Sonnet/Opus depending on plan | Gemini models through Google sign-in, API key, or Vertex AI |
| Open source CLI | Yes, Codex CLI is open source and Rust-based | No, product/CLI is distributed by Anthropic | Yes, Gemini CLI is open source |
| Typical install | npm or Homebrew | Native installer recommended, Homebrew/WinGet available | npm, Homebrew, or npx |
| Best Windows path | WSL recommended; native Windows is experimental | Windows supported through native installer/WinGet | Windows supported through Node/npm and sandbox options |
| Login | ChatGPT or OpenAI API key | Claude account, Anthropic Console, or third-party provider | Google sign-in, Gemini API key, or Vertex AI |
| Project instructions | AGENTS.md | CLAUDE.md, .claude/rules/, auto memory | GEMINI.md, global/workspace/JIT context files |
| Non-interactive mode | codex exec | claude -p | gemini -p or headless mode |
| MCP | Yes | Yes | Yes |
| Local review | Built-in /review for diff, branch, commit, and uncommitted changes | Code review through Claude Code workflows, plugins, and CI/CD integrations | No focused /review flow like Codex; can analyze a diff via prompt |
| Cloud/team surface | Codex Cloud, GitHub code review, and ChatGPT workspace features depending on plan | Terminal, IDE, desktop, web, Slack, CI/CD, scheduled tasks, and Agent SDK | Google AI/Code Assist/Vertex AI, extensions, subagents, and Google Cloud paths |
| Usage view | /status and Codex usage dashboard | /cost for API users, /stats for subscribers | /stats model |
| Risk | Codex CLI | Claude Code | Gemini CLI |
|---|---|---|---|
| Default access | Codex recommends Auto in version-controlled folders and read-only outside Git. Network access is off by default for local commands. | Claude Code uses a permission system where sensitive actions require approval, and write access is limited to the starting folder and its subfolders unless you grant more. | Gemini asks for permission for actions such as file writes, cloning, and shell commands. |
| Sandbox | OS sandbox: macOS Seatbelt, Linux sandbox, and Windows/WSL paths. | Permission-based architecture and a sandboxed bash tool can provide isolation. | Several sandbox methods: macOS Seatbelt, Docker/Podman, Windows native sandbox, gVisor, and LXC/LXD. |
| Full access | --yolo or danger-full-access is high risk. | --dangerously-skip-permissions should be treated as a risk mode. | Tool sandboxing can be disabled, but should only be done in isolated environments. |
| Prompt injection | Web search defaults to cached search in Codex CLI, and live search requires explicit choice or a full-access situation. | Docs describe command blocklists, network approval, trust verification, and command injection detection. | Use sandboxing, trusted folders, .geminiignore, and approvals around external content. |
| Good starting mode | Read-only or Auto in a clean Git repo. | Planning or read-only-style start, approving only concrete actions. | Google sign-in, a read-only first task, and checkpointing if you want restore points. |
Strengths
/review, diff reading, branch/commit review, and transcript.--sandbox, --ask-for-approval, --full-auto, and --yolo.codex exec works well for scripts, automation, and CI-style use.AGENTS.md discovery works well in repositories and monorepos.Weaknesses
Strengths
CLAUDE.md, .claude/rules/, auto memory, hooks, skills, and custom commands provide strong workflow control.claude -p and Unix-style flows.Weaknesses
-p is powerful, but the docs note that some trust checks do not apply the same way as in interactive use.Strengths
GEMINI.md has global, workspace, and just-in-time context, and the filename can be configured.Weaknesses
| Need | Codex CLI | Claude Code | Gemini CLI |
|---|---|---|---|
| Repository rules | AGENTS.md | CLAUDE.md | GEMINI.md |
| Global rules | ~/.codex/AGENTS.md | ~/.claude/CLAUDE.md | ~/.gemini/GEMINI.md |
| Folder-specific rules | Nested AGENTS.md or AGENTS.override.md | .claude/rules/*.md with path scope | Just-in-time GEMINI.md close to files/folders |
| Good monorepo model | Short root file and app-specific instructions | Root CLAUDE.md plus per-area rules | Global/workspace/JIT context hierarchy |
Read project folders and workflows before putting long instructions in a large repository.
Monthly plan price is not the only cost. AI CLI usage depends on:
Short choice:
| Situation | Best pricing model |
|---|---|
| Learning and manual use | Subscription or free tier. |
| Many small daily terminal tasks | Plan with included CLI usage. |
| CI, bots, and automation | API key with spend limits and separate keys. |
| Team and compliance | Business/Team/Enterprise with admin, SSO, and usage reporting. |
See pricing, plans, and API prices for current numbers.
git status.Example:
Read this diff as a code reviewer. Find concrete bugs, regression risks, and missing tests.Do not make changes.Use a separate worktree when the agent will change many files.
git worktree add ../my-project-ai -b ai/experimentcd ../my-project-aiGemini has an experimental --worktree flow. Codex and Claude can also be used inside normal Git worktrees.
| Profile | Start with | Add later |
|---|---|---|
| Solo developer with ChatGPT | Codex CLI | Claude Code for long plans or Gemini CLI for a second opinion. |
| Solo developer with a Google account | Gemini CLI | Codex or Claude when you want stronger review or agent workflows. |
| Team already using Claude | Claude Code | Codex as a local reviewer on critical diffs. |
| Team using OpenAI/ChatGPT Business | Codex CLI | Claude Code or Gemini CLI for alternative reviews. |
| Google Cloud team | Gemini CLI | Codex or Claude for independent code review. |
Last checked: April 11, 2026.