September 4, 2026

Claude Code vs Codex CLI vs Antigravity CLI: 2026 Comparison

Sergio Tereshchenko
Written by
A Mac specialist with a QA engineering background, focused on troubleshooting and how-to guides.

Sergio Tereshchenko

Vladimir Nuzhdin
Approved by
Reviewed by a Mac developer at Nektony and Apple Certified Support Professional with hands-on experience building macOS apps.

Vladimir Nuzhdin

Share

By mid‑2026, AI coding CLIs stopped being something devs experimented with on the side:

  • 84% of developers now use or plan to use AI tools in their workflow, up from 76% a year before, and 51% work with one daily1.
  • Three tools dominate that conversation right now: Claude Code from Anthropic, Codex CLI from OpenAI, and Antigravity CLI from Google.

The gap between them isn't just about an abstract 'which is smarter' question; it is about which one fits your job, your security tolerance, context window, and what you can afford.

In this comparison, I'm not naming one overall winner. Instead, I'll make it clear what each tool can do, including with a real repository, terminal, and shell access. I'll also speak of agents, skills, and MCP support, where their security models differ, and what happens to your token bill when a session runs long, so that you can match a tool to the job in front of you.

Entry price Context window Security model
Claude Code Bundled into Claude Pro/Max, or API Large, reasoning‑optimized; 200K - 1M OS‑enforced sandbox; approval flow on destructive commands
Codex CLI Bundled into ChatGPT subscription or API ~400K in the CLI, up to 1M via the API (model‑dependent) Three explicit modes: Read‑Only, Workspace‑Write, Danger‑Full‑Access
Antigravity CLI Free tier (no card); AI Pro $20/mo; AI Ultra $100/mo Up to ~1M tokens (Gemini 3 Pro) Approval‑based; historically criticized for over‑caution

Testing more than one? Clean up before you commit

If you're trialing two or three before settling on one, dropping the losers isn't as clean as dragging to Trash. Each of these CLIs leaves config folders, cached models, and hidden files. A quick pass with App Cleaner & Uninstaller catches what a manual drag‑to‑Trash won't, and it's worth doing to uninstall such an app from Mac the right way.

How I tested AI CLI tools

My test environment was as follows:

Tool version

  • Claude Code (Claude Opus 4.8, released May 28, 2026),
  • Codex CLI (current July 2026 release),
  • Antigravity CLI v1.1.8 with Antigravity GUI v2.4.2.

THardware

  • MacBook Pro, Apple M1, 8 GB RAM, macOS Tahoe 26.4.1.

I tested all three tools against the same four tasks:

  1. Finding and explaining a bug in an existing repository,
  2. Running a multi‑file refactor,
  3. Writing and executing a unit test, and
  4. Performing a shell command with a side effect (file creation and git commit) to observe how each tool requests confirmation.

Tasks were run independently per tool in fresh sessions.

I graded each on accuracy (how much manual cleanup after), speed, token spend, how the CLI feels inside Terminal.app or iTerm2, and how friendly the first run is for someone who hasn't touched the tool before.

Feature comparison: What each CLI has

Claude Code Codex CLI Antigravity CLI
Subagents YesNative, own context/prompt/tools Yes3 built‑in types (default/worker/explorer) YesCarried from Gemini CLI
Multi‑agents YesExperimental, env‑var flag YesSubagent with fan‑out and result collection YesAsync subagents, monitored in a panel
Skills YesMerged with slash commands Yes YesGlobal + per‑workspace folders
Hooks YesPreToolUse, SessionStart… YesUser‑defined shell hooks YesJSON format
Persistent project memory YesCLAUDE.md LimitedMostly AGENTS.md, largely prompt‑only YesGEMINI.md (legacy), migrating to AGENTS.md
MCP client Yes Yes Yes
Native git worktree Yes Not a branded native feature Not a branded native feature
Session fork/clone Yes /fork Yes /fork No
Sandbox tiers LimitedApproval flow + OS sandbox, no named tiers YesRead Only, Workspace Write, Danger Full Access LimitedPartial, softer defaults, no crisp named tiers
Headless/CI‑CD mode Yes-p flag Yescodex exec Yes-p flag
Desktop app No Yes Yes
IDE extension YesVia integrations/plugins YesOfficial extension Existed as Gemini Code Assist
Free tier No Partial Limited Yes (Quota‑based)

