Key Takeaways
- The 12 tools — verified 12 August 2026
- 1. OpenCode — MIT · 196.2k stars · free + your own API key
- Most-starred coding agent on GitHub, more than Codex CLI and OpenHands combined. Terminal-first, connects to any provider. Repo moved to anomalyco/opencode. No verified benchmark submitted.
- 2. Codex CLI — Apache-2.0 · 105.3k stars · included with ChatGPT Plus ($20/mo)
- Second on Terminal-Bench 2.1 at 83.1%, statistically tied with Claude Code. Shares a 5-hour usage window across CLI, web and IDE. Best value if you already pay OpenAI.
- 3. OpenHands — MIT · 83.7k stars · free self-host, paid cloud
- Browses, runs tests, retries. Ships a browser UI, Python SDK, managed cloud and Kubernetes deployment. Heaviest option here; the one to pick if you must self-host.
- 4. Cline — Apache-2.0 · 66.0k stars · free + your own API key
- Now an SDK, IDE extension and CLI assistant. Bring your own key including local models. The pick if you won't leave VS Code.
- 5. Goose — Apache-2.0 · 52.7k stars · free + your own API key
- From Block. Built around extensions and MCP — strongest choice if you want the agent wired into systems beyond your codebase.
- 6. Aider — Apache-2.0 · 48.1k stars · free + your own API key
- Oldest and most focused. Tight git integration, commits as it goes. Works with Claude, GPT, DeepSeek and Ollama. Deliberately does less than the others.
- 7. Crush — open source · 27.3k stars · free + your own API key
- Charm's agent. Best-looking terminal interface in this list.
- 8. Kilo Code — MIT · 26.8k stars · free + your own API key
- Bundles the Roo/Cline lineage into an all-in-one platform. VS Code and JetBrains support.
- 9. Cursor — proprietary · $20/mo Pro
- A full IDE, not a terminal agent. Pro+ $60, Ultra $200.
- 10. Windsurf — proprietary · $20/mo Pro
- Retired its credit system in March 2026 for daily and weekly quotas. Pro was $15 before that. Max $200/mo.
- 11. Cursor CLI — proprietary · Cursor subscription
- Most cost-efficient score on the board: 79.3% for $134 running Grok 4.5. Carries a −9.0% hacks penalty, far higher than anything else — read the score with that in mind.
- 12. Gemini CLI — Apache-2.0, retired · 106k stars, archived
- Google shut it off for free, Pro and Ultra users on 18 June 2026, announced 19 May, no grace period. Replaced by the closed-source Antigravity CLI. Enterprise Code Assist licences kept access. Last verified score 65.8%.
Most articles about Claude Code alternatives are lists of tool names with marketing copy attached. This one starts with the benchmark data, because the data changes the recommendation.

The short version. Each recommendation is explained in full below.
First, the uncomfortable part: Claude Code is winning
Terminal-Bench is the standard benchmark for agents that work in a terminal. Here is the live 2.1 leaderboard, captured today:

Terminal-Bench 2.1 leaderboard, 12 August 2026. Claude Code holds first place; Codex is second.
Claude Code running Fable 5 leads at 83.8% (±1.2). Codex with GPT-5.5 is second at 83.1% (±1.1). Those two overlap inside their error bars, so treat them as tied rather than ranked.
A warning about what you will read elsewhere. While researching this article I found widely-shared posts claiming Codex CLI leads at 83.4% with Claude Code at 78.9%, and others claiming both score around 89%. Neither matches the actual leaderboard. Benchmark numbers in this niche get copied between blogs until they drift from the source. The leaderboard is public — check it yourself rather than trusting any secondary source, including this one.
The open-source agents are not on this leaderboard at all. OpenCode, Aider, Cline, Goose and Kilo Code have not submitted verified runs. That is not evidence they are bad. It is evidence that nobody has measured them under controlled conditions, and you should be suspicious of any article that ranks them by capability as if someone had.
The real reason to switch is cost, and the spread is enormous
The leaderboard publishes what each run cost. Almost nobody reports this, and it is the most decision-relevant column on the page.

