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

Five AI coding agents, as of 3 October 2026: Claude Code, Anthropic's, from $20 a month; OpenAI Codex, with ChatGPT Plus at $20; Cursor, an editor with an agent, free or from $8; OpenCode, open source and free, which runs models from 75+ providers; and Google's Gemini CLI, open source, on a Code Assist licence or a paid API key since its free tier ended on 18 June 2026.

Dmitriy Solodukha · checked against Caprock v0.68.0

to start: OpenCode or Cursor Free
$0
to start: OpenCode or Cursor Free
Gemini CLI's free tier ended 18 June 2026
a month: Claude Pro or ChatGPT Plus
$20
a month: Claude Pro or ChatGPT Plus
Cursor Plus: $8, Grok models only
median OpenCode call, the lowest measured
$0.002
median OpenCode call, the lowest measured
9,309 calls, May – Jun 2026 · mostly DeepSeek V4 Pro
median Claude Code call, the highest measured
$0.094
median Claude Code call, the highest measured
79,014 calls, 18 Jul – 2 Oct 2026 · Codex: $0.032

A call is one request to the model. Medians are from one machine, on different projects, models and weeks — not a verdict on which agent writes better code. Cursor and Gemini CLI were not measured.

Pick one

What each one is best for

Facts about price, limits, where each runs and which models — no overall winner, and no verdict on code.

  • Anthropic

    Claude Code

    Best for Claude models all day on a flat fee.

    Price
    Pro $20, Max $100 or $200 a month; no Claude Code on Claude Free
    Limits
    A five-hour window and a weekly limit, shared with claude.ai
    Runs in
    Terminal, IDE extensions, desktop app, web
    Models
    Claude only, also via Bedrock, Google Cloud, Foundry
    Open source
    All rights reserved, Anthropic
  • OpenAI

    OpenAI Codex

    Best for people who already pay for ChatGPT.

    Price
    Plus $20; Pro $100, $200 or $500; Free and Go in the desktop app, subject to rollout
    Limits
    Five-hour and weekly on Plus; Pro has no five-hour window
    Runs in
    Web, CLI, IDE extension, iOS, desktop app
    Models
    OpenAI's GPT models
    Open source
    The Codex CLI is open source, Apache-2.0

    Codex vs Claude Code →

  • Anysphere

    Cursor

    Best for one editor that runs several makers' models.

    Price
    Free; Plus $8, Premium $30, Super $100, Ultra $200 a month
    Limits
    A weekly pool for Cursor's own models; Claude, GPT and Gemini at API list price on top
    Runs in
    Its own editor, a CLI, cloud agents in VMs
    Models
    Anthropic, OpenAI and Google, plus Grok and Composer in Cursor's own pool
    Open source
    No; Anysphere owns the software

    Cursor vs Claude Code →

  • Anomaly (SST)

    OpenCode

    Best for choosing the model, and its price, per task.

    Price
    Free itself; you pay the model: your own key, Zen per request, or Go at $10 or $40 a month
    Limits
    None of its own; Go caps dollars per model over five hours, a week, a month
    Runs in
    Terminal, desktop app, IDE extension
    Models
    More than 75 providers; a Claude plan sign-in is not allowed
    Open source
    Yes, MIT

    OpenCode vs Claude Code →

  • Google

    Gemini CLI

    Best for teams on Gemini Code Assist.

    Price
    No free tier since 18 June 2026; Code Assist Standard $22.80 or Enterprise $54 a user a month, or a paid API key
    Limits
    1,500 model requests a day on Code Assist Standard, 2,000 on Enterprise
    Runs in
    Terminal; VS Code, JetBrains and Zed through an extension or ACP
    Models
    Gemini only; Auto picks Pro or Flash
    Open source
    Yes, Apache-2.0

    Gemini CLI vs Claude Code →

Read 3 October 2026 from each maker's pricing pages and documentation, and each repository's licence on GitHub.

All five, one table

AI coding agents compared

Maker, licence, where each runs, which models, and what the plans cost and cap.

Five AI coding agents, from each one's pricing pages and documentation, read 3 October 2026
AgentMakerOpen sourceRuns inModelsEntryHeavy planLimit shapeOwn API keyRead by Caprock
Claude CodeAnthropicNoTerminal, IDE, desktop, webClaude onlyPro, $20Max 20×, $2005-hour + weeklyAnthropic keyYes
OpenAI CodexOpenAICLI: Apache-2.0Web, CLI, IDE, iOS, desktopOpenAI GPT modelsPlus, $20Pro, $100–5005-hour + weeklyOpenAI keyYes
CursorAnysphereNoEditor, CLI, cloud VMsAnthropic, OpenAI, Google; Grok, ComposerFree; Plus $8, Grok onlyUltra, $200Weekly pool; Claude, GPT per tokenYesNo
OpenCodeAnomaly (SST)Yes, MITTerminal, desktop, IDE75+ providersFree; Go $10Go Plus, $40Go: a $ cap per modelAny provider'sYes
Gemini CLIGoogleYes, Apache-2.0Terminal, IDE via extensionGemini onlyCode Assist Standard $22.80 a userCode Assist Enterprise, $54 a userRequests a dayPaid Gemini API keySessions it starts
Prices a month, for one person. Codex's 5-hour window applies on Plus; Pro has none, and weekly limits may apply to any plan. Cursor's agent and OpenCode can also run Claude, at API rates rather than on a Claude plan.

Plans, per month

Every plan on one axis

