This article was originally published on aicoderscope.com
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 fr
Top comments (0)