Claude Code alternatives: free, open-source and paid agents, tested on the same tasks
Published · Updated
Summary
Codex CLI is the closest paid alternative to Claude Code, OpenCode is the closest open-source one, and Antigravity CLI is Google's. We ran Claude Code and eight alternatives, eleven setups in all, on the same four coding tasks, three times each. Nine setups passed every run, including Kilo's free tier. They differed most in cost, from nothing to $0.19 a task, and in time, from 22 seconds to two and a half minutes per task. If Claude's limits are why you're looking, you can also keep Claude Code and point it at a cheaper model, or run it on Replicas, which can continue the same chat in Codex when your Claude plan runs out.
Checked November 15, 2026
Claude Code alternatives compared
Claude Code runs only Claude models and needs a paid Claude plan or an Anthropic API key. The alternatives differ in who makes them, whether their code is open, what it costs to start and which models they run. Each row links to the vendor pages its facts come from.
| Agent | Made by | License | Cheapest way to start | Models | Signs in with a Claude plan? | Source |
|---|---|---|---|---|---|---|
| For comparison | ||||||
| Claude Code | Anthropic | Proprietary | Claude Pro, $20/month or $17/month billed yearly; or an Anthropic API key | Claude only | Yes | Claude pricing, Legal and compliance |
| Model makers | ||||||
| Codex CLI | OpenAI | Apache-2.0 | ChatGPT Plus, $20/month; or an OpenAI API key | OpenAI models, plus Ollama, LM Studio or a provider you configure | No | Codex pricing, GitHub |
| Antigravity CLI | Proprietary | Free tier with weekly limits; Google AI Pro $19.99/month | Gemini models, plus Claude and GPT-OSS on some plans | No | Antigravity pricing, CLI docs | |
| Muse Code | Meta | Not open source | Pay per token with a Meta API key; plans from $5/month | Meta's Muse models | No | Muse pricing, Plans |
| Grok Build | xAI | Apache-2.0 | Free to try; X Subscription Plus $8/month; or an xAI API key | Grok models, or any model you configure | No | X Subscription, GitHub |
| Open source, any model | ||||||
| OpenCode | Anomaly | MIT | Free models with no account; your own key; OpenCode Go from $10/month | 200+ providers and local models, plus ChatGPT and Copilot logins | No. Removed in version 1.3.0 after legal requests from Anthropic | OpenCode, Claude login removal |
| Kilo CLI | Kilo Code | MIT | Kilo Auto Free with no account; your own key; Kilo Pass from $19/month | 500+ models through Kilo Gateway, your own keys, local models | No. Claude models need an Anthropic API key | Kilo pricing, Claude plans |
| Cline | Cline Bot | Apache-2.0 | Free with your own key; ClinePass $9.99/month | 30+ providers and local models | Yes, by running your installed Claude Code | Cline pricing, Claude Code provider |
| Aider | Aider-AI | Apache-2.0 | Free with your own key | Most providers and local models | No | Aider, Releases |
| Editors and platforms | ||||||
| GitHub Copilot CLI | GitHub | Proprietary | Copilot Free, with limited agent use; Pro $10/month | Claude, GPT, Gemini and Grok models, or your own provider | No | Copilot plans, CLI docs |
| Cursor CLI | Cursor | Proprietary | Free plan with limited agent requests; Plus $8/month, Grok models only | Cursor's Composer, Grok, Claude, GPT, Gemini and others | No | Cursor pricing, Models |
| Replicas | Replicas | Proprietary | $100 of free usage, then $50/month | Runs Claude Code, Codex, Cursor, Gemini, Muse Code, OpenCode, and Pi | Yes. Runs the unmodified Claude Code with your own login or key | Pricing, Claude Code docs |
Codex CLI
Codex CLI is OpenAI's open-source terminal agent and the closest swap for Claude Code: it reads the repository, edits files and runs commands the same way. ChatGPT Plus and higher plans include the CLI, and with an API key you pay per token. Its default model is GPT-6.1 Sol.
In our test it passed all 12 runs and was the fastest agent, at 22 seconds per task. On an API key it averaged $0.070 a task, under half what Claude Code cost with Opus 5.5.
OpenCode
OpenCode is an open-source terminal agent that works much like Claude Code. It works with more than 200 model providers and local models, and its free models need no account. OpenCode 2 installs from opencode.ai/v2/install or the @opencode/cli npm package; the older opencode-ai package still installs version 1.
With GLM-5.3 it passed all 12 runs at $0.070 a task. With its free GLM-5.3 Flash model it passed 10. The other two stopped at "Free usage limit reached" after nine tasks in about an hour, and the next run, a minute later, went through. OpenCode doesn't publish the limit.
Antigravity CLI
Antigravity CLI (agy) replaced Gemini CLI for free, Google AI Pro and Ultra users on June 18, 2026. Its free tier has weekly limits that Google doesn't put a number on, and it also accepts a Gemini API key. Gemini CLI is still open source and still works with a paid Gemini API key.
We didn't run it: it needs a Google sign-in or a Gemini API key, and our test workspace had neither.
GitHub Copilot CLI
Copilot CLI comes with every Copilot plan, including Free, which has 2,000 completions a month and limited chat and agent use. Usage is billed in GitHub AI credits at $0.01 each, and you can point it at your own OpenAI-compatible, Azure or Anthropic endpoint.
We didn't run it, because it needs a GitHub account with a Copilot plan.
Cursor CLI
Cursor's terminal agent (the agent command) uses your Cursor account and can hand a conversation to a Cursor cloud agent. Cursor's plans changed recently: Plus at $8 a month includes only Grok models, Premium at $30 adds cloud agents, and other companies' models are billed separately at API list price.
It passed all 12 runs but was the slowest agent we tested: 148 seconds per task, and more than nine minutes on the hardest task. It bills its Auto model to your Cursor plan without a published per-token rate, so we have no cost for it.
Kilo CLI
Kilo CLI is a fork of OpenCode. Its free option, Kilo Auto Free, picks a free model for each request and needs no account, up to 200 requests an hour per IP address. Kilo warns that those providers may log prompts and use them to improve their models.
Kilo Auto Free passed all 12 runs at no cost, at 53 seconds per task. It sent our runs to at least five different free models, including NVIDIA Nemotron and Baidu ERNIE models.
Cline
Cline is an open-source agent for VS Code, JetBrains and the terminal. Its Claude Code provider drives the Claude Code you already have installed, so it can use your Claude plan's limits instead of API billing.
With GLM-5.3 it passed all 12 runs at $0.067 a task and 37 seconds per task.
Aider
Aider is a terminal pair programmer that commits each change to git. It still works, but its last release, 0.86.2, came out in February 2026, and its built-in list of models doesn't know newer ones.
With the same GLM-5.3 model that passed every run in OpenCode, Cline and Claude Code, Aider passed 7 of 12. On the hardest task it stopped all three times with a token-limit error before writing any code, and giving it GLM-5.3's limits in a model settings file didn't change that. It also skipped the test we asked for in two of its three bug-fix runs.
Muse Code
Meta's terminal agent left beta on August 31. Our API key defaulted to Contributor mode, which costs $0.10 per million input tokens and $0.20 per million output tokens, against $1.25 and $4.25 for standard Muse Spark, in exchange for letting Meta train future models on your content. Muse Code plans also start in Contributor mode, and you can turn it off.
It passed all 12 runs for $0.011 a task on average. It also used the most tokens of any agent, about 760,000 per task, so at standard Muse Spark rates the same runs would have cost $0.232 a task, more than any other setup we ran.
Grok Build
xAI open-sourced Grok Build in July. It runs as a terminal app, headless in scripts, or inside editors. xAI says it's powered by Grok 4.7, so we chose that model; with an API key, the CLI otherwise starts on grok-4.20-0309-non-reasoning.
It passed all 12 runs, but it was the most expensive setup we ran, at $0.189 a task, and the second slowest, at 97 seconds per task.
Replicas: keep Claude Code and run other agents next to it
Replicas isn't a replacement for Claude Code. It runs Claude Code itself, signed in with your own Claude plan or API key, along with Codex, Cursor, Gemini, Muse Code, OpenCode, and Pi, each task in its own Linux VM, and returns a pull request. Tasks start from Slack, Linear, GitHub, GitLab, a schedule or the API.
When a Claude plan hits its limit, the chat can move to another Claude login you connected, then continue in Codex with the conversation carried over. With Devices, agents can also work on a Mac or PC you own over SSH.
Tested November 15, 2026
What happened when we gave them the same four tasks
Nine of the eleven setups passed all 12 runs, including Kilo's free tier. On a small, clearly specified project, which agent we used mattered much less than what it cost and how long it took.
Codex CLI, and GLM-5.3 in Claude Code, OpenCode or Cline, each cost about $0.07 a task, under half of Claude Code with Opus 5.5 at $0.17. Grok Build on Grok 4.7 cost the most, at $0.19. Codex was the fastest at 22 seconds per task, and Cursor the slowest at 148.
The same model didn't guarantee the same result: GLM-5.3 passed all 12 runs in Claude Code, OpenCode and Cline, but 7 in Aider. These were small tasks in a 230-line project, so read this as a check of cost, speed and reliability on everyday work, not a ranking of how capable each model is on a large codebase.
Grok Build, Grok 4.7
$0.189
Claude Code, Claude Opus 5.5 (for comparison)
$0.166
Claude Code, GLM-5.3 through a gateway
$0.070
Codex CLI, GPT-6.1 Sol
$0.070
OpenCode, GLM-5.3
$0.070
Cline, GLM-5.3
$0.067
Aider, GLM-5.3
$0.039
Muse Code, Muse Spark 1.3 (Contributor mode)
$0.011
OpenCode, GLM-5.3 Flash Free
Free
Kilo CLI, Kilo Auto Free
Free
| Agent and model | Runs passed | Hardest task (4) | Median time per task | Average cost per task |
|---|---|---|---|---|
| Claude Code, Claude Opus 5.5 (for comparison) | 12 of 12 | 3 of 3 | 27 s | $0.166 |
| Claude Code, GLM-5.3 through a gateway | 12 of 12 | 3 of 3 | 39 s | $0.070 |
| Codex CLI, GPT-6.1 Sol | 12 of 12 | 3 of 3 | 22 s | $0.070 |
| OpenCode, GLM-5.3 | 12 of 12 | 3 of 3 | 44 s | $0.070 |
| Cline, GLM-5.3 | 12 of 12 | 3 of 3 | 37 s | $0.067 |
| Aider, GLM-5.3 | 7 of 12 | 0 of 3 | 50 s | $0.039 |
| Muse Code, Muse Spark 1.3 (Contributor mode) | 12 of 12 | 3 of 3 | 62 s | $0.011 |
| Grok Build, Grok 4.7 | 12 of 12 | 3 of 3 | 97 s | $0.189 |
| Cursor CLI, Auto | 12 of 12 | 3 of 3 | 148 s | Not reported |
| OpenCode, GLM-5.3 Flash Free | 10 of 12 | 3 of 3 | 22 s | Free |
| Kilo CLI, Kilo Auto Free | 12 of 12 | 3 of 3 | 53 s | Free |
Method
How we tested
We wrote a small TypeScript project for this test, so no model could have seen it: a pricing engine for an online shop, about 230 lines with 18 tests and no dependencies. Then we wrote four tasks for it.
- Task 1: a customer bug report
- "I ordered two T-shirts, $50.00 in total, and was charged $7.49 for shipping." The cause is one character in the shipping code. The agent also had to add a test.
- Task 2: a small feature
- Buy-X-get-Y discount codes such as BUY2GET1-MUG, across several files, with tests and a README update.
- Task 3: a misleading failing test
- The error says a state isn't supported for shipping. The real cause is in how addresses are cleaned up, and the agent wasn't allowed to change the tests.
- Task 4: a precise spec
- Exempt clothing from sales tax in two states, split the order discount across lines in whole cents that add up exactly, and break ties a set way.
- Each agent got the same prompt in a fresh copy of the project, with permission to edit files and run commands without asking. Each task ran three times, with a 20-minute limit.
- A run passed only if the project's own tests and our hidden tests, which the agents never saw, all passed. We also checked that agents added tests when asked and left the tests alone in task 3.
- Time is from starting the agent to it exiting. Cost comes from the agent's own report, from its tokens at the vendor's list price, or, for Aider and for Claude Code on GLM-5.3, from the AI gateway's bill. Cursor doesn't publish what its Auto model costs per token, so Cursor has no cost.
- Every agent was its latest release on November 15, 2026, and ran with its default model where it has one. All runs used one Replicas Linux workspace with 2 vCPUs and 8 GB of memory, with up to three agents running at once.
Free Claude Code alternatives
Two of the free options passed our tasks. The catch is privacy: free models are often paid for with your prompts, so read each one's terms before using it on private code. Our OpenCode alternatives guide lists more free models and cheap plans.
| Option | What's free | Published limit | In our test | Source |
|---|---|---|---|---|
| Tested | ||||
| Kilo Auto Free | Kilo CLI picks a free model for each request, with no account. Kilo says providers may log prompts and use them to improve their models. | 200 requests an hour per IP address | Passed 12 of 12 | Kilo free models |
| OpenCode free models | 14 models free for a limited time, with no account. Some may use your data to improve the model. | Not published | GLM-5.3 Flash Free passed 10 of 12; two runs hit "Free usage limit reached" | OpenCode Zen |
| Not tested | ||||
| Antigravity Free | Antigravity and its CLI with Gemini models, with a Google account | Weekly limits; no numbers published | Not run | Antigravity pricing |
| Copilot Free | Copilot CLI and agent mode, with a GitHub account | 2,000 completions a month; chat and agent use limited | Not run | Copilot plans |
Why people look
What changed in Claude's plans this year
Most people searching for a Claude Code alternative want to keep coding when a Claude limit runs out, or want to pay less. These are the changes that affect that, each from Anthropic's own pages. Our Claude Code pricing guide covers every plan and how the limits work.
| Change | Details | Source |
|---|---|---|
| Limits and plans | ||
| Weekly limits, Aug 29, 2026 | Anthropic set Claude Code's weekly limits 25% above the old standard from September 14, ending a 50% summer increase. It said this "works out to a 17% reduction in weekly limits" compared with the summer. | @ClaudeDevs |
| API credits, Oct 7, 2026 | Max and Team plans gained monthly API credits for building your own apps. Anthropic says the Max credits can't be used in Claude Code. | Release notes, Plan limits |
| Ultra plan, Oct 30, 2026 | Max 20x became Ultra at the same $200 a month, and verified Ultra accounts lost the five-hour limit. Max is now one $100 plan. Weekly limits didn't change. | @claudeai, Ultra plan |
| Still true today | ||
| Free plan | The Free plan doesn't include Claude Code. Pro costs $20 a month, or $17 billed yearly. | Claude pricing |
| Usage limits | Pro and Max have a five-hour limit and a weekly limit, and verified Ultra accounts have only the weekly one. The limits are shared between Claude chat and Claude Code. | Plan limits |
| Fable models | On Pro, Fable models are paid with usage credits. Max and Ultra can spend up to half the weekly limit on Fable. | Fable on your plan |
| Other agents | Other companies' apps may not route requests through a Claude plan login, so using Claude models in another agent means paying API rates. | Legal and compliance |
Before you switch
What to do when Claude Code hits its limit
Switching agents isn't the only option. These are the ways to keep working when a Claude plan runs out, from Anthropic's documentation and ours.
| Option | What happens | What it costs | Source |
|---|---|---|---|
| From Anthropic | |||
| Wait for the reset | Claude Code stops until the five-hour or weekly window resets | Nothing | Plan limits |
| Turn on usage credits | Claude Code keeps going past the limit, billed at API rates, up to a monthly cap you set | API rates | Usage credits |
| Upgrade | Max has 5× Pro's usage, Ultra 10× Pro's weekly usage | $100 or $200 a month | Claude pricing |
| Other ways to keep Claude Code | |||
| Point Claude Code at another model | Claude Code sends its requests to an Anthropic-compatible endpoint, such as a gateway, Ollama or Meta's API, instead of Anthropic | That provider's rates | Ollama, Meta |
| Fall back on Replicas | The chat moves to another Claude login you connected, then can continue in Codex with the conversation carried over | Your plans, plus Replicas workspace time | Fallback chains |
Decision guide
How to pick a Claude Code alternative
Start from why you're looking.
- The closest swap
- Codex CLI. It passed every run, was the fastest, and cost $0.07 a task on an API key.
- Open source with any model
- OpenCode or Cline. With GLM-5.3, both passed every run for about $0.07 a task. Kilo CLI is an OpenCode fork with a free tier.
- Free
- Kilo Auto Free passed all 12 runs, and OpenCode's free GLM-5.3 Flash passed 10. Both may let providers use your prompts, so keep private code out.
- The lowest paid bill
- Muse Code in Contributor mode cost about a cent a task, if you're fine with Meta training on your content.
- Google's agent
- Antigravity CLI, which replaced Gemini CLI for free and Google AI plan users. We couldn't test it.
- Inside your editor
- Cursor, Copilot or Cline, which all have editor extensions as well as a terminal agent. Cursor's terminal agent was the slowest in our test.
- Keep Claude Code
- Point it at a cheaper model: on GLM-5.3 it passed every run for $0.07 a task. Or run it on Replicas, which can continue the chat in Codex when your plan runs out.
FAQ