Claude Code Alternatives: Terminal Agents Sorted by Why You're Leaving
September 29, 2026

Most people searching for Claude Code alternatives don't want a different kind of tool. They like the shape: an agent in the terminal that reads the repo, edits files, runs the tests, and loops. What they want to change is one specific thing about Claude Code itself.
That one thing decides the answer. The reasons that come up:
- Cost. Claude Code requires a paid plan: Pro, Max, Team, Enterprise, or a Console account. The free claude.ai plan doesn't include it.
- Model lock-in. Claude Code runs Claude models. You want to use GPT, Gemini, DeepSeek, or whatever leads next quarter.
- Open source. You want to read, audit, or fork the agent itself.
- Local models. Code that can't leave the machine, or a model you run yourself.
This page sticks to agents with the same terminal shape. If you actually want the agent inside an editor instead, that's a different decision, and Cline vs Cursor is a better starting point.
Quick comparison
| Tool | Open source | Models | Local models | How you pay |
|---|---|---|---|---|
| Claude Code | No | Claude | Not officially | Claude plan or Console usage |
| Codex CLI | Yes, Apache-2.0 | OpenAI, plus local | Yes, via Ollama or LM Studio | ChatGPT plan or API key |
| GitHub Copilot CLI | No | Several hosted, plus your own provider | Yes, via your own provider | Copilot plan, AI credits |
| OpenCode | Yes, MIT | 75+ providers | Yes | Provider directly, or a supported subscription |
| Cline CLI | Yes, Apache-2.0 | Many providers | Yes | Provider directly |
| Aider | Yes, Apache-2.0 | Almost any | Yes | Provider directly |
| Gemini CLI / Antigravity CLI | Gemini CLI is, Apache-2.0 | Gemini | — | Changed in 2026, see below |
If the monthly bill is the problem
Claude Code's cost isn't the tool, it's the model access. Every agent on this page spends tokens the same way, because each step re-sends context. Switching agents changes who you pay and how, not the fact that long agent runs are expensive.
So the real choice is between billing shapes:
| Billing shape | Tools | Good when |
|---|---|---|
| Flat subscription you may already have | Codex CLI (ChatGPT plans), Copilot CLI (Copilot plans) | You already pay for ChatGPT or Copilot |
| Pay the model provider directly | OpenCode, Cline, Aider | Your use is light or bursty |
| Run a local model | OpenCode, Cline, Aider, Codex CLI | You have the hardware and can accept weaker output |
Codex CLI is the obvious first stop if you already pay OpenAI. Its README recommends signing in with your ChatGPT account to use it as part of a Plus, Pro, Business, Edu, or Enterprise plan, with an API key as the alternative. The agent loop is close to Claude Code's, so your habits carry over. Claude Code vs Codex covers how similar the two have become.
GitHub Copilot CLI is the equivalent if your company already pays for Copilot. GitHub says the CLI is available with all Copilot plans, and that each interaction consumes AI credits based on the tokens processed, varying by model. It can also hand work to Copilot's cloud agent, which runs in its own ephemeral environment powered by GitHub Actions and comes back with a pull request. If Copilot is already approved and billed at work, that alone can settle it. Claude Code vs GitHub Copilot goes deeper on that trade.
Bring-your-own-key tools (OpenCode, Cline, Aider) have no platform fee. You pay the model provider per token. For a few tasks a week that is often cheaper than any subscription. For all-day agent use it can easily cost more. Run a week of your real work and check the provider dashboard before you decide.
If you want a different model
This is where the open tools stand out. They treat the model as a setting, not a product decision.
OpenCode has the widest reach. Its provider docs say it uses the AI SDK and Models.dev to support 75+ LLM providers, plus local models. It can also sign in with subscriptions you may already hold: ChatGPT Plus or Pro, GitHub Copilot, and GitLab Duo.
One catch if you're coming from Claude Code: OpenCode's docs say Anthropic prohibits using Claude Pro or Max subscriptions through third-party plugins, and that OpenCode stopped bundling those plugins as of version 1.3.0. Claude models still work, but through an Anthropic API key.
Cline is best known as a VS Code extension, but it now describes itself as an open-source coding agent for your IDE, terminal, and desktop. The Cline CLI shares its agent core with the extension. Rules, skills, MCP servers, and provider settings behave the same everywhere. It takes API keys from the major providers and any OpenAI-compatible endpoint, or signs in with a ChatGPT subscription. If your team is split between editor and terminal, that shared setup is the draw.
Copilot CLI also lets you switch models with /model. It can point at your own provider too: any OpenAI-compatible endpoint, Azure OpenAI, or Anthropic.
If you want open source
Claude Code is not open source. If you need to read exactly what the agent does before it touches your codebase, or fork it, you need one of these:
| Tool | Licence | What stands out |
|---|---|---|
| Codex CLI | Apache-2.0 | Closest to Claude Code's shape, from a major lab |
| OpenCode | MIT | Widest model choice, terminal UI plus a desktop app in beta |
| Cline | Apache-2.0 | One agent core across CLI, VS Code, JetBrains, and desktop |
| Aider | Apache-2.0 | Git-native: every change lands as a commit |
Aider is the veteran of the group. It maps your whole codebase and commits each change automatically, with sensible commit messages, so reviewing and undoing is just git. It connects to most LLMs, local ones included. Check activity before you standardise on it, though. As of September 2026, the most recent Aider release on PyPI dates from February 2026, and its model recommendations still name older models. It moves more slowly than the others here.
Copilot CLI is missing on purpose: its licence lets you install and run it, and redistribute only unmodified copies, so it isn't open source.
If you want local models
Local inference changes two things. Nothing leaves your machine, and each run costs nothing. The catch is quality. Local open-weight models are noticeably weaker on long, multi-step agent runs than frontier hosted models. Use them for scoped tasks, not hour-long unattended refactors.
| Tool | Local route |
|---|---|
| Codex CLI | --oss flag, with Ollama or LM Studio as the local provider |
| OpenCode | Ollama, LM Studio, llama.cpp, and other OpenAI-compatible servers |
| Cline | Ollama, LM Studio, or Atomic Chat |
| Aider | Ollama, LM Studio, and OpenAI-compatible APIs |
| Copilot CLI | Your own provider, including Ollama or vLLM |
Copilot CLI's docs state a constraint that applies to every tool here: the model must support tool calling and streaming, ideally with a context window of at least 128k tokens. Many small local models fail that bar.
One twist before you leave Claude Code over this: Ollama documents an integration that connects Claude Code to local models through Ollama's Anthropic-compatible API. That's Ollama's route, not an Anthropic-supported one, but if local models are your only complaint it's worth an afternoon. LM Studio vs Ollama covers choosing the local runtime.
What happened to Gemini CLI
Older lists of Claude Code alternatives put Gemini CLI near the top because it had a generous free tier. That changed in 2026.
Google's developer blog says that on June 18, 2026, Gemini CLI stopped serving requests for Google AI Pro and Ultra subscribers and for free users. The Gemini Code Assist IDE extensions stopped too. According to the same post, Gemini CLI remains usable with paid Gemini and Gemini Enterprise Agent Platform API keys, and Standard and Enterprise licence holders keep access.
The replacement Google points to is Antigravity CLI, the terminal interface of its Antigravity platform. Google's migration docs say it imports Gemini CLI extensions, skills, and settings on first launch, and still reads your GEMINI.md and AGENTS.md files.
Two cautions:
- The Gemini CLI repository is still Apache-2.0 and actively updated, and as of late September 2026 its README still describes a personal-account free tier. Google's announcement is the newer, more specific statement. Go by that.
- Don't assume Antigravity CLI is free because Gemini CLI once was. Its docs include a section on AI credits. Check Google's current terms before you plan around it.
Where Claude Code is still stronger
It's a mature, integrated product. Skills, hooks, MCP, IDE extensions, a desktop app, and cloud tasks that run off your machine all come from one vendor and are documented together. The open tools have many of the same pieces, but you assemble them yourself.
Long runs tend to stay on track. Most alternatives hold up on a single scoped task. The gap shows on long unattended runs, and depends on the model as much as the agent. Test that on your own repo, not a leaderboard.
Enterprise routes exist. If the blocker is procurement, Anthropic's setup docs note Claude Code also runs through Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry.
Picking one
- Already pay for ChatGPT? → Codex CLI.
- Company already pays for Copilot? → Copilot CLI.
- Want the widest model choice? → OpenCode.
- Want one agent across terminal and editor? → Cline.
- Want git-native and simple? → Aider, after checking recent activity.
- Must stay local? → OpenCode, Cline, or Codex CLI with
--oss, and keep tasks small.
Whatever you choose, write your project conventions into the agent's rules file (AGENTS.md for Codex, CLAUDE.md for Claude Code). It improves output more than switching tools does.
If the terminal is the actual problem
Everything above assumes you're comfortable with a terminal, API keys, and a repo that builds. Some readers aren't. You saw someone's agent setup do something useful, tried to reproduce it, and hit a wall of config files and environment variables. A cheaper or more open agent doesn't fix that.
Taku is built for that situation. It's an AI-native desktop workspace where you mirror an AI app, skill, or workflow someone already got working, run it, remix it, and keep it. It isn't a coding agent and doesn't compete with anything on this page. It's for the step before, where people stall on setup. Taku is in Beta, and the Mac app is available now. The free app library shows what you can mirror.
FAQ
Is there a free Claude Code alternative?
The software is free for Codex CLI, OpenCode, Cline, and Aider, since all four are open source. The model usually isn't. You pay a provider, use a subscription you already have, or run a local model, which is the only fully free route. Expect lower quality on complex tasks if you go local.
Can I use my Claude subscription in another agent?
Not through third-party plugins. OpenCode's docs say Anthropic prohibits using Claude Pro or Max subscriptions that way. Other agents can use Claude models through an Anthropic API key, billed per token.
Is Gemini CLI still free?
No. Per Google's June 2026 announcement, it stopped serving free users and Google AI Pro and Ultra subscribers on June 18, 2026. Paid API keys and Code Assist Standard or Enterprise licences still work, and Google now points people to Antigravity CLI.
Which alternative is closest to Claude Code?
Codex CLI. Same terminal loop, an AGENTS.md file in place of CLAUDE.md, and a cloud agent and desktop app alongside the CLI. The main differences are the model family and that Codex CLI's source is open.