Claude Code vs Codex vs Gemini CLI: which terminal coding agent to run in November 2026
Three commands install the three terminal coding agents every developer is arguing about in 2026: claude, codex, and gemini. They look interchangeable — type a request, watch the agent read your repo, edit files, and run the tests — but the one you should install depends on a decision Google made in June, and on what $20 a month buys you from each vendor.
- Three agents compared: Claude Code (Anthropic), Codex CLI (OpenAI), and Gemini CLI (Google) — installs, models, pricing, and sandboxing verified against each project's own docs and pages on November 9, 2026.
- Claude Code: Pro $20/month ($17 on annual billing), Max $100, Ultra $200; no free tier. Runs Sonnet 5.5 for daily coding, Opus 5.5 for hard reasoning, and Fable 5.1 for the longest jobs. Its repo, anthropics/claude-code, has 155,079 stars.
- Codex CLI: open source under Apache-2.0 with 134,247 stars; latest release rust-v0.167.0, published November 6, 2026. Runs on a ChatGPT Plus plan ($20/month) with GPT-6.1 Sol and GPT-6 Luna, or on an API key billed per token.
- Gemini CLI: 108,802 stars, Apache-2.0, latest v0.67.0 (November 4, 2026). Free individual access ended June 18, 2026 — announced on Google's Developers Blog on May 19, 2026. Enterprise Code Assist licenses and paid API keys keep working.
- Antigravity CLI (agy) is Google's replacement: a free Individual plan with basic weekly rate limits, Google AI Pro at $19.99/month, Ultra from $99.99/month. Gemini 3.8 Flash is the baseline agent model; Gemini 4 Argon arrived October 13, 2026 for Ultra and eligible Enterprise plans.
- Context windows: Gemini CLI launched with a 1-million-token window; Claude Code plans list up to 1M tokens depending on the model. Codex does not publish a single context number — it varies by model.

How a terminal coding agent actually works#
Strip away the branding and all three run the same loop. Say you ask one to add rate limiting to a login route. First it reads: the file tree, the route handler, the middleware around it, and a memory file in the repo — CLAUDE.md, AGENTS.md, or GEMINI.md — where you keep the project's rules. Then it plans, breaking the job into steps and sometimes showing you the plan before it starts.
Then it edits, file by file, and runs the commands to check its own work: the test suite, the linter, the typechecker. Then it verifies and reports — a diff to review, a summary of what changed, and a stop when the tests pass or it gets stuck. Read, plan, edit, run, verify. That loop is the product. The model, the price, and the sandbox are dials on it.
One detail matters more than the marketing admits: a single prompt is not a single model call. A medium task can mean dozens of calls as the agent reads files, retries a failing test, and re-checks its edits. That is why usage is metered in requests or tokens, never in prompts — and why the old Gemini free tier counted 1,000 model requests a day, not 1,000 prompts. A "request" is one call to the model, and an agent burns through them fast.
Getting started is one install command each:
# Claude Code (macOS, Linux, WSL)
curl -fsSL https://claude.ai/install.sh | bash
# Codex CLI (macOS, Linux)
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# Gemini CLI
npx @google/gemini-cli
Then you run claude, codex, or gemini inside a project folder and type the task. All three also run headless — claude -p "review these changed files", gemini -p "explain this codebase" --output-format json — which is how they end up in CI pipelines and scripts.

The safety question is the same on all three: an agent that can edit files and run shell commands needs a leash. Codex ships the most explicit one — three sandbox modes, read-only, workspace-write, and danger-full-access, with network access off by default and an approval policy that decides when it must stop and ask. Claude Code offers a sandboxed Bash tool plus dev containers, Docker, and VMs. Gemini CLI has sandboxing and trusted folders. The default posture everywhere is the same: writes stay inside your workspace, the network stays off, and anything outside needs your yes.
The three contenders at a glance#
The table below is the whole comparison in one place. Everything in it was checked against the vendor's own docs or pricing page on November 9, 2026 — prices are a snapshot, not a quote.
| Agent | Cheapest way in | License | Model doing the work | Free tier |
|---|---|---|---|---|
| Claude Code | Pro, $20/mo ($17 annual) | Proprietary | Sonnet 5.5 daily; Opus 5.5 and Fable 5.1 for hard jobs | None — Free plan excludes it |
| Codex CLI | ChatGPT Plus, $20/mo | Apache-2.0 | GPT-6.1 Sol and GPT-6 Luna on Plus | Limited — desktop app only on Free |
| Gemini CLI | Enterprise Code Assist license or paid API key | Apache-2.0 | Gemini models via Code Assist | Ended June 18, 2026 |
Two of the three cost exactly $20 a month at the entry tier. The difference is what that $20 sits on top of: a Claude subscription you may already pay for, or a ChatGPT subscription you may already pay for. If you pay for neither, Google's replacement — Antigravity CLI, below — is the only $0 route left among the three.
Claude Code: the polished daily driver#
Claude Code is Anthropic's agent, and it shows in the fit and finish: a native installer that auto-updates, a VS Code and JetBrains extension, a desktop app with a Code tab, and a web version that runs sessions in the cloud. It reads your codebase, edits across multiple files, runs commands, and works directly with git — staging changes, writing commit messages, opening pull requests.
The model setup is the most flexible of the three. Sonnet 5.5 handles daily coding; Opus 5.5 takes the complex reasoning; Haiku 5.5 is the fast, cheap option for simple tasks. Fable 5.1 is the top model, built for jobs larger than a single sitting — it investigates before acting and verifies its own work — and you reach it with /model fable or claude --model fable. Switch models mid-session with /model, and subagents inherit the model you are running.
Pricing is where Claude Code asks the most. The CLI itself is free to install, but it does no work on the free Claude plan. Pro is $20 a month ($17 on annual billing) and includes Claude Code; Max is $100 a month for 5x Pro's usage every five hours and every week, plus $100 a month in API credits to build on the Claude Platform; Ultra is $200 a month for 10x weekly usage, no five-hour limit for verified accounts, and $200 in API credits. One catch the pricing page states plainly: your terminal sessions and your chats draw from the same usage pool, so a long chat can eat capacity you expected to spend on code. The alternative is API billing through a Console account, which suits CI and spiky automated work.
The depth is in the extras: CLAUDE.md memory files, reusable skills, hooks that run shell commands before or after agent actions, parallel subagents with a lead agent coordinating them, and MCP servers that connect the agent to Google Drive, Jira, or Slack. We compared Claude Code against Copilot and Cursor in September, when it led on hard multi-file work — that verdict still holds for the terminal version.
Codex CLI: the open-source all-rounder#
Codex CLI is the only fully open-source agent of the three — Apache-2.0, written in Rust, 134,247 stars on GitHub, and a new release every few days (the latest, rust-v0.167.0, shipped November 6, 2026). Install it with the script, npm (npm install -g @openai/codex), or Homebrew, run codex, and sign in with ChatGPT.
Access rides on your ChatGPT plan: Plus at $20 a month is the first tier that lists the CLI, with GPT-6.1 Sol and GPT-6 Luna; Pro starts at $100 a month across three tiers with longer sessions and GPT-6 Astra. Free and Go ($8 a month) get limited Codex access in the desktop app only. Or skip the subscription and run the CLI on an OpenAI API key, billed per token — the route for CI jobs and teams that want metered usage without a seat.
Codex's real edge is its permission model, and it is the most explicit of the three. The sandbox is enforced by the operating system, not by a system prompt: read-only lets the agent read and run commands but never write; workspace-write confines edits and commands to your project, with network off unless you turn it on; danger-full-access removes every boundary. The recommended setup for a version-controlled folder is codex --sandbox workspace-write --ask-for-approval on-request. The escape hatch — --dangerously-bypass-approvals-and-sandbox, alias --yolo — runs every generated command with your full user privileges, and OpenAI's own docs flag it as elevated risk, for a throwaway VM only.
It is also the most portable of the three: the same agent runs in the terminal, as an IDE extension, in a desktop app (codex app), and as a cloud agent on the web. And if you run both agents, Claude Code can host Codex as a plugin — two agents, one repo.
Gemini CLI: the one that changed#
Gemini CLI launched June 25, 2025 as the generous one: a personal Google account got Gemini 2.5 Pro with a 1-million-token context window, 60 requests a minute and 1,000 a day, free. It hit 108,802 stars, shipped weekly releases, and for a year was the default recommendation for anyone who wanted a terminal coding agent without paying.
Then Google ended it. On May 19, 2026, the Developers Blog announced that on June 18, 2026, Gemini CLI and the Code Assist IDE extensions would stop serving requests for Google AI Pro and Ultra subscribers and for everyone using Code Assist for individuals free of charge. The CLI still exists — latest release v0.67.0, November 4, 2026 — and still works for organizations on Gemini Code Assist Standard or Enterprise licenses, and through paid Gemini API keys. But for individuals, the free tier is gone, and Google says the CLI is not optimized for Gemini 4 or later models.
The replacement is Antigravity CLI, run as agy. It is a Go binary built on the same agent harness as the Antigravity 2.0 desktop app, keeps Agent Skills, Hooks, Subagents, and Extensions (now as Antigravity plugins), and adds asynchronous multi-agent work — several agents running in the background while your terminal stays free. The Individual plan is $0 with basic weekly rate limits (Google does not publish the number); Google AI Pro is $19.99 a month and Ultra starts at $99.99 a month. Gemini 3.8 Flash is the baseline agent model; Gemini 4 Argon, rolled out October 13, 2026, is reserved for Ultra and eligible Enterprise plans.
That makes the Google slot in this comparison a fork, not a single product: enterprise teams keep Gemini CLI on a Code Assist license; everyone else installs agy. Old comparisons that still list Gemini CLI's 1,000 free requests a day are quoting a tier that stopped serving on June 18 — check the date on anything you read.
Which one should you pick?#

- Already paying for Claude Pro or Max: Claude Code. It costs nothing extra, shares your plan's pool, and is the most polished of the three.
- Already paying for ChatGPT Plus: Codex CLI. Same $20, open source, the strongest sandbox, and an API-key route when you outgrow the plan.
- Paying for nothing and want to start today: Antigravity CLI. Free Individual plan, weekly limits, and the only $0 terminal agent left in this comparison.
- Enterprise Google shop: Gemini CLI still works on your Code Assist license — your access never changed.
- Automating in CI: Codex on an API key, or Claude Code on Console credits. Metered billing beats a seat you burn through by noon.
- Hardest single problem, money no object: Claude Code on Fable 5.1 (Max or Ultra) or Codex on Pro with GPT-6 Astra. Both are built for jobs that take hours, not minutes.
The honest summary: there is no bad pick among the three, but there is a wrong one — installing Gemini CLI on a personal Google account and wondering why it does not answer. That door closed on June 18. Everything else is a $20 decision about which subscription you already pay for.