OpenCode review 2026: the open-source terminal coding agent that challenges Claude Code
TL;DR: OpenCode is an MIT-licensed, provider-agnostic terminal coding agent with 167k GitHub stars built by the team behind terminal.shop. Bring your own API keys and the core agent costs nothing; if you skip that step, the $10/month Go tier runs open-weight models at a flat rate. It’s roughly 78% slower than Claude Code on identical tasks per Builder.io’s testing — but more thorough, with real LSP diagnostics baked in.
| OpenCode | Claude Code | Codex CLI | |
|---|---|---|---|
| Best for | BYOK workflows, local models, privacy-sensitive environments | Anthropic-stack teams wanting best-in-class model | ChatGPT Plus subscribers wanting free agent mode |
| Price / Cost | $0 core (BYOK); $10/mo Go; Zen PAYG from $20 | $20/mo Max; or direct API billing | Free with ChatGPT Plus; or API billing |
| The catch | Sends prompts to Grok by default; 1 GB+ RAM for a TUI; fast, bug-prone release cadence | Anthropic-only model lock | GPT-only model lock |
Honest take: If you’re already paying for Anthropic API credits, OpenCode with BYOK is the cheapest path to Claude-powered terminal agents — same model, no subscription markup. Get comfortable with configuration overhead first.
Why 167,000 people starred this in two months
When the “Show HN” post for OpenCode landed in early March 2026 (HN item 47460525), it hit #1 within hours. The timing wasn’t accidental. OpenAI had just shipped Codex CLI and locked it to GPT. Anthropic’s Claude Code was the dominant terminal agent — polished, fast, and tied permanently to one provider. Developers watching two proprietary agents race each other were looking for the open-source answer.
OpenCode was it. Provider-agnostic from day one, MIT licensed, shipping a polished TUI instead of a bare readline loop. The star count is now past 167,000.
The question worth asking isn’t whether it’s popular. It’s whether it’s useful for daily work — and where it breaks.
What OpenCode is
OpenCode is a terminal-first AI coding agent. Not a VS Code plugin, not a cloud IDE — a Go binary that opens a TUI, connects to your chosen LLM provider, and helps you write, debug, refactor, and document code from the command line. It runs from opencode.ai, with source at github.com/anomalyco/opencode. Current version as of writing: v1.15.12 (released May 28, 2026).
Unlike terminal tools that wrap a single provider’s SDK, OpenCode speaks to Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure OpenAI, Groq, and OpenRouter — plus any local model running through Ollama or another OpenAI-compatible endpoint. That’s 75+ model options, none of them hardcoded.
A desktop app (beta) is available for macOS, Windows, and Linux if you want a windowed experience without an IDE. IDE extensions exist for VS Code and its forks. For most developers, the terminal is the primary interface.
Install in one command
curl -fsSL https://opencode.ai/install | bash
Alternatively:
brew install opencode # macOS/Linux via Homebrew
npm install -g opencode # npm
yay -S opencode-ai-bin # Arch AUR
First run prompts for an API key (Anthropic, OpenAI, Google, or any configured provider). You can also authenticate through OpenCode’s own cloud service — but read the privacy section before doing that.
The two-agent architecture: plan before you build
Every session runs in one of two modes, switchable with Tab:
Build mode gives the agent full tool access: read files, write files, run shell commands, search the codebase. This is the default for executing work.
Plan mode is read-only. The agent drafts what it intends to do before touching any files. You review, push back, and switch to Build only when you’re satisfied with the plan.
That discipline is worth more than it sounds. The most common failure mode with AI coding agents is watching them dive into changes you didn’t authorize and dig in deeper when you try to stop them. Making “plan then execute” a native UI concept — not a prompting trick — is one of OpenCode’s better design choices.
Beyond Build and Plan there are three more specialized modes: Debug (investigation, read-only), Review (code review only), and Docs (reads and writes documentation files). Each exposes a distinct tool set and is pitched at a different class of task.
Model support: BYOK that actually works
The model picker is where OpenCode justifies its popularity. You’re not choosing from a three-item curated list — you’re connecting to whatever provider fits the task. 75+ options across every major provider, with local models through Ollama configured via a single JSON block.
For teams with data-residency constraints, pointing OpenCode at an AWS Bedrock or Azure OpenAI endpoint means prompts never leave the cloud tenant. That’s a meaningful capability gap over Claude Code and Codex CLI, neither of which supports provider switching at all.
Multi-session support adds another dimension: run independent agent sessions on the same codebase simultaneously, each with its own context window and model config, persisted in SQLite so you can close the terminal and resume. A research session in one pane, an implementation session in another — without them stomping on each other.
Pricing: $0, $10/month, or pay-as-you-go
Free / BYOK: The core agent is MIT licensed. You pay only the API provider’s per-token rates — whatever Anthropic, OpenAI, or anyone else charges. There’s no OpenCode subscription fee on top.
OpenCode Go ($10/month, first month $5): Gives you access to a curated set of open-weight coding models hosted by OpenCode, including Kimi K2.5 and K2.6, DeepSeek V4 Pro and Flash, Qwen3.7 Max, GLM-5.1, MiMo-V2.5-Pro, and MiniMax M2.5 and M2.7. These aren’t Claude or GPT — they’re competitive open-weight models with solid coding benchmarks. For developers who don’t want to manage API keys from multiple providers, $10/month is a reasonable floor.
OpenCode Zen (pay-as-you-go from $20): 40+ premium models including GPT-5.x, Claude, and Gemini, proxied through OpenCode’s infrastructure at a small markup above raw API rates. Better than a flat subscription if your usage is uneven across weeks.
The open-source licensing means you could self-host the backend components. Documentation for self-hosting the managed tiers isn’t publicly available as of this writing.
LSP integration: diagnostics that ground the agent in real compiler output
Every AI coding tool reads your source files as text. OpenCode’s LSP integration connects to your actual language server — gopls, typescript-language-server, pyright, rust-analyzer — and receives real diagnostics. When the agent writes code with a type error, the LSP catches it and feeds it back before the agent commits to a broken path.
That feedback loop is the difference between an agent that hallucinates method signatures and one that catches its own mistakes in real time. Configuring it takes one block in opencode.json:
{
"lsp": {
"typescript": {
"command": "typescript-language-server",
"args": ["--stdio"]
}
}
}
The MCP (Model Context Protocol) support extends the agent with external tools — GitHub, PostgreSQL, custom APIs, filesystem access beyond the project root. Add a server to your config and its tools are available to the agent automatically, following the same permission model as built-in tools. If you’re already running MCP servers for Claude Code or another agent, the configuration format is compatible.
Custom commands let you define reusable prompts as Markdown files, stored per-user or per-project, with named argument placeholders. The conceptual equivalent of .cursorrules but composable and version-controlled alongside your code.
The privacy fine print
Before authenticating through OpenCode’s cloud service, two things are worth knowing:
By default, OpenCode sends your prompts to Grok’s free tier to generate session titles — even if you’ve configured only local models or a different provider. This was reported and confirmed in the March 2026 Hacker News thread and tracked in GitHub issues. The fix is explicit: set a smallModel in your config pointing to your actual provider.
When you authenticate through OpenCode’s own cloud service (rather than using BYOK API keys), your prompts and full responses are persisted to a Cloudflare R2 bucket. There’s no opt-out in the UI, and it’s not prominently disclosed in the onboarding flow. This concern is documented in GitHub issue #14281.
Neither issue applies when you use BYOK — point OpenCode directly at Anthropic, OpenAI, or a private Bedrock endpoint and your data goes only to that provider. For any codebase with proprietary code or NDA obligations, BYOK is the only correct configuration.
Performance: slower, but more thorough
Builder.io ran OpenCode and Claude Code on identical tasks using Claude Sonnet 4.5. Result: Claude Code completed in 9 minutes 9 seconds; OpenCode took 16 minutes 20 seconds — 78% slower. OpenCode generated 21 more tests during that session.
The interpretation matters. OpenCode isn’t slow because it’s inefficient. The LSP feedback loop adds latency on every edit. The Plan-then-Build workflow inserts a deliberation step. On tasks where correctness matters more than speed — refactoring a high-coverage module, extracting an abstraction from legacy code — the extra time pays off. On exploratory greenfield work, Claude Code’s pace feels better.
The 1 GB+ RAM footprint raised complaints in the Hacker News thread. It’s a Go binary running a full LSP client, a SQLite database, and a TUI renderer simultaneously. On a developer laptop it’s invisible; on a minimal 4 GB container it’s a real constraint.
OpenCode vs Claude Code vs Codex CLI
| Feature | OpenCode | Claude Code | Codex CLI |
|---|---|---|---|
| License | MIT (open source) | Proprietary | Proprietary |
| Model support | 75+ providers | Anthropic only | OpenAI only |
| BYOK | Yes | Yes (API billing) | Yes (API billing) |
| Local model support | Yes (Ollama) | No | No |
| LSP integration | Yes | No | No |
| MCP support | Yes | Yes | Limited |
| Plan/Build UI separation | Native | Manual | Manual |
| Multi-session | Yes | No | No |
| Desktop app | Beta | No | No |
| Privacy (BYOK) | Direct to provider | Direct to Anthropic | Direct to OpenAI |
| Flat subscription | $0 core / $10/mo Go | $20/mo Max | Free (ChatGPT Plus) |
Where Claude Code pulls ahead: faster execution, tighter CLAUDE.md context management, and a more stable release track. If you’re on the Anthropic stack, it’s the natural fit — the Claude Code power user setup guide covers how deep the configuration goes.
Where Codex CLI wins: zero additional cost if you’re already paying for ChatGPT Plus, plus deep GitHub integration through the Codex cloud product. The full comparison is at Claude Code vs Codex CLI.
Where OpenCode wins: when you need to switch providers, when data-residency rules push you toward local or air-gapped models, when the LSP feedback loop matters for your stack, or when $10/month against open-weight models is the right ceiling.
The verdict
OpenCode is the most serious open-source terminal coding agent available right now. The 167,000-star count isn’t hype — the feature set earns it. BYOK that actually works across every major provider, LSP integration that grounds the agent in real compiler output, native Plan/Build separation, and an MIT license that lets you self-host everything.
The catch: it’s still maturing. The v1.15.x release cadence means something is broken at any given moment. The default Grok prompt routing is a surprise you shouldn’t have to find in a GitHub issue. The RAM footprint is heavy for a TUI.
For developers paying API costs directly, OpenCode with BYOK is the cheapest path to a Claude-powered terminal agent — the same model as Claude Code Max, no subscription fee. For everyone else, the Go tier at $10/month gives you a functional coding agent at half the cost of Claude Code, if open-weight models are acceptable. For anyone who wants maximum flexibility and doesn’t mind configuring it, this is where open-source terminal coding lands in 2026.
Frequently Asked Questions
Is OpenCode actually free? The core agent is MIT licensed and free. You pay only what your API provider (Anthropic, OpenAI, Gemini, etc.) charges per token. The OpenCode Go subscription ($10/month after a $5 first month) gives you access to hosted open-weight models without managing multiple API keys separately.
Does OpenCode work with local LLMs?
Yes. Configure any model running through Ollama or another OpenAI-compatible endpoint as a custom provider in opencode.json. This is the right setup for privacy-sensitive codebases where prompts should never leave your machine.
How does OpenCode compare to Claude Code on the same model? On identical tasks using Claude Sonnet 4.5, Builder.io found Claude Code completed in 9 minutes 9 seconds versus OpenCode’s 16 minutes 20 seconds — 78% slower. OpenCode generated 21 more tests. Faster isn’t always better; for correctness-critical refactoring, the extra time has real value.
Is OpenCode safe to use with proprietary code? With BYOK (your own API keys pointing directly at a provider), prompts go only to that provider — no OpenCode intermediary. The privacy concern involves OpenCode’s own cloud authentication service, which stores prompts in Cloudflare R2 without an opt-out. Use BYOK for any sensitive codebase.
What is OpenCode Zen? Zen is OpenCode’s pay-as-you-go premium model service covering 40+ models including GPT-5.x, Claude, and Gemini variants. It starts at a $20 balance increment and proxies through OpenCode’s infrastructure at a small markup above raw API rates. Useful for variable usage patterns where a flat subscription doesn’t make financial sense.
Sources
- OpenCode GitHub repository — anomalyco/opencode
- OpenCode official documentation — Agents
- OpenCode LSP documentation
- OpenCode Go subscription — opencode.ai/go
- OpenCode Go documentation
- OpenCode Zen — opencode.ai/zen
- OpenCode changelog — v1.15.x series
- OpenCode release history — GitHub Releases
- Hacker News: “OpenCode – Open source AI coding agent” (item 47460525)
- HN: default Grok prompt routing (item 47463880)
- GitHub issue #14281: server-side prompt storage without opt-out
- Builder.io: OpenCode vs Claude Code head-to-head
- OpenCode context management strategies — AlexMercedCoder
Last updated May 29, 2026. Pricing and features change frequently; verify current state before purchasing.
Was this article helpful?
Thanks for the feedback — it helps improve future articles.