Claude Code: For code quality and multi‑file reasoning

Pricing: $20 or $100/month, or pay‑per‑token API ($10–30/day under heavy use)
Default model: Claude Opus 4.8, switchable to Sonnet 5/Haiku 4.5
Install (macOS): Native installer, NPM, or Homebrew
Chip support: Intel and Apple Silicon, both native, no Rosetta needed
Security: OS‑enforced sandbox + confirmation on destructive commands
Claude Code terminal session

Claude Code is Anthropic's terminal agent, positioned around multi‑file reasoning and code quality over raw speed. In the SWE‑bench Pro benchmark, Opus 4.8 (the default model as of May 28, 2026) scored 69.2%, up from 64.3% on the prior version, according to the official Anthropic announcement.

Installing Claude Code on macOS

The recommended path on macOS is the native installer, which does not require Node.js.

Alternatives:
npm i -g @anthropic-ai/claude-code

Copy

(requires Node.js 22+, starting with v2.1.198; earlier Node versions trigger an EBADENGINE warning but do not abort the install) or Homebrew. On Apple Silicon (M1 through M5), all components are native arm64 binaries with no Rosetta 2 dependency. On Intel Macs, the same npm or native installer path applies.
Claude Code installation in Terminal on macOS using the native installer

One detail worth noting if you installed via npm or Homebrew: those package managers do not trigger Claude Code's built‑in auto‑update mechanism. Updates go through the package manager's own workflow, not through Claude Code itself.

Repository analysis

  • Claude Code indexes a repository through CLAUDE.md, a project‑level context file placed at the repository root. The file carries persistent instructions across sessions: coding standards, architecture notes, commands the agent can run.
  • When a new session starts, the agent loads CLAUDE.md automatically without re‑prompting. This is the clearest practical difference from Codex CLI, which handles project context primarily through the session prompt rather than a persistent file.
  • On a mid‑sized repository (10–50k lines), that context file is doing real work: search accuracy stays consistent across sessions instead of resetting each time you open a new terminal.

Terminal access and security

  • Claude Code requests explicit confirmation before destructive shell commands (
    rm, git push --force,

    Copy

    writes outside the working directory).
  • That's the built‑in approval flow layered on top of the OS‑enforced sandbox.
  • Supported shells on macOS: Bash, Zsh (the default since macOS Catalina 10.15).

Coding workflows

Opus 4.8 added Dynamic Workflows: a leading agent can spawn up to 1,000 parallel subagents for repository‑wide migrations, with approximately 16 running simultaneously at any moment. This is the most aggressive parallelism available across the three tools.

Helpful tricks in Claude Code

Status line

In a terminal Claude Code session, run
/statusline

Copy

to set it up at the bottom so you can see:
  • Current model name and directory
  • Git branch/status
  • Context window usage remaining
  • Claude.ai rate limit usage (5‑hour/7‑day)
Claude Code showing status line

Grilling

  • "Grilling" is a community skill (
    /grilling

    Copy

    , also packaged as
    grill-me

    Copy

    or
    grill-with-docs

    Copy

    ) that installs like any other SKILL.md in
    .claude/skills/

    Copy

    .
  • It runs the agent through a structured interrogation of a plan or design, asking one question at a time before you write code, proposing its own suggested answer for each, to surface assumptions you haven't actually checked.
  • It skips questions that can be answered by reading the repo; the agent looks them up directly. Use it before building something nontrivial, not after.

Fork

  • The
    /fork

    Copy

    command spins up a subagent that inherits the full conversation history, same system prompt, same tools, same model, full message history.
  • It clones the session at that exact point into an independent branch.
  • That means testing a risky refactor in a forked session without any risk to the main conversation's context.
Claude Code /fork command in Terminal