Accuracy against cost for all 17 verified Terminal-Bench 2.1 runs. Built from the leaderboard’s own figures.
Cursor CLI running Grok 4.5 scored 79.3% for $134. Codex running GPT-5.5 scored 83.1% for $2,059. That is 3.8 percentage points for roughly fifteen times the money. Claude Code with Fable 5 sits in between: the top score, at $553.
If your work is routine — features, tests, known bugs — the cheap end of that chart is where you should be. The expensive configurations only earn their keep on genuinely hard problems.
One caveat on the cheapest option. Cursor CLI’s run carries a −9.0% hacks penalty, far higher than anything else on the board. That flag means the agent found shortcuts the benchmark authors consider illegitimate. Read its score with that in mind.
And a finding that reframes the whole question: the same harness with a different model swings 25 points. Claude Code scores 83.8% on Fable 5 and 58.7% on GLM-5.1. Before you replace your tool, check whether you are actually unhappy with the model underneath it.
Why people actually leave Claude Code
From support threads, community discussion and the structure of the plans themselves, five reasons come up repeatedly:
- Hitting the limit mid-task. Claude Code shares one quota pool across Claude.ai, Claude Code, Claude Desktop and Cowork, with a rolling session window and a weekly cap on top.
- Cost at scale. A subscription is predictable until it isn’t. Teams running many parallel agents hit ceilings that make per-token billing look cheaper.
- No model choice. Claude Code runs Anthropic models. If you want to run Qwen, DeepSeek or a local model, you need a different harness.
- It is not open source. For some organisations that is a procurement blocker regardless of quality.
- Data residency and self-hosting. Regulated environments often cannot send code to a third-party API at all.
If reason one is yours, check what is actually consuming your quota before switching tools — including the background setting that spends it silently. We covered every method in our guide to seeing your Claude Code usage.
The comparison table
| Tool | Licence | GitHub stars | Cost | Best for |
|---|---|---|---|---|
| OpenCode | MIT | 196.2k | Free + your own API key | The default open-source replacement |
| Codex CLI | Apache-2.0 | 105.3k | Included with ChatGPT Plus ($20/mo) | Already paying OpenAI |
| OpenHands | MIT | 83.7k | Free self-host, paid cloud | Long autonomous runs, self-hosting |
| Cline | Apache-2.0 | 66.0k | Free + your own API key | Staying inside VS Code |
| Goose | Apache-2.0 | 52.7k | Free + your own API key | Extensibility and MCP work |
| Aider | Apache-2.0 | 48.1k | Free + your own API key | Git-native, minimal, scriptable |
| Crush | Open source | 27.3k | Free + your own API key | People who want a nice TUI |
| Kilo Code | MIT | 26.8k | Free + your own API key | Roo/Cline-style, all-in-one |
| Cursor | Proprietary | — | $20/mo Pro | Full IDE, not just a terminal |
| Windsurf | Proprietary | — | $20/mo Pro | IDE with quota-based plans |
| Cursor CLI | Proprietary | — | Cursor subscription | Cheapest strong benchmark score |
| Gemini CLI | Apache-2.0 (retired) | 106k (archived) | n/a | Nothing — see the warning below |
Star counts read directly from GitHub on 12 August 2026. Prices are list prices for individual plans.

Adoption is not capability, but it is the best signal available for tools that have never been benchmarked.
Open source alternatives to Claude Code
1. OpenCode — the default choice

OpenCode on GitHub: 196.2k stars, MIT licence. Note the repository now lives under anomalyco, not sst.
At 196.2k stars OpenCode is the most-starred coding agent on GitHub — more than Claude Code’s own repository. MIT licensed, terminal-first, and provider-agnostic: it connects to a large catalogue of model providers rather than one vendor’s API.
A detail most articles get wrong: the repository has moved to github.com/anomalyco/opencode. Older guides still point at sst/opencode, which now redirects. If you are following an install guide that references the old path, it is out of date.
Use it if: you want the closest thing to a drop-in replacement with no vendor lock-in. Skip it if: you need a verified benchmark score, because it has never submitted one.
2. OpenHands — for long autonomous runs
83.7k stars, MIT. OpenHands goes further than editing files: it browses, runs tests, and retries. It ships a browser UI, a Python SDK, a managed cloud option and Kubernetes deployment for enterprises.
Use it if: you want an agent that works unattended for long stretches, or you need to self-host inside your own infrastructure. Skip it if: you want a lightweight terminal tool — this is a heavier system.
3. Cline — if you live in VS Code
66.0k stars, Apache-2.0. Cline started as a VS Code extension and now describes itself as an SDK, IDE extension and CLI assistant. Bring your own key, including local models.
Use it if: you would rather not leave your editor. Skip it if: you want a terminal-native workflow — that is not what it is best at.
4. Goose — for extensibility
52.7k stars, Apache-2.0, from Block. Goose is built around extensions and MCP, so it is the strongest pick if you want the agent wired into systems beyond your codebase.
5. Aider — the minimal, git-native option
48.1k stars, Apache-2.0. Aider is the oldest tool here and the most focused: AI pair programming in your terminal, with tight git integration that commits as it goes. Works with Claude, GPT, DeepSeek and local models through Ollama.
Use it if: you want something small, predictable and scriptable. Skip it if: you want a full agent that runs tests and browses — Aider deliberately does less.
6 and 7. Crush and Kilo Code
Crush (27.3k stars) is Charm’s agent, and it shows — the terminal interface is the nicest-looking in this list. Kilo Code (26.8k stars, MIT) bundles the Roo/Cline lineage into an all-in-one platform with VS Code and JetBrains support.
Free alternatives to Claude Code
“Free” means two different things here, and conflating them is how people end up with an unexpected bill.
- Free software, paid inference. OpenCode, Aider, Cline, Goose, Crush and Kilo Code cost nothing to install, but you supply an API key and pay per token. Whether that is cheaper than a $20 subscription depends entirely on your volume.
- Free because you already pay. Codex CLI is included with ChatGPT Plus at $20/month. If you have that subscription, it is the cheapest capable option available to you, and it is second on the leaderboard.
- Genuinely free at low volume. Several providers offer free tiers that these tools can point at. Expect rate limits and slower models.
If you want zero spend: run OpenCode or Aider against a local model through Ollama or LM Studio. Quality drops noticeably against frontier models, but the cost is your electricity bill.
A warning: Gemini CLI no longer exists
Many “Claude Code alternatives” lists still recommend Gemini CLI and its generous free tier. That advice is dead.
Google announced the change on 19 May 2026 and shut the service off on 18 June 2026. In its own words, Gemini CLI and the Gemini Code Assist IDE extensions “will stop serving requests for Google AI Pro and Ultra, as well as those using it free of charge.” Enterprises on Gemini Code Assist Standard or Enterprise licences kept their access, and Gemini CLI remains reachable through paid Gemini API keys.

