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 |
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:
- Finding and explaining a bug in an existing repository,
- Running a multi‑file refactor,
- Writing and executing a unit test, and
- 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 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.
npm i -g @anthropic-ai/claude-code
Copy
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 (writes outside the working directory).
rm, git push --force,Copy
- 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
/statusline
Copy
- Current model name and directory
- Git branch/status
- Context window usage remaining
- Claude.ai rate limit usage (5‑hour/7‑day)
Grilling
- "Grilling" is a community skill (, also packaged as
/grillingCopy
orgrill-meCopy
) that installs like any other SKILL.md ingrill-with-docsCopy
..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 command spins up a subagent that inherits the full conversation history, same system prompt, same tools, same model, full message history.
/forkCopy
- 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.
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 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:
- (requires Node.js 22+)
npm i -g @openai/codexCopy
- (no Node.js required)
curl -fsSL https://chatgpt.com/codex/install.sh | shCopy
- (Homebrew)
brew install --cask codexCopy
- codex-aarch64-apple-darwin.tar.gz from GitHub releases; and drop to
chmod +xCopy
or/usr/local/binCopy
~/.local/binCopy
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 |
- 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 .
/logoutCopy
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
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: versus the new
~/.gemini/agentsCopy
aren't compatible, and there's no automatic migration.~/.gemini/antigravity-cli/agents/Copy
- Antigravity's subagents run asynchronously, watchable in a separate panel without blocking the main terminal.
/agentsCopy
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 and a systemPromptConfig JSON block.
.agents/Copy
Can they run unsupervised?
All three apps support some form of autonomous or background operation:
- Claude Code: background tasks and Auto Mode;
- Codex: for CI/CD and headless runs;
codex execCopy
- 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 (), and
~/.codex/skills/Copy
- Antigravity CLI (for global skills and
~/.gemini/antigravity-cli/skills/Copy
for workspace‑level)..agents/skills/Copy
.claude/commands/
Copy
.claude/commands/deploy.md
Copy
.claude/skills/deploy/SKILL.md
Copy
/deploy
Copy
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.
alirezarezvani/claude-skills
Copy
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



