OpenCode 2.0 vs Claude Code is the comparison I kept getting asked about this week, because OpenCode just shipped its biggest rewrite since launch. The OpenCode 2.0 announcement, posted on October 12, 2026, moves everything onto a background service, adds background subagents and a JavaScript “Code Mode” for MCP tools, and breaks every V1 plugin.
The short answer: Claude Code is still the safer default if Claude is your main model. OpenCode 2.0 is now the stronger choice if you want model freedom, a scriptable agent, or a cheap open-model subscription.
The longer answer depends on three things the marketing pages skip: which instruction file each tool reads, whether shell commands run inside a sandbox, and what OpenCode 2.0 quietly removed. This is a comparison from the published docs and migration guide, not a benchmark run.
What Changed in OpenCode 2.0
OpenCode 2.0 turns the agent into a local service that every client connects to. The terminal UI, web interface and desktop app now share a single background process on your machine. Other machines can connect with opencode pair, which prints a URL and credentials.
The big additions from the announcement:
- Background subagents that can run on a different model from the parent session
- Background shell commands that notify you when they finish, with Ctrl+B to push a running task into the background
- Code Mode, which turns MCP servers and OpenAPI endpoints into JavaScript functions the agent can call from a script, so several tool calls happen in one round trip
- A rebuilt API with
@opencode/client,@opencode/sdkand@opencode/codemodepackages - More than 80 features rebuilt as internal plugins, with terminal UI plugins now stable and hot-reloadable
Code Mode is the feature I find most interesting. An agent that writes a short script to call five MCP tools spends one model turn instead of five. That is a direct token saving on tool-heavy work. The catch is that the announcement says all MCP servers are opted in by default, so every server you have configured becomes callable from generated code.
The upgrade path arrived in OpenCode v1.19.0 on October 11, which added opencode upgrade --major. OpenCode 1 stays on the 1.x line unless you choose to move.
In short, OpenCode 2.0 is a platform rewrite, and it is aimed at people who want to build on the agent, not just chat with it.
OpenCode 2.0 vs Claude Code: Feature Comparison
Here is how the two compare on the points that change daily work:
| Agent | Models | Instruction file | Shell sandbox | Entry price |
|---|---|---|---|---|
| OpenCode 2.0 | 75+ providers, local models | AGENTS.md only | None documented | Free (BYO keys); Go $10/mo |
| Claude Code | Claude models (plus cloud providers and gateways) | CLAUDE.md (AGENTS.md via built-in mod) | OS-enforced, opt-in | Pro $20/mo |
(Sources: OpenCode V2 migration guide, OpenCode Go docs, Claude Code sandboxing docs, claude.com/pricing, Oct 2026)
Three rows in that table deserve more than a cell.
OpenCode 2.0 no longer reads CLAUDE.md
The migration guide is explicit: V2 discovers only AGENTS.md, not CLAUDE.md. If your team has spent months tuning a CLAUDE.md, OpenCode 2.0 will not see it. The guide tells you to move that guidance into AGENTS.md and file a compatibility issue if needed.
This is the part that would trip me up. Nothing errors. The agent simply runs without your project rules, and you notice only when it ignores a convention.
OpenCode 2.0 drops language-server diagnostics
The same guide says V2 preserves the lsp config block but does not run language servers, expose LSP tools or produce diagnostics. Its advice is to use lint, typecheck or compiler commands instead.
For a TypeScript or Go codebase, that is a real regression from V1. The agent loses the instant “this symbol does not exist” feedback and has to run tsc to find out. Claude Code goes the other way: its cost docs recommend code intelligence plugins precisely because one “go to definition” call replaces a grep plus several file reads.
Neither sandboxes shell commands by default
OpenCode’s permissions page does not describe a sandbox. It warns that shell runs with the host user’s filesystem, process and network authority.
Claude Code’s sandbox is also off by default, but it exists. Per the Claude Code sandboxing docs, turning it on puts an OS-enforced boundary around Bash commands and the processes they start, on macOS, Linux and WSL2. It covers shell commands only. File tools, MCP servers and hooks run outside it, and native Windows runs unsandboxed.
If you run agents against untrusted repos, Claude Code with /sandbox enabled is the safer setup today.
Permissions: OpenCode’s Rule List vs Claude Code’s Modes
OpenCode 2.0 replaces V1’s grouped permission block with an ordered permissions array. Each rule has an action, a resource and an effect of allow, deny or ask:
{
"permissions": [
{ "action": "read", "resource": "*", "effect": "allow" },
{ "action": "read", "resource": "secrets/*", "effect": "deny" },
{ "action": "shell", "resource": "npm test", "effect": "allow" }
]
}
The important detail: the last matching rule wins, so specific exceptions go after broad rules. If no rule matches, OpenCode asks. Saved “always” approvals never override a configured deny, and admin-level policies can turn an allow into a deny but never grant access.
The defaults are permissive. Every agent’s base policy allows everything, then asks for external directories and .env reads. The built-in plan agent denies edits outside its plan folder, and explore is read-only.
Claude Code evaluates permission rules in the opposite style, deny first, then ask, then allow, with permission modes layered on top. Both approaches work. OpenCode’s last-match-wins model is easier to reason about for long rule lists, but it is also easier to break by appending a broad allow at the end.
Whichever tool you pick, write the deny rules for secrets and production credentials first. Our guide to AI coding agent security covers why repo-delivered config is the attack path to watch.
OpenCode vs Claude Code Pricing in 2026
OpenCode itself costs nothing. You bring API keys, or sign in with an existing GitHub Copilot or ChatGPT subscription, according to the OpenCode site.
It also sells two optional things:
- OpenCode Go: $10 a month, or $40 for Go Plus, for about 32 open coding models including GLM 5.3, Kimi K3, Qwen3.8 Max, DeepSeek V4 Pro and Claude Haiku 5.5, per the Go docs. Each model has a monthly dollar limit of $15 to $80 on Go, with 5-hour and weekly allowances at 20% and 50% of that limit.
- Pay-as-you-go console: per-token pricing that matches vendor list prices for the models I checked, such as Claude Opus 5.5 at $4 input and $20 output per million tokens.
Claude Code comes with a Claude subscription. Anthropic’s pricing page lists Pro at $20 a month ($17 billed annually), Max from $100, and Team premium seats at $100 per seat billed annually. On the API, Anthropic says the average enterprise cost is about $13 per developer per active day and $150 to $250 per developer per month, with 90% of users under $30 a day.
| Setup | Monthly cost | What you get |
|---|---|---|
| OpenCode + own API keys | Usage only | Any of 75+ providers at list price |
| OpenCode Go | $10 | ~32 open models, per-model caps |
| Claude Code on Pro | $20 | Claude models within Pro limits |
| Claude Code on the API | ~$150–250 (enterprise average) | Pay per token, no plan cap |
(Sources: OpenCode Go docs, claude.com/pricing, Claude Code cost docs, Oct 2026)
On price alone, OpenCode Go is the cheapest way to get a capable agent running. The trade is model quality. Kimi K3 and GLM 5.3 are strong open coding models, but they are not Opus 5.5. Our AI model pricing tracker has the per-token numbers if you want to model your own usage. Whichever agent you choose, the habits in our guide to reducing Claude API costs (scoped sessions, modular rules, prompt caching) apply to both.
Which Should You Use?
Pick Claude Code if Claude is your main model and you value guardrails. You get the Bash sandbox, CLAUDE.md, hooks, the new Claude Code mods system and language-server-backed code intelligence. You also get the tool most developers are already using: the 2026 Stack Overflow Developer Survey found 66% of coding-agent users use Claude Code.
Pick OpenCode 2.0 if you switch models often, want to run open models like Meta’s new Muse Spark Open or Kimi K3 without a proxy, or want to embed the agent in your own tooling through its API and SDK. Background subagents on a cheaper model are a real cost lever.
Wait on OpenCode 2.0 if you depend on V1 plugins, rely on LSP diagnostics, or have not yet ported your CLAUDE.md. The migration guide’s own advice is to keep your V1 setup until V2 is validated, and I would follow it.
There is also a middle path. If you like Claude Code’s harness but want open-model prices, Together Link runs open models inside Claude Code without changing your config. For the wider field, our Claude Code vs Cursor vs GitHub Copilot comparison covers the IDE side.
Bottom Line
OpenCode 2.0 is the most ambitious open-source coding agent release this year. The service architecture and Code Mode are good ideas, and $10 a month for open models is hard to argue with.
It also ships with gaps: no LSP, no CLAUDE.md, no documented sandbox and a broken plugin ecosystem until authors port. Claude Code remains the more complete product for teams that live in Claude. Try OpenCode 2.0 on a side project this week, and keep your production setup where it is until the plugins catch up.