# AI coding agents in 2026: Claude Code, Codex, Cursor, OpenCode and Gemini CLI compared

*AI coding agents compared: Claude Code, Codex, Cursor, OpenCode and Gemini CLI on price, limits, models and licence, with cost per call measured.*

Dmitriy Solodukha, checked 2026-11-12 · https://caprock.dev/guides/ai-coding-agents/

An AI coding agent is a program that takes a task in plain language, then
reads your code, runs commands and edits files until the task is done,
calling a language model at every step. This page compares five: Claude
Code, OpenAI Codex, Cursor, OpenCode and Gemini CLI. They differ less
in what they do than in who makes them, which models they run, how you pay,
and how the plan stops you.

## What an AI coding agent is

A chat assistant answers; an agent acts. You ask for a change, and the agent
reads the files it needs, runs the tests, edits, runs them again, and reports
back. Each of those steps is a call to a model, and each call re-sends the
conversation so far. That is why agentic coding tools cost more than a chat:
on one machine, the median Claude Code call re-sent 169K tokens of context,
almost all of it read from the cache.

All five run in a terminal or an editor, on your own files. Claude Code and
Codex also run on the web and in desktop apps; Cursor is an editor of its
own, with an agent built in.

## How the five differ

**Who makes them.** Anthropic makes Claude Code, OpenAI makes Codex,
Anysphere makes Cursor, Google makes Gemini CLI, and Anomaly, the team behind
SST, makes OpenCode.

**Which models they run.** Claude Code runs only Claude, Codex only OpenAI's
GPT models, and Gemini CLI only Gemini. Cursor's agent runs models from
Anthropic, OpenAI and Google, plus its own pool: Grok and Composer. OpenCode connects
to more than 200 providers, so the model, and its price, is yours to pick.

**How you pay.** Claude Code and Codex come with a plan from their maker,
paid plans from $20 a month (Codex also comes with ChatGPT Go at $8, in the
desktop app), or bill an API key per token. Cursor sells its own plans,
from $8 a month, with a weekly pool for its own models; Claude, GPT and
Gemini bill at API list price on top, from Premium at $30. OpenCode costs
nothing itself; you pay the provider of the model. Gemini CLI runs on a
Gemini Code Assist licence or a paid API key; its free tier ended on 18 June
2026.

**How the plan stops you.** A Claude plan has a five-hour window and a
weekly limit, shared with claude.ai; Ultra drops the five-hour window for
verified accounts. Codex on ChatGPT Plus has a
five-hour window and a weekly limit; ChatGPT Pro has no five-hour limit, and
weekly limits may apply to any plan.
Cursor counts a weekly pool. Gemini CLI counts model requests a day — and
one prompt can make several. OpenCode Go caps dollars per model.

## Free AI coding agents