git worktree

  • Claude Code has native support for git worktree, so that you can work on multiple feature branches in parallel without conflicts.
  • Each session runs in its own working directory with its own index and HEAD, all sharing the underlying git objects and refs with the main repository.
  • The standard git command creates the worktree:
git worktree add ../project-feature-x feature-x

Copy

Then a separate session runs inside that directory. That's the setup for running several AI sessions on different branches at once.

Codex CLI: For software‑engineering, not conversational type

Pricing: $0 (limited), $7/20/120 per month, or pay‑per‑token ($3–8/day)
Default model: GPT‑5.6, switchable to Sol/Terra/Luna
Install (macOS): NPM or Homebrew
Chip support: Intel and Apple Silicon
Security: Read‑Only, Workspace‑Write, and Danger‑Full‑Access modes
Codex CLI terminal session

Codex CLI is a software‑engineering agent rather than a conversational one, described by OpenAI as experimental. It's narrower in scope than Claude Code or Antigravity.

Its strongest differentiating feature is explicit, named sandbox modes and, in independent tests, lower token consumption per task compared to Claude Code. The drawback is less persistent project memory and a less polished first‑run experience.

Installing Codex on macOS

Four installation paths:

  • npm i -g @openai/codex

    Copy

    (requires Node.js 22+)
  • curl -fsSL https://chatgpt.com/codex/install.sh | sh

    Copy

    (no Node.js required)
  • brew install --cask codex

    Copy

    (Homebrew)
  • codex-aarch64-apple-darwin.tar.gz from GitHub releases;
    chmod +x

    Copy

    and drop to
    /usr/local/bin

    Copy

    or
    ~/.local/bin

    Copy

Codex CLI installation in Terminal on macOS

Sandbox modes

Codex CLI's most distinctive structural feature is three permission tiers:

  • Read‑Only Mode: Blocks file writes and command execution outright. Safe for code review and exploration.
  • Workspace‑Write Mode: Allows writes and commands only inside the directory.
  • Danger‑Full‑Access Mode: Removes the restrictions entirely.

This explicit tiering is cleaner than Claude Code's approval‑flow model for users who want to know exactly what the agent is allowed to do before it starts. Claude Code's sandboxing is enforced, but the boundaries are less visibly named.

Project memory

  • Codex CLI does not have a persistent project memory file equivalent to CLAUDE.md or GEMINI.md.
  • It operates primarily in prompt‑only mode: a new session starts without knowledge of prior sessions unless the context is re‑supplied.
  • The AGENTS.md file at the project root carries project‑level instructions, but without the same automatic persistent‑context behavior as CLAUDE.md.
  • For teams running repeated tasks against the same codebase, this requires either pasting context into each session or wrapping sessions in a script.

Coding agents and token efficiency

  • Codex CLI is scoped specifically to software‑engineering tasks, in contrast to the more conversational feel of Gemini/Antigravity.
  • One independent test measured 72,579 tokens for Codex against 234,772 for Claude Code on an identical TypeScript task2. That's a single author's setup, not an official benchmark, so treat it as a data point, not a rule.

Repository understanding

  • Codex CLI has essentially no persistent project memory comparable to CLAUDE.md or GEMINI.md. It runs largely prompt‑only.
  • Practically, that means a fresh Codex session on the same repo won't recall what a previous session already worked out; you're re‑explaining context each time unless you build that habit into your own workflow.

Antigravity: For large monorepos and mixed‑data tasks

Pricing: $0, Pro $20/month, Ultra $100/month, Ultra Max $200, or $0.01 per AI credit
Default model: Gemini 3.6 Flash, switchable to 3.5, 3.7, Claude Sonnet 4.6, Opus 4.6, GPT‑OSS
Install (macOS): Native installer or via command line
Chip support: Intel and Apple Silicon
Security: Softer defaults than Claude Code or Codex; no named tiers
Antigravity GUI showing main window
  • As of June 18, 2026, Google redirected most Gemini CLI users to a new product called Antigravity CLI.
  • It kept the features that made Gemini CLI popular: Agent Skills, Hooks, Subagents, and Extensions (renamed to Antigravity plugins).
  • Before the transition, Gemini CLI had racked up millions of users, more than 100,000 GitHub stars, and over 6,000 merged pull requests3.
  • It's written in Go rather than Node, which results in a more responsive interface than the old Gemini CLI.
  • Antigravity can orchestrate several agents in the background without blocking your terminal session.

