Four terminal-based AI coding agents now want to live inside the same shell prompt you already type into, and three of them shipped or went GA inside a single eleven-month window. Claude Code crossed into general availability in February 2026. OpenAI's Codex CLI landed in April 2026. Google's Gemini CLI arrived in June 2026 as a free-tier play with a generous quota. OpenCode, an open-source agent framework, has been building quietly underneath all of them as the option you can fork. The surface looks identical: you type a task, the agent reads your repo, edits files, runs commands, and opens a pull request. Under that surface the four diverge on the question that actually decides your bill and your lock-in: who owns the model, who owns the license, and who owns the agent when it breaks at 2 a.m.

This is not a feature list copied from four README files. It is a comparison of four business models wearing the costume of developer tools. The model you pay for, the license you accept, and the escape hatch you keep determine whether a terminal agent is a productivity multiplier or a subscription you cannot cancel without rewriting your workflow. Below, the numbers and the trade-offs that the marketing pages leave out.

How the Four Actually Differ

The fastest way to see the split is to put the four side by side on the axes that bite later: license, model source, local execution, and what it costs to run a real session.

AgentLicenseModel sourceRuns fully local?Entry cost
Claude CodeProprietary (Anthropic)Claude models onlyNo (API calls out)Tiered subscription, usage metered
Codex CLIApache-2.0 (open source)OpenAI modelsNo (API calls out)Free tier + pay-per-token
Gemini CLIApache-2.0 (open source)Gemini modelsNo (API calls out)Free quota (high), then paid
OpenCodeMIT (open source)Any provider you wire upYes, if you point it at a local model$0 if self-hosted

The key takeaway from that table is the license-and-model coupling. Codex CLI and Gemini CLI are open source in name but route you to a single vendor's API by default, so the Apache-2.0 label mostly protects your right to read the code, not your freedom from the bill. OpenCode is the only one of the four that treats the model as a pluggable backend, which is why it is the one solo founders mention when they talk about not waking up to a surprise invoice.

Licensing Is the Real Lock-In

Claude Code is the cleanest product and the hardest to leave. You get tight integration with Anthropic's models, polished subagent and permissions handling, and a roadmap that moves fast because one company controls both ends. The cost of that polish is that your agent's brain and your agent's body are the same vendor, and the pricing tiers have shifted as the product matured. If Anthropic raises rates or changes the acceptable-use terms, your workflow moves only as fast as you can rebuild it on a competitor.

Codex CLI and Gemini CLI invert that trade. Both are Apache-2.0, so you can audit, patch, and self-host the client. Both default to their parent's model, which means the open license does not save you from the API bill, but it does save you from being unable to see what the client is doing with your files. Gemini CLI's launch move was a large free quota attached to a Google account, a customer-acquisition tactic dressed as generosity. Codex CLI leans on OpenAI's existing developer billing and the Codex brand that already ships inside ChatGPT. Neither is local-first, and neither lets you swap the default model without configuration work.

Model Access and the Local Escape Hatch

OpenCode is the outlier that makes the other three look like storefronts. Because it abstracts the provider, you can point it at OpenAI, Anthropic, Google, or a local model served through Ollama or llama.cpp. For a founder on a MacBook who wants zero per-call cost and zero data leaving the machine, that is the only option on this list that closes the loop. The price is that you assemble the pieces yourself: you choose the model, you manage the context window, and you own the rough edges. The other three hand you a finished product and a monthly charge.

There is a second axis the tables rarely show: how each agent handles long sessions and context. Claude Code's context management and subagent spawning are the most mature, which is why it shows up most often in stories about agents running for hours on a real codebase. Codex CLI inherited OpenAI's context-trimming work, including the recent pull request that cut its window from 372k to 272k tokens to save cost and latency. Gemini CLI benefits from Google's long-context models by default. OpenCode inherits whatever you plug in, so its ceiling is your backend's ceiling.

What This Means for Builders

The four agents are converging on the same interface because the interface won. Typing natural language into a terminal that edits your repo is now table stakes, not a differentiator. The real decision is not which agent is best, it is which dependency you are willing to accept. If you want the least friction and trust one vendor, Claude Code is the finished product. If you want to read the code and avoid a surprise license change but still pay for a hosted model, Codex CLI or Gemini CLI give you the audit right without the local option. If your priority is keeping data on your machine and cost at zero, OpenCode with a local model is the only path that delivers both, and the cost is your own setup time.

For solo founders specifically, the trap is adopting the smoothest agent first and discovering the bill and the lock-in later. The cheaper move is to start on OpenCode with a free hosted tier, learn what you actually use, then graduate to a paid agent only for the features you have proven you need. The agents are interchangeable at the prompt level, which means the switching cost is lower than any of the four want you to believe. The vendor that wins your loyalty will be the one whose model quality and pricing hold steady, not the one with the slickest onboarding.

The next six months will likely compress these differences further as each clones the others' best workflow features. The durable advantage belongs to the open clients, because they can absorb any model the market produces, while the proprietary agents are pinned to their own labs. Pick the open shell now and you keep the right to change your mind about the brain later.

Sources