Two of the five start at $0. OpenCode is free and open source, but the
model is not: on a cheap open model the median call on my machine cost
$0.002. Cursor's Free plan includes limited use of its own models. ChatGPT Free
and Go include Codex in the desktop app, subject to rollout. Claude Free does
not include Claude Code. Gemini CLI's free tier ended on 18 June 2026; Google
moved free users to Antigravity CLI, with a weekly quota:
[Antigravity vs Claude Code](https://caprock.dev/guides/antigravity-vs-claude-code/).

## Open-source coding agents

OpenCode is MIT-licensed, Gemini CLI Apache-2.0, and the Codex CLI
Apache-2.0. Claude Code's licence reserves all rights to Anthropic, and
Cursor's terms keep the software Anysphere's. Open source here means you can
read and change the agent; the model it calls is still billed by whoever
serves it. Every open-source agent, the editor extensions and the ones that
stopped included, is in [open-source AI coding
agents](https://caprock.dev/guides/open-source-ai-coding-agents/).

## Claude Code alternatives, free and paid

If you are leaving Claude Code over price or limits, the alternatives split
in two. Codex and Gemini CLI swap the model as well as the agent: GPT or
Gemini instead of Claude. Cursor's agent and OpenCode can keep Claude, but
bill it at API rates rather than on a Claude plan; Anthropic does not allow
third-party apps such as OpenCode to use a Claude Pro, Max or Ultra sign-in. If it is Claude you want, most of the
day, a Claude plan is the flat-fee way to get it — and Claude Code runs
inside Cursor as an extension, covered by that plan.

The free ones are Antigravity, Google's agent, on a weekly quota; OpenCode,
with a model you pay for or one of OpenCode's free models; Codex on ChatGPT Free,
in the desktop app; and Cursor's Free plan. What $0 gets on each, and the
cheapest way into Claude Code itself:
[Is Claude Code free?](https://caprock.dev/guides/is-claude-code-free/)

## What they cost, measured

Plans say what you may use, not what the work costs. Caprock reads Claude
Code, Codex and OpenCode on my machine and prices every call: at list prices
for the first two, at OpenCode's own figure for the third. The medians are
in the chart above. Most of the gap is the model — most Claude Code calls ran
Opus 5 or Opus 4.8, a third of Codex's ran its cheaper Luna models, and most
OpenCode calls ran DeepSeek V4 Pro — and the rest is how much context each
call carried.

None of this ranks the agents. The three ran on different projects, in
different weeks, on models priced very differently. Cursor is not
measured, because these figures predate Caprock reading it (v0.177.0, 16
November 2026); Gemini CLI is not measured,
because Caprock has measured no Gemini CLI session on this machine. The head-to-head pages go
further on each pair: [Codex](https://caprock.dev/guides/codex-vs-claude-code/),
[Cursor](https://caprock.dev/guides/cursor-vs-claude-code/),
[OpenCode](https://caprock.dev/guides/opencode-vs-claude-code/) and
[Gemini CLI](https://caprock.dev/guides/gemini-cli-vs-claude-code/) against Claude Code.

## Using several at once

You can: Claude Code or Codex on a plan for long work, OpenCode on a cheap model for chores. Each keeps its
own sign-in, its own limits and its own record. Each also sees only itself:
`/usage` in Claude Code, `/status` in Codex.

Caprock puts them in one record. It is a free desktop app for macOS, Windows
and Linux that reads Claude Code's and Codex's transcripts and OpenCode's
database from disk, with nothing to configure, so the sessions you start in
your own terminal are there too, and the telemetry of the Gemini CLI sessions
it starts. Who is waiting on you, who is stuck, how close each subscription
is to its limit, and what each session and repository cost at list price, in
one table; the tabs and split panes it runs them in are how you live with
that record. Since v0.177.0 it also reads Cursor's Agent and Composer chats,
read-only, with the cost Cursor recorded per chat and model, and starts
`cursor-agent`; Cursor's background agents and team usage stay on Cursor's
servers and are not read. How it compares with other apps for
running agents is in
[desktop apps for coding agents](https://caprock.dev/guides/coding-agent-desktop-apps/).

Free, open source; nothing leaves your machine. [Install Caprock](https://caprock.dev/install/)
and it reads back every session those agents still have on disk.

## Sources

- [Claude plans and prices: Ultra has no five-hour limit for verified accounts, read 12 November 2026](https://claude.com/pricing)
- [Claude Code licence: all rights reserved, read 12 November 2026](https://github.com/anthropics/claude-code/blob/main/LICENSE.md)
- [Codex pricing and usage limits, read 12 November 2026](https://learn.chatgpt.com/docs/pricing)
- [Codex CLI on GitHub — Apache-2.0, read 12 November 2026](https://github.com/openai/codex)
- [Cursor pricing, read 12 November 2026](https://cursor.com/pricing)
- [Cursor docs — models and pricing, read 12 November 2026](https://cursor.com/docs/models-and-pricing)
- [Cursor terms of service — Anysphere, read 12 November 2026](https://cursor.com/terms-of-service)
- [OpenCode — home page: 200+ providers; desktop, terminal, phone and SDK, read 12 November 2026](https://opencode.ai/)
- [OpenCode docs — providers, read 12 November 2026](https://opencode.ai/docs/providers)
- [OpenCode Go — plans and caps, read 12 November 2026](https://opencode.ai/docs/console/go/)
- [OpenCode pay-as-you-go models (where the Zen docs now redirect) — free models, read 12 November 2026](https://opencode.ai/docs/console/models/)
- [OpenCode on GitHub — MIT, read 12 November 2026](https://github.com/anomalyco/opencode)
- [Claude Code docs — legal and compliance: no Free, Pro, Max or Ultra credentials in third-party apps, read 12 November 2026](https://code.claude.com/docs/en/legal-and-compliance)
- [Gemini CLI docs — quotas and pricing, read 12 November 2026](https://geminicli.com/docs/resources/quota-and-pricing/)
- [Gemini CLI on GitHub — Apache-2.0, read 12 November 2026](https://github.com/google-gemini/gemini-cli)
- [Gemini Code Assist Standard and Enterprise pricing (hourly licence rates), read 12 November 2026](https://cloud.google.com/products/gemini/pricing)
- [Gemini Code Assist quotas: one prompt might result in multiple model requests, read 12 November 2026](https://developers.google.com/gemini-code-assist/resources/quotas)
- [Google Developers Blog — Transitioning Gemini CLI to Antigravity CLI, 19 May 2026](https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/)
- [Google Antigravity pricing — individual plan, read 12 November 2026](https://antigravity.google/pricing)
- [How Caprock joins five agents in one table](https://caprock.dev/blog/five-agents-one-table/)