Installing Antigravity on macOS

There are two options to have Antigravity.

This is the way to have Antigravity installed as a CLI in v.1.1.8:

curl -fsSL https://antigravity.google/cli/install.sh | bash

Copy

  • This way places the agy binary at ~/.local/bin/agy.
  • Run agy from inside a project folder to open its TUI.
  • Exit with
    /logout

    Copy

    .

And the second way is to download a dmg. file from the official website to have Antigravity as GUI in v.2.4.2.

Context window

  • Antigravity CLI with Gemini 3 Pro supports up to ~1M tokens of context, which is the largest practical context window among the three tools and the strongest argument for it on large monorepos or data‑heavy tasks where the other tools require chunking.

Free tier: what 'free' means now

  • Antigravity CLI has a free tier with no card required, but it works on a quota model rather than a fixed daily request limit.
  • The quota refreshes approximately every five hours up to a weekly ceiling.
  • For teams or individuals who need predictable access, there are AI Pro ($20/month), AI Ultra ($100/month), and AI Ultra Max tiers.

Three practical differences

Strip away the feature checklists, and three dimensions actually decide which of these fits a given project.

Claude Code Codex CLI Antigravity CLI
Security Approval flow + OS sandbox Three tiers Softer defaults
Context 200K - 1M, reasoning‑optimized ~400K in the CLI, more on API Up to ~1M on Gemini 3 Pro
Pricing Bundled in Pro/Max subscription, shared usage pool Based on ChatGPT subscription, shared usage pool Free tier, Pro, Ultra, Ultra Max subscriptions, or token‑based

Security

Security has matured across the board over the past year: this isn't 'Claude Code has a sandbox and the others don't' anymore. All of them now go with OS‑ or container‑level sandboxing plus a layered approval system.

Compared to Claude Code and Antigravity, Codex is the most straightforward about it: Read‑Only, Workspace‑Write, and Danger‑Full‑Access are named states you can see and choose, not an implicit behavior you have to infer.

Context

All three now sit near the 1M‑token mark on their flagship models, which is new as of 2026 and changes what "too big for the AI to hold in its head" means for a monorepo.

  • Antigravity's window can be ~1M if integrated with Gemini 3 Pro;
  • Codex sits around 400K in the CLI itself with more headroom via the API;
  • Claude Code's window ranges from 200K to 1M.

Pricing

These aren't just different price tags; the structures are different shapes:

  • Claude Code and Codex both fold into a chat subscription with a shared usage pool (Claude Pro/Max, or a bundled ChatGPT plan). Codex can be free, but limited. And Antigravity's free tier is more capable.
  • Prices are almost similar: from $7 in ChatGPT for Codex to test things, and the lowest entry price is $20, which may be enough for non‑heavy tasks. The $100-120 rate must be enough for heavy tasks.

Agents and subagents

All three tools support subagents, isolated model instances spawned by the main session to spin up for specific tasks with their own context window, system prompt, set of tools, and (optionally) their own model.

Claude Code

  • Native subagent support out of the box, plus an experimental Agent Teams mode (multiple independent Claude Code sessions talking to each other directly, not just through a parent).
  • Opus 4.8 added Dynamic Workflows on top: a lead agent that spins up to 1,000 parallel subagents for repo‑scale work, capped around 16 running at once.

Codex CLI

  • Subagents ship on by default in current releases.
  • Three built‑in types: default (general purpose), worker (execution‑focused), and explorer (read‑only code analysis).
  • Custom agents are defined in .toml files. Switch between agent threads with
    /agent.

    Copy

