Skip to content
Advertisement

Claude Code vs Codex vs Gemini CLI vs opencode

SumitSumit··12 min read
Claude, OpenAI and Gemini logos above the words AI coding CLIs compared

Four terminal coding agents matter right now: Anthropic's Claude Code, OpenAI's Codex CLI, Google's Gemini CLI and the open source opencode. All four read your repo, edit files, run commands and connect to MCP servers. The differences are in who pays whom, which models you get, and how much control you have.

We have all four installed on the Mac this is written on, and we use Claude Code and Codex daily across about 30 projects. Prices, versions and limits below were checked on official pages on September 26, 2026. The biggest change since most comparisons were written: Gemini CLI no longer has a free tier for personal accounts.

Quick verdict
  • Best overall agent: Claude Code. Strongest at long, multi-step changes, with the richest skills, hooks and plugin system. Needs Claude Pro ($20/month) or API credit.
  • Best if you already pay for ChatGPT: Codex. Included from ChatGPT Plus, open source CLI, strong sandboxing, a cloud version and GPT-6 models.
  • Best for model freedom and cost: opencode. MIT licensed, works with 75+ providers, free models on its Zen gateway, or a $10/month Go plan.
  • Gemini CLI is now for Google Cloud customers only. Free and Google AI Pro/Ultra users were moved to Antigravity CLI on June 18, 2026.
  • Want free? Start with opencode plus free models, or Antigravity CLI. See our free AI coding agents guide.

The four at a glance

Claude Code Codex CLI Gemini CLI opencode
Made byAnthropicOpenAIGoogleAnomaly (formerly SST)
LicenceProprietaryApache-2.0Apache-2.0MIT
GitHub stars~148k~127k~107k~210k
Latest version2.1.283 (Sept 25)0.157.1 (Sept 26)0.61.0 (Sept 23)1.18.32 (Sept 21)
Default modelsClaude Opus 5.5, Sonnet 5GPT-6 Sol, Astra, LunaGemini 3.x (auto routing)Any: 75+ providers
Context window1M tokensAbout 1M tokens1M tokensDepends on model
Cheapest way inClaude Pro, $20/moChatGPT Plus, $20/moCode Assist Standard licence or paid API keyFree (bring a model)
Free tierNoDesktop app only, limitedNo (since June 18, 2026)Yes, free models on Zen
Instructions fileCLAUDE.md (reads AGENTS.md too)AGENTS.mdGEMINI.mdAGENTS.md, falls back to CLAUDE.md
MCP, skills, hooksYes, yes, yesYes, yes, yesYes, yes, yesYes, yes, plugins
Cloud / web versionYesYesNoNo

Stars are rounded GitHub counts. opencode's lead partly reflects that it is fully open source and model-neutral, so the whole BYOK crowd lands there.

How we scored: each agent gets a score out of 10 from daily use across about 30 of our own repos, weighing the quality of results first, then price and free access, then the extension ecosystem. Scores reflect September 2026 and will change as the tools do.

Claude Code

Pros

  • Best results we have seen on long, multi-file changes
  • Deepest extension system: skills, plugins, hooks, subagents, MCP
  • Permission modes from ask-everything to a classifier-based auto mode, plus a Bash sandbox
  • Runs in the terminal, VS Code, JetBrains, a desktop app, the web and Slack
  • Reads AGENTS.md natively since 2.1.277, so shared repos just work

Cons

  • Not open source
  • No free tier: the free Claude plan does not include Claude Code
  • Heavy Opus use burns through Pro limits fast; Max plans start at $100/month
  • Locked to Claude models unless you point it at a gateway

Claude Code is the agent we reach for when a change touches ten files and needs a plan. Since version 2.1.280, Opus 5.5 is the default model on every paid plan and the API, with a native 1 million token context. The ecosystem is its real edge: skills and plugins let you teach it your workflow once, hooks run your scripts on events, and the official plugin marketplace has over 300 entries.

Pricing: Claude Pro is $20 a month ($17 billed yearly). Max starts at $100 a month for five times the Pro usage, with a higher 20x tier. Team plans are $25 per seat (Standard) or $125 (Premium). You can also pay per token with an API key.

Install: curl -fsSL https://claude.ai/install.sh | bash, or brew install --cask claude-code.

