
OpenCode has 180,000 GitHub stars, 16 million monthly active developers, and costs nothing to install. The tool itself is MIT-licensed — you bring an API key from any of 75+ providers, or plug in a local Ollama model and pay zero per token. That value proposition explains why it’s the most-adopted open-source coding agent ever built, and why Anthropic felt threatened enough to block it.
What OpenCode Is
OpenCode is a terminal-first AI coding agent that reads your codebase, plans changes, writes and edits code, runs commands and tests, and iterates until a task is complete — with your explicit approval at each step. Built by Anomaly and released under the MIT license, it ships in three forms simultaneously: a text-based TUI you run in any terminal, a standalone desktop app, and an IDE extension that drops into VS Code, Cursor, Windsurf, or VSCodium.
The zero-cost angle is real but needs context. The tool costs nothing; the models do not. You can run local models through Ollama at true zero cost, or connect to frontier models like GPT-5.6 or Gemini 3.x through API keys. OpenCode itself never bills you — it’s a router, not a subscription.
The Anthropic Block: Platform Risk in Real Time
On January 9, 2026, Anthropic quietly flipped a switch and broke thousands of developer workflows overnight. Third-party tools — including OpenCode — had been tunneling through Claude Code’s credentials to access Claude models at Claude Code’s pricing tier. Anthropic shut that down, and OpenCode lost direct Anthropic API access with no warning.
What happened next matters more than the block itself. OpenAI officially partnered with OpenCode. The team pivoted within days to make every major provider — GPT, Gemini, Grok, DeepSeek, local Ollama — a first-class citizen. Today, you can still access Claude models via OpenRouter; you just can’t do it through Anthropic’s API directly.
The lesson is worth holding: any tool that routes through someone else’s API is one TOS change away from breaking. OpenCode’s provider-agnostic design is now a feature, not just a selling point — it’s what survived the crackdown.
How It Works
Two agents, toggled with Tab. Build gives the agent full filesystem access: it can read, write, create files, and run shell commands. Plan is read-only — useful for exploration, architecture discussion, or when you want to review a plan before anything gets touched. Think of it as the difference between asking a contractor to start work versus asking them for a quote first.
Safety is handled through /undo and /redo commands that roll back changes, and through parallel session support — open a second terminal, run OpenCode again, and you have two independent agents working on different parts of a problem simultaneously.
Project conventions live in AGENTS.md, a markdown file in your repository root that OpenCode reads before doing anything. Document your naming conventions, off-limits files, and testing requirements — the agent follows them. The /init command generates a starter AGENTS.md by scanning your codebase. OpenCode also supports MCP servers, configurable in opencode.json with per-agent tool scoping.
Getting Started
# Install
curl -fsSL https://opencode.ai/install | bash
# Or via npm
npm install -g opencode-ai
# Launch and connect a provider
opencode
# Then run /connect inside the TUI
A minimal opencode.json at your project root is all the configuration you need:
{
"$schema": "https://opencode.ai/config.json",
"model": "openai/gpt-5.6-luna",
"small_model": "google/gemini-3-flash"
}
Pricing: What You Actually Pay
- Free (BYOK): Install the tool, connect your own API key. Local Ollama models cost $0/token. Frontier models billed directly by provider.
- Go plan ($10/month): Up to $60 of token usage across 24 models, dollar-metered. When you exhaust the cap, you drop to free models rather than getting cut off.
- Zen gateway (pay-as-you-go): No monthly fee. Access to 50+ curated models — Claude Fable 5 via OpenRouter, GPT-5.6, Gemini 3.x, Grok, DeepSeek — at published per-token rates.
Realistic Zen usage for a daily-driver developer runs $15–30/month. That’s half what Claude Code or Cursor Pro cost, with the ability to swap models mid-session.
When OpenCode Makes Sense (And When It Doesn’t)
OpenCode is the right choice if you want model flexibility, run on a budget, or need to spin up parallel agent sessions without paying per seat. It’s well-suited for prototyping, open-source work, and situations where you want to experiment with local or newer frontier models before they’re available in other tools.
It is not the right choice if you need raw reasoning depth for complex multi-file refactors. Published 2026 benchmarks show Claude Code completing equivalent tasks in 33,000 tokens versus Cursor’s 188,000 — token efficiency that OpenCode cannot match through orchestration overhead alone. For serious production architecture work, Claude Code remains the benchmark.
The practical split: OpenCode as a daily driver for solo and budget-conscious projects; Claude Code when the problem is hard and correctness matters more than cost. The two aren’t in competition — they occupy different positions on the cost/capability curve. If you need a recommendation: start with OpenCode’s free tier and a Gemini 3.x API key. If you hit the ceiling of what it can do, that’s when the Claude Code subscription earns its keep.