Antigravity CLI

  • Subagents existed in Gemini CLI and carried over to Antigravity
  • The config format didn't migrate:
    ~/.gemini/agents

    Copy

    versus the new
    ~/.gemini/antigravity-cli/agents/

    Copy

    aren't compatible, and there's no automatic migration.
  • Antigravity's subagents run asynchronously, watchable in a separate
    /agents

    Copy

    panel without blocking the main terminal.

How to enable

  • Claude Code's subagents work out of the box.
  • Agent Teams needs that environment variable flipped on, since it's still experimental.
  • Codex CLI's one is enabled in current releases.
  • Antigravity CLI's are also on by default, configured through files in
    .agents/

    Copy

    and a systemPromptConfig JSON block.

Can they run unsupervised?

All three apps support some form of autonomous or background operation:

  • Claude Code: background tasks and Auto Mode;
  • Codex:
    codex exec

    Copy

    for CI/CD and headless runs;
  • Antigravity CLI async background workflows;
  • None makes full autonomy the default;
  • Every one of them keeps an approval layer on top.

Skills (skill.md open standard)

  • A skill is a reusable instruction package: a SKILL.md file, optionally paired with scripts, templates, or reference material.
  • Agent loads it on demand, either directly via a slash command or automatically when it recognizes a matching task from the skill's description.
  • This is an open, cross‑tool standard (Agent Skills, published by Anthropic in October 2025), not a feature exclusive to any one CLI.

Availability

Skills in SKILL.md format work across all three tools:

  • Claude Code (
    .claude/skills/

    Copy

    )
  • Codex CLI (
    ~/.codex/skills/

    Copy

    ), and
  • Antigravity CLI (
    ~/.gemini/antigravity-cli/skills/

    Copy

    for global skills and
    .agents/skills/

    Copy

    for workspace‑level).
In Claude Code, custom slash‑commands (
.claude/commands/

Copy

) and skills have merged: a file at
.claude/commands/deploy.md

Copy

and a skill at
.claude/skills/deploy/SKILL.md

Copy

both create the same
/deploy

Copy

command.

Value

A skill defines three things:

  • when to trigger itself (a frontmatter description),
  • what to do (markdown instructions), and
  • what supporting files to pull in.

The practical value is not repeating the same instructions in every new session: instead of pasting guidelines into a prompt each time, a skill loads on demand with the context a task needs: how to format a PR, how to run a security review, how to generate docs.

So, this is about automating routine tasks.

The Anthropic official skills library delivers ready‑made skills for PDF, Word, Excel, and PowerPoint processing. And the community mirrors the idea for Codex and Antigravity CLI through third‑party repositories. For example,
alirezarezvani/claude-skills

Copy

ports over 345 skills across 13+ tools.

MCP servers

Model Context Protocol is an open protocol that gives a model a standardized way to reach external tools and data sources (files, APIs, databases, ticket trackers, chat apps) without a custom integration built for every service.

Which AI supports MCP

  • All the said tools act as MCP clients and can connect to external MCP servers.
  • Codex CLI goes one step further and can also act as an MCP server.
  • Claude Code can call Codex's agents through MCP, and vice versa.

Through MCP, any of the three can connect to essentially any service with an MCP server built for it: a fast‑growing ecosystem of public registries, official vendor servers (Atlassian, Slack, Google), and community‑maintained ones.

Popular MCP servers

  • Jira (ticket retrieval, updates, JQL search),
  • Slack (reading and sending messages, searching channels),
  • Telegram (less standardized, usually community‑built rather than official), and
  • Google Drive/Docs, GitHub, and Figma, among the most widely used in practice.

Local vs. remote servers

  • Local servers run as a process on your device (usually over stdio): they see your filesystem and tend to respond faster, but need dependencies installed locally.
  • Remote servers are reached over URL/HTTP/SSE, often behind OAuth: no local install, skip the local install but add network latency and a browser‑based sign‑in step.

Problems with API access

  • Rate limits on an MCP connection usually belong to the third‑party service, not the CLI.
  • The bigger issue is that connecting a service often means handing over a broadly scoped API token or key, and an MCP server typically runs outside the CLI's sandbox.
  • So a compromised server is a real exposure, not a theoretical one. Community‑built servers are also less stable than vendor‑maintained ones like Atlassian's or Slack's official integrations.