Individual plans, $0 to the top tier. Team and business seats are per user, on each head-to-head page; Gemini CLI now runs only on those or a paid API key.

  • CodexChatGPT Free$0desktop app
  • CursorFree$0limited; no third-party models
  • OpenCodeNo plan$0free, open source
  • CodexChatGPT Go$8desktop app
  • CursorPlus$8own models only, no Claude
  • OpenCodeGo$10mostly open models; capped per model
  • Claude CodePro$20$17 billed annually
  • CodexChatGPT Plus$20web, CLI, IDE, iOS
  • CursorPremium$304× Plus; Claude at API price
  • OpenCodeGo Plus$40the same models, higher caps
  • Claude CodeMax 5×$1005× Pro's usage
  • CodexChatGPT Pro$100Pro 100; no five-hour limit
  • CursorSuper$10015× Plus
  • Claude CodeMax 20×$20020× Pro's usage
  • CodexChatGPT Pro$200Pro 200; more usage than Pro 100
  • CursorUltra$20050× Plus
  • CodexChatGPT Pro$500Pro 500; adds Ultrafast
One linear axis, $0 to $500 a month. Read 3 October 2026 from claude.com/pricing, OpenAI's Codex pricing and OpenCode's Go docs; Cursor's plans read 20 October 2026 from cursor.com/pricing. Claude Free does not include Claude Code; Codex on ChatGPT Free and Go is subject to rollout. OpenCode at $0 still leaves the model to pay for.

Measured · read 3 October 2026

What a call cost on one machine

Caprock reads Claude Code, Codex and OpenCode into one table. A call is one request to the model; each bar carries its sample's dates.

Median cost per call

  • Claude Code18 Jul – 2 Oct 2026$0.094
  • Codexmostly 10–28 Sep 2026$0.032
  • OpenCodeMay – Jun 2026$0.002
  • CursorCaprock does not read Cursornot measured
  • Gemini CLIno Gemini CLI session measured herenot measured
Linear axis. Claude Code and Codex at their provider's list prices; OpenCode at the cost it computes itself, mostly on DeepSeek V4 Pro.
The three samples, from Caprock's export, read 3 October 2026
AgentCallsWhenModelsMedian contextCache hitPriced at
Claude Code79,01418 Jul – 2 Oct 2026mostly Opus 5 and Opus 4.8169K98.8%Anthropic's list prices
Codex16,415mostly 10–28 Sep 2026a third on Luna models128K97.6%OpenAI's list prices
OpenCode9,309May – Jun 202684% DeepSeek V4 Pro, 16% MiniMax M3298K98.7%OpenCode's own cost
Median context is the tokens of conversation a call re-sends; cache hit is the share of input read from the cache.

Run them all in one place

Several agents, one app.

Caprock is a desktop app for macOS, Windows and Linux that runs Claude Code, Codex, OpenCode and Gemini CLI in tabs and split panes per project. It also reads the Claude Code, Codex and OpenCode sessions you start elsewhere. Live activity, cost per call and per repository, plan limits, history and search, in one table. It does not read Cursor. Free, open source, local.

Download for Mac

Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.

Or run it yourself:

curl -fsSL https://caprock.dev/mac.sh | sh

Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app

The full guide

AI coding agents, step by step

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 75 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 resets every five hours, with a weekly limit on top, shared with claude.ai. 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.

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.

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 a Claude Pro or Max sign-in in OpenCode. 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 Zen'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?

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 Caprock does not read it; 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, Cursor, OpenCode and Gemini CLI 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. It does not read Cursor. How it compares with other apps for running agents is in desktop apps for coding agents.

Free, open source; nothing leaves your machine. Install Caprock and it reads back every session those agents still have on disk.

Questions people ask

What is an AI coding agent?
A program that reads your code, runs commands and edits files on its own to finish a task you describe, calling a language model at each step. Claude Code, Codex, Cursor's agent, OpenCode and Gemini CLI all work this way.
What is the best free AI coding agent?
OpenCode is free and open source but you pay for the model, and Cursor's Free plan has limited use of its own models. Gemini CLI's free tier ended on 18 June 2026; Google's free agent is now Antigravity, with a weekly quota.
What are the best Claude Code alternatives?
Codex with ChatGPT Plus at $20, Cursor from $8 (Premium at $30 for Claude and GPT), OpenCode, free with any of 75+ providers, and Gemini CLI on a Code Assist licence or a paid API key. Cursor's agent and OpenCode can also run Claude, at API rates.
Is there a free alternative to Claude Code?
Yes: Google Antigravity on a weekly quota, OpenCode with a model you pay for or a free Zen model, Codex on ChatGPT Free in the desktop app, subject to rollout, and Cursor's Free plan with limited use of its own models.
Which AI coding agent is cheapest?
To start, OpenCode costs nothing; Claude Code's paid entry plan is $20 a month; Codex comes with ChatGPT Go at $8 in the desktop app, subject to rollout, or Plus at $20; Cursor's is $8 for Grok models only. Per call on one machine, OpenCode cost $0.002 at the median, Codex $0.032 and Claude Code $0.094.
Are there open-source AI coding agents?
Yes: OpenCode under MIT, Gemini CLI under Apache-2.0, and the Codex CLI under Apache-2.0. Claude Code and Cursor are not open source.
Can I use several AI coding agents at once?
Yes; each keeps its own sign-in and limits, and Claude Code also runs inside Cursor on a Claude plan. Caprock, a free desktop app, records Claude Code, Codex and OpenCode sessions whether or not it started them, and the Gemini CLI sessions it starts, in one table with each one's cost and limit; it does not read Cursor.

Sources

Try it

The record of every coding agent you run, the sessions it did not start included. Free, open source; nothing leaves your machine.

Download for Mac

Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.

Or run it yourself:

curl -fsSL https://caprock.dev/mac.sh | sh

Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app