Can you run it cheaper? Yes. Claude Code talks to any Anthropic-compatible endpoint, so you can use Claude Code for free with OpenRouter models. Quality drops, but the tooling stays.

9
Our verdict

Claude Code

Best overall agent. The strongest results on long, multi-file changes and the deepest skills and plugin ecosystem. Worth the $20 if you code most days.

Codex CLI

Pros

  • Open source (Apache-2.0) and written in Rust: fast to start
  • Included with ChatGPT Plus, so many people already pay for it
  • Clear sandbox levels: read-only, workspace-write, full access
  • Same account covers the CLI, IDE extension, desktop app and Codex cloud
  • codex exec and an SDK for CI and scripts

Cons

  • CLI needs ChatGPT Plus or higher; the free plan only gets the desktop app
  • Plus limits on GPT-6 Sol are tight for heavy days
  • Smaller skills and plugin ecosystem than Claude Code
  • GPT-5.5 leaves Codex on October 14, 2026, so pinned configs need updating

Codex has become a genuine rival over the past year. The CLI is open source, very fast, and ships new versions almost daily (0.157.1 landed the morning we checked). Version 0.157.0 added the GPT-6 Sol and Luna models: Sol is OpenAI's recommended pick for complex coding, Luna the cheap fast option, and Astra the most capable.

The sandbox model is the clearest of the four. You choose read-only, workspace-write or full access, then an approval policy on top. For teams nervous about an agent running shell commands, that is easy to explain to security.

Pricing: included with ChatGPT Plus ($20 a month), with usage limits per 5-hour window. Pro starts at $100 a month with five times the usage. Business is $25 per user. An API key also works, but without the cloud features. ChatGPT Free and Go users get limited GPT-6 Luna access in the Codex desktop app only.

Install: npm install -g @openai/codex or brew install --cask codex.

8.5
Our verdict

Codex CLI

Best value if you already pay for ChatGPT. Open source, fast, clear sandboxing, and one account covers the CLI, IDE, desktop and cloud.

Gemini CLI (and Antigravity CLI)

The free tier is gone

On June 18, 2026, Google stopped serving Gemini CLI and the Gemini Code Assist IDE extensions for free users and for Google AI Pro and Ultra subscribers. Those users were moved to Antigravity CLI. Gemini CLI still works with a Gemini Code Assist Standard or Enterprise licence, or a paid API key. The "1,000 free requests a day" line you still see in its README and in many articles is out of date.

Pros

  • Open source (Apache-2.0), with a large extension ecosystem
  • 1 million token context
  • Daily quotas of 1,500 (Standard) or 2,000 (Enterprise) requests on business licences
  • Good fit if your company already runs on Google Cloud

Cons

  • No longer usable for free with a personal Google account
  • Consumers are pushed to a different tool, Antigravity CLI
  • Its docs still reference older models and the old free quotas
  • Code Assist for GitHub stopped taking new installs in June

Gemini CLI was the default "free AI coding agent" for most of 2025. That is over. It is now effectively an enterprise tool: good if your company buys Gemini Code Assist, not a sensible choice for a side project.

Antigravity CLI (agy) is Google's replacement for everyone else. It keeps the skills, hooks, subagents and extensions from Gemini CLI, and its free individual tier offers Gemini 3.x Flash, Gemini 3.1 Pro and some Claude and GPT-OSS models under weekly rate limits. It is newer (version 1.2.11 at the time of writing), closed licence, and a much smaller community so far. We cover it in our free AI coding agents guide.

5
Our verdict

Gemini CLI

Still a capable open source agent, but enterprise only since June 2026. Personal users should look at Antigravity CLI or opencode instead.

opencode

Pros

  • MIT licensed and fully model-neutral: 75+ providers, local models included
  • Free models on its Zen gateway, or a $10/month Go plan with generous open-model limits
  • Reads CLAUDE.md and ~/.claude/skills, so a Claude Code setup mostly carries over
  • Polished terminal UI, desktop app and a GitHub integration
  • Can log in with GitHub Copilot or ChatGPT Plus accounts