Final thoughts

Choose Claude Code if

  • The priority is code quality and accuracy on complex multi‑file tasks.
  • Persistent project context across sessions matters: CLAUDE.md keeps the agent oriented without re‑prompting.
  • You want git worktree support and native subagents for parallel feature branch work.
  • You are going to pay at least $20 and at most $100 per month.

Choose Codex CLI if

  • You already have a ChatGPT subscription and want to extend it to a terminal agent.
  • Sandbox levels (Read‑Only / Workspace‑Write / Danger‑Full‑Access) are important for your security model.
  • Token efficiency matters: independent tests suggest lower token consumption per task compared to Claude Code, though the difference varies by task type.

Choose Antigravity if

  • You need a context window up to ~1M tokens for a large monorepo or deep analysis.
  • You already hold a Google Cloud or Gemini Enterprise Agent Platform contract, in which case either the legacy CLI or Antigravity CLI stays available to you on existing terms.
  • You want a free tier or are ready to pay from $20 per month.

Sources

  1. Stack Overflow Developer Survey.
  2. Developer Harsh test.
  3. Update in the Google blog for developers.

Frequently asked questions

How to switch models in Claude Code?

  1. The
    /model

    Copy

    command opens an interactive picker without arguments; with an alias (
    /model opus

    Copy

    ,
    /model sonnet

    Copy

    ,
    /model haiku

    Copy

    ), it switches immediately and preserves the full conversation history.
  2. The
    /model opusplan

    Copy

    mode uses Opus for the planning phase and a lighter model for execution.
  3. Switching models mid‑session does not preserve the prompt cache: the accumulated context is reprocessed at full input cost against the new model.

Which of these tools hallucinates less?

  • Technically, the hallucination rate is a property of the underlying model, not the CLI shell around it, and each CLI lets you switch models.
  • Compact, non‑reasoning models tend to win: GPT‑5.4‑nano and Gemini Flash‑Lite post some of the lowest error rates, while heavier reasoning models score worse.
  • On AA‑Omniscience, which measures knowledge plus calibration (rewarding 'I don't know' over a confident guess), the Claude Opus line consistently comes out more conservative than its competitors.
  • Anthropic deliberately tunes it to abstain rather than fabricate, which gives Opus 4.7/4.8 one of the lowest hallucination rates in its class.
  • That's a product of frequent abstention, not superior knowledge, and it's worth reading it that way rather than as 'Opus knows more.'
  • In all tools, reasoning mode increases hallucination by 2-3x compared to standard mode.

Which tool is free to use?

Antigravity is the only one of the three with a free option.

  • Antigravity CLI: Free tier, no credit card required, with quota limits.
  • Codex CLI: Has a limited free option, but meaningful usage is tied to ChatGPT plans.
  • Claude Code: No standalone free option; access is through a Claude subscription or API usage.

Can I run all three in the same project at the same time?

  • Yes, but be aware of what each one writes. All of them read from and write to the project directory, and each maintains its own config directory (
    ~/.claude

    Copy

    ,
    ~/.codex

    Copy

    ,
    ~/.gemini

    Copy

    ).
  • However, they can modify the same project files. If they work on the same files simultaneously, you can end up with conflicting or overwritten changes, so either run them sequentially or isolate each agent in its own Git worktree.

Which tool is best for beginners?

  • For beginners, Antigravity is probably the easiest starting point. It has a free tier, a more approachable interface, and background agent orchestration, so you can experiment without committing to a paid subscription.
  • Codex CLI is a good choice if you're already comfortable with ChatGPT and want a focused software‑engineering agent.
  • Claude Code is better suited to users who are ready to work more deeply with repositories, persistent project instructions, and terminal workflows.

Can these tools work offline?

No, tools in question can't work offline. They are cloud‑based AI coding agents, so the model needs an internet connection to process your prompts and generate responses. You can run local commands and work with local files through the CLI, but that doesn't make the AI model available offline.

Scroll to Top