Google’s own announcement, published 19 May 2026. The shutdown followed on 18 June.
The replacement is Antigravity CLI — a closed-source Go rewrite with a new binary, a new config layout, and weekly rather than daily quotas. Note that word: the open-source Apache-2.0 tool has been replaced by a proprietary one. If open licensing is why you were leaving Claude Code, Antigravity does not solve your problem.
Gemini CLI’s last verified Terminal-Bench 2.1 result was 65.8%, well behind the leaders.
Paid alternatives worth considering
Cursor ($20/mo Pro) is a full IDE rather than a terminal agent, with Pro+ at $60 and Ultra at $200. Its separate Cursor CLI posted the most cost-efficient score on the leaderboard, subject to the hacks caveat above.
Windsurf ($20/mo Pro) retired its credit system in March 2026 and moved to daily and weekly quotas. Pro was $15 before that change. Max is $200/month.
Both are worth it only if you want an editor. If you are happy in a terminal, the open-source options cost less and lock you in less.
How to actually migrate
- Export your project context. Your CLAUDE.md is not wasted. OpenCode, Cline, Goose and most others read an equivalent instructions file — copy it across and rename it.
- Get an API key before you uninstall anything. Most alternatives are bring-your-own-key. Set a hard spend limit on that key on day one.
- Run both for a week. Give the new tool the same tasks you would have given Claude Code and compare on your own work, not on a benchmark.
- Watch the first bill closely. Per-token billing has no ceiling. The subscription you left had one — and if you are not sure how close you were to it, check your Claude Code usage first.
- Keep a fallback. Claude Code’s free tier and your existing subscription do not vanish. There is no reason to burn the boat.
So which should you pick?
- Want open source and one recommendation: OpenCode.
- Already pay for ChatGPT: Codex CLI, free with your plan and second on the leaderboard.
- Live in VS Code: Cline.
- Need to self-host: OpenHands.
- Want minimal and git-native: Aider.
- Want the cheapest strong score: Cursor CLI, with the hacks penalty in mind.
- Actually just hitting your limit: fix your quota usage first. Switching tools to solve a usage problem usually trades a predictable bill for an unpredictable one.
Frequently asked questions
What is the best open source alternative to Claude Code?
OpenCode, on current evidence. It is MIT licensed, has 196.2k GitHub stars, is terminal-first and works with a wide range of model providers. No open-source agent has posted a verified Terminal-Bench score, so this is a judgement based on adoption and design, not measured capability.
Is there a free alternative to Claude Code?
Several, but check what “free” means. OpenCode, Aider, Cline, Goose and Kilo Code are free to install and then charge you per token through your own API key. Codex CLI is included with a $20/month ChatGPT Plus subscription. For genuinely zero spend, run OpenCode or Aider against a local model.
Is any alternative better than Claude Code?
Not on the benchmark. Claude Code with Fable 5 holds first place on Terminal-Bench 2.1 at 83.8%, with Codex statistically tied. Alternatives win on price, licensing and model freedom, not on raw capability.
Can I still use Gemini CLI?
No. Google retired it on 18 June 2026 for free, Pro and Ultra users with no grace period. The replacement, Antigravity CLI, is closed source.
Do alternatives work with my CLAUDE.md file?
Most read an equivalent project-instructions file under a different name. The content transfers; the filename usually does not.
Which alternative is cheapest?
If you already pay for ChatGPT, Codex CLI costs you nothing extra. If you don’t, running an open-source agent against a local model costs nothing but hardware. Between those, cost depends entirely on your token volume.
Sources
- Terminal-Bench 2.1 leaderboard — accuracy, cost and hacks figures, read 12 August 2026
- OpenCode on GitHub — 196.2k stars, MIT
- OpenHands on GitHub — 83.7k stars, MIT
- Cline on GitHub — 66.0k stars, Apache-2.0
- Goose on GitHub — 52.7k stars, Apache-2.0
- Aider on GitHub — 48.1k stars, Apache-2.0
- OpenAI Codex on GitHub — 105.3k stars, Apache-2.0
- Transitioning Gemini CLI to Antigravity CLI — Google Developers Blog
Star counts and benchmark figures were read from primary sources on 12 August 2026. This category moves quickly — if a number here no longer matches the source, tell us and we will re-verify.