Cons

  • Results depend entirely on the model you pick
  • Cannot use a Claude Pro or Max subscription (Anthropic prohibits it); Claude needs an API key
  • Free Zen models rotate and are marked limited time
  • No hosted cloud agent

opencode is the one to pick if you care about freedom or cost. It does not sell a model of its own. Instead it connects to whatever you bring: an Anthropic or OpenAI key, OpenRouter, a local Ollama model, or its own gateways. Zen is pay-as-you-go at provider rates with a rotating set of free models. Go is $10 a month and covers open models like GLM, Kimi, Qwen and DeepSeek up to per-model monthly limits.

We keep it installed as the "any model" agent: when a new open model launches, opencode is usually the fastest way to try it on real code.

Install: curl -fsSL https://opencode.ai/install | bash, or brew install anomalyco/tap/opencode.

8
Our verdict

opencode

Best for model freedom and cost. MIT licensed, 75+ providers, free models on Zen. Only as good as the model you pick.

Feature comparison

FeatureClaude CodeCodex CLIGemini CLIopencode
SubagentsYesYesYesYes
Skills (SKILL.md)YesYesYesYes
HooksYesYesYesVia plugins
Plugins / extensionsPlugin marketplacePluginsExtensionsPlugins
MCP serversYesYesYesYes
Headless / CI modeclaude -pcodex execHeadless with JSON outputopencode run
GitHub integrationclaude-code-actionCodex GitHub Actionrun-gemini-cli actionopencode github install
IDE extensionsVS Code, JetBrainsVS Code and forksCode Assist extensionsIDE integration
SandboxBash sandbox + permission modesread-only / workspace / fullSandbox + trusted foldersPer-tool allow, ask, deny

On features the four have mostly converged. Every one now supports MCP and SKILL.md skills, which means an MCP server you add to any of these agents or a skill you write once works across all of them. The differences that remain are the model quality and the price.

Which one should you use?

  • You want the best results and will pay $20+ a month: Claude Code. It is the most capable agent we have used for real multi-file work.
  • You already pay for ChatGPT Plus: Codex. You are already paying for it, and it is very good.
  • You want open source and model choice: opencode. Pair it with a cheap open model or the Go plan.
  • You are on a zero budget: opencode with free Zen or OpenRouter models, or Google's Antigravity CLI free tier.
  • Your company is on Google Cloud with Code Assist licences: Gemini CLI.

Many developers, us included, run two: a premium agent for hard work and opencode for experiments and cheap bulk tasks. The same AGENTS.md file serves both. See our AGENTS.md and CLAUDE.md examples for how to set that up.

Is Claude Code better than Codex?
For long, multi-file changes we get better results from Claude Code, and its skills and plugin ecosystem is larger. Codex is open source, very fast and included with ChatGPT Plus, so if you already pay for ChatGPT it is excellent value. Both cost about $20 a month to start.
What is the difference between Gemini CLI and Antigravity CLI?
Gemini CLI is Google's open source (Apache-2.0) agent, now only for Gemini Code Assist Standard or Enterprise licences and paid API keys. Antigravity CLI is its replacement for personal users since June 18, 2026: closed source, with a free individual tier under weekly limits and paid Google AI Pro and Ultra plans. Both support skills, hooks, subagents and extensions.
Which AI coding CLI is open source?
Codex CLI and Gemini CLI are Apache-2.0, and opencode is MIT. Claude Code is proprietary. opencode is the only one of the four that works with any model provider, including local models.
Can I use my Claude Pro subscription in opencode?
No. opencode removed Claude Pro and Max login because Anthropic prohibits using those subscriptions in third-party tools. You can use Claude models in opencode with an Anthropic API key or through a gateway such as OpenRouter.
Do these agents share the same config files?
Mostly. Codex, opencode and most other agents read AGENTS.md. Claude Code reads CLAUDE.md and, from version 2.1.277, AGENTS.md when no CLAUDE.md exists. Gemini CLI reads GEMINI.md by default but can be set to read AGENTS.md. All four support SKILL.md skills and MCP servers.
SSumit

Sumit

Contributor

Hi, I'm Sumit, Being an introvert I have always been obsessed with technology-computers and reading dozens of posts to learn, find answers out of my curiosity. I love to write as I explore more.

106 articles writtenView all posts by Sumit →

Related articles

See all