Skip to content

Codex vs Claude Code vs Gemini CLI vs Antigravity (agy)

Comparison AI CLI

Codex CLI, Claude Code, Gemini CLI, and Antigravity CLI (agy) 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 Gemini API/Vertex AI and open source workflows. Note: the free access (Google sign-in), Google AI Pro, and Ultra shut down on June 18, 2026 — after that a paid Gemini API key or Code Assist Standard/Enterprise is required.

Antigravity CLI (agy)

Google’s successor to Gemini CLI. Best for fast, lightweight terminal use with Google sign-in: a single Go binary, millisecond startup, SSH-friendly, MCP support, and a shared agent engine with the Antigravity 2.0 desktop app.

ProfileChoose firstAvoid starting with
You just want to learn AI CLIsagy or Codex CLIFour tools at once.
You want serious work in a Git repoCodex CLIFull access before you understand diff and approval flow.
You want long dialogue and project memoryClaude CodeToo many hooks and rules on day one.
You want Google sign-in and Gemini modelsAntigravity CLI (agy)Gemini CLI — its free access shuts down June 18, 2026.
You want Google Cloud or Vertex AIGemini CLI (with a paid API key)API keys without budget and quota visibility.
You want a second opinion on critical diffsCodex /review plus Claude/agy read-only reviewTwo 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:

  1. Let one CLI make the change in a worktree.
  2. Run build/test.
  3. Let another CLI read the diff without editing files.
  4. Ask the review agent to find bugs, security issues, missing tests, and edge cases.
  5. Fix manually or send the feedback back to the first CLI.

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 choiceWhy
Use a strong local agent in a Git repoCodex CLIGood defaults, OS sandboxing, read-only/auto/full-access modes, and local /review.
Work through long tasks and ongoing dialogueClaude CodeMemory, plan/permission modes, hooks, skills, subagents, and many surfaces.
Use your Google account as loginAntigravity CLI (agy)Google’s actively developed CLI: Google sign-in, Gemini models, G1 credits, and fast startup.
Automate through scripts or CICodex CLI or agycodex exec and agy -p have good non-interactive flows. Claude can also run claude -p, but watch token usage.
Use Google Cloud, Vertex AI, or Gemini APIGemini CLI (with a paid API key)Auth, quotas, and pay-as-you-go fit naturally with Google Cloud.
Use ChatGPT, Codex Cloud, or code reviewCodex CLIChatGPT plans include Codex, and the CLI can work with local and cloud Codex tasks.
Use Slack, GitHub/GitLab CI, web/desktop, and team processesClaude CodeClaude Code is designed as a broader agent system, not just a terminal command.
Compare outputs from several modelsUse two CLIsLet one write the change and another read the diff. They often catch different issues.
TopicCodex CLIClaude CodeGemini CLIAntigravity CLI (agy)
ProviderOpenAIAnthropicGoogleGoogle
CLI commandcodexclaudegeminiagy
Primary model directionGPT-5.5 and Codex modelsClaude models, especially Sonnet/Opus depending on planGemini models through Google sign-in, API key, or Vertex AIGemini models (Gemini 3.5 Flash by default)
Open source CLIYes, Codex CLI is open source and Rust-basedNo, product/CLI is distributed by AnthropicYes, Gemini CLI is open sourceNo, closed Go binary (only docs/releases on GitHub)
Typical installnpm or HomebrewNative installer recommended, Homebrew/WinGet availablenpm, Homebrew, or npxOfficial install script (curl/PowerShell) — no Node.js
Best Windows pathWSL recommended; native Windows is experimentalWindows supported through native installer/WinGetWindows supported through Node/npm and sandbox optionsNative Windows through the official PowerShell/CMD script
LoginChatGPT or OpenAI API keyClaude account, Anthropic Console, or third-party providerGoogle sign-in, Gemini API key, or Vertex AIGoogle sign-in (stored in the system keyring)
Project instructionsAGENTS.mdCLAUDE.md, .claude/rules/, auto memoryGEMINI.md, global/workspace/JIT context files.md rule files via auto-discovery (convention still sparsely documented)
Non-interactive modecodex execclaude -pgemini -p or headless modeagy -p
MCPYesYesYesYes (mcp_config.json, same format)
Local reviewBuilt-in /review for diff, branch, commit, and uncommitted changesCode review through Claude Code workflows, plugins, and CI/CD integrationsNo focused /review flow like Codex; can analyze a diff via prompt/diff shows the agent’s changes; not a standalone review flow
Cloud/team surfaceCodex Cloud, GitHub code review, and ChatGPT workspace features depending on planTerminal, IDE, desktop, web, Slack, CI/CD, scheduled tasks, and Agent SDKGoogle AI/Code Assist/Vertex AI, extensions, subagents, and Google Cloud pathsAntigravity 2.0 desktop app with shared engine and session export
Usage view/status and Codex usage dashboard/cost for API users, /stats for subscribers/stats model/credits panel + credits in the status bar
RiskCodex CLIClaude CodeGemini CLIAntigravity CLI (agy)
Default accessCodex 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.agy asks for permission before file edits and commands; trusted workspaces can be defined in settings.
SandboxOS 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.--sandbox flag with terminal restrictions and a “proceed-in-sandbox” permission mode.
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.--dangerously-skip-permissions auto-approves everything — isolated environments only.
Prompt injectionWeb 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.Google’s own docs explicitly warn about prompt injection and data exfiltration — use the sandbox and read approvals.
Good starting modeRead-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.Google sign-in, start in a Git repo with a read-only first task.

Strengths

  • Strong local Git workflow: /review, diff reading, branch/commit review, and transcript.
  • Clear sandbox and approval model with flags such as --sandbox, --sandbox workspace-write, --ask-for-approval, and --yolo.
  • Good for OpenAI/ChatGPT users, especially when Codex Cloud and code review matter.
  • codex exec works well for scripts, automation, and CI-style use.
  • AGENTS.md discovery works well in repositories and monorepos.

Weaknesses

  • Windows is best through WSL, and native Windows should be treated as more experimental.
  • Full access is easy to choose, but should only be used in an isolated runner or VM.
  • API key usage does not include every cloud-based Codex feature.

Strengths

  • Very broad product surface: terminal, VS Code, JetBrains, desktop, web, Slack, CI/CD, and scheduled tasks.
  • Good for long conversations, planning, refactors, PR work, and teams.
  • CLAUDE.md, .claude/rules/, auto memory, hooks, skills, and custom commands provide strong workflow control.
  • Can consume piped input through claude -p and Unix-style flows.
  • Native installer auto-updates on macOS/Linux/WSL.

Weaknesses

  • More of a system than a simple CLI, so there are more concepts to understand.
  • Memory and hooks can make context large if they are not maintained.
  • Non-interactive -p is powerful, but the docs note that some trust checks do not apply the same way as in interactive use.

Strengths

  • Easy Google start and a generous free quota for Google sign-in.
  • Good for Google/Gemini/Vertex AI workflows and pay-as-you-go through Gemini API key.
  • GEMINI.md has global, workspace, and just-in-time context, and the filename can be configured.
  • Headless mode can return JSON/JSONL with usage statistics.
  • Checkpointing, worktrees, subagents, extensions, and sandboxing provide many advanced options.

Weaknesses

  • Several features are marked experimental or require manual enabling, including worktrees and checkpointing.
  • Google AI Plus is not listed as a supported CLI paid tier in the Gemini CLI docs.
  • Google Workspace accounts can require Google Cloud project configuration.
  • Most important: free access, Google AI Pro, and Ultra shut down on June 18, 2026.

Strengths

  • A single self-contained Go binary: millisecond startup, low RAM usage, and no Node.js/npm dependencies.
  • Designed for SSH and keyboard-first work — including a login flow that works on headless servers.
  • Shares its agent engine with the Antigravity 2.0 desktop app; sessions can be exported and continued in the GUI.
  • MCP support with the same config format as Claude Code/Gemini CLI, plus a plugin system.
  • G1 credits let you continue when your Google account quota runs out (/credits).

Weaknesses

  • Not open source — a closed binary, unlike Gemini CLI and Codex CLI.
  • Young (version 1.0.x): documentation is still sparse, e.g. the convention for project instruction files is not clearly documented.
  • Telemetry/data sharing is enabled by default (can be turned off in settings).
  • No built-in /review flow like Codex — only /diff over the agent’s own changes.
NeedCodex CLIClaude CodeGemini CLI
Repository rulesAGENTS.mdCLAUDE.mdGEMINI.md
Global rules~/.codex/AGENTS.md~/.claude/CLAUDE.md~/.gemini/GEMINI.md
Folder-specific rulesNested AGENTS.md or AGENTS.override.md.claude/rules/*.md with path scopeJust-in-time GEMINI.md close to files/folders
Good monorepo modelShort root file and app-specific instructionsRoot CLAUDE.md plus per-area rulesGlobal/workspace/JIT context hierarchy

Antigravity CLI (agy): the discovery system loads .md rule files and rules.json, but the convention (file names and locations) is not yet clearly documented by Google. For now: keep instructions short and test what agy actually picks up.

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:

  • How large the repository is.
  • How much context instruction files and MCP servers add.
  • Whether the agent reads many files or runs several subagents.
  • Whether you use subscription limits, credits, or API pay-as-you-go.
  • Whether you use expensive reasoning models for routine tasks.

Short choice:

SituationBest pricing model
Learning and manual useSubscription or free tier.
Many small daily terminal tasksPlan with included CLI usage.
CI, bots, and automationAPI key with spend limits and separate keys.
Team and complianceBusiness/Team/Enterprise with admin, SSO, and usage reporting.

See pricing, plans, and API prices for current numbers.

  1. Start in a clean Git repository.
  2. Run git status.
  3. Ask the CLI to explain the project without changing files.
  4. Let it propose test and build commands.
  5. Only then approve one small change.
  1. Use Codex or Claude Code to make a small change.
  2. Run build/test.
  3. Use another CLI to read the diff.
  4. Ask the review agent to focus on bugs, security, and missing tests.

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.

Terminal window
git worktree add ../my-project-ai -b ai/experiment
cd ../my-project-ai

Gemini has an experimental --worktree flow. Codex and Claude can also be used inside normal Git worktrees.

ProfileStart withAdd later
Solo developer with ChatGPTCodex CLIClaude Code for long plans or agy for a second opinion.
Solo developer with a Google accountAntigravity CLI (agy)Codex or Claude when you want stronger review or agent workflows.
Team already using ClaudeClaude CodeCodex as a local reviewer on critical diffs.
Team using OpenAI/ChatGPT BusinessCodex CLIClaude Code or agy for alternative reviews.
Google Cloud teamGemini CLI (paid API/Vertex AI)Codex or Claude for independent code review.

Last checked: June 2, 2026.


Comments