Until January 2026, the OpenCode vs Claude Code question had a shortcut: sign in to OpenCode with your Claude Max account and get Anthropic's models at subscription prices inside an open-source harness. On January 9 an issue titled "Broken Claude Max" appeared on OpenCode's tracker. It now has 386 comments, and the shortcut is gone for good.

What's left is a cleaner choice: Anthropic's harness on Anthropic's plans, or an MIT-licensed harness on whatever model you pay for. OpenCode also started shipping v2 in September with breaking changes, and none of the top-ranking comparisons we could read mention them.

The short answer: Pick Claude Code if Claude is the model you want: a Claude subscription (Pro at $20/month, Max at $100 or $200) is the cheap way to run it, and Anthropic forbids using one in OpenCode. Pick OpenCode if you want to choose, switch and pin models across 75+ providers, run local models, or pay $10–$40 a month for open models through OpenCode Go. On our 25-task real-PR benchmark, Claude Code with Opus 5 solved 23 tasks for $81.79 and OpenCode with GLM-5.2 solved 19 for $129.54. The models differ, so that measures harness plus model, not the harness alone.

OpenCode vs Claude Code: the quick verdict

Everything below was checked on October 2, 2026, against each vendor's docs, pricing pages and GitHub.

Claude CodeOpenCode
LicenseProprietary: "All rights reserved"MIT
ModelsClaude only, direct or through Bedrock, Google Cloud and Microsoft Foundry75+ providers via Models.dev; local Ollama, LM Studio and vLLM
Claude Pro/Max sign-inYes, that's what it's forNo. Anthropic prohibits it; use an API key or Zen
Other subscriptionsNoneChatGPT Plus/Pro, GitHub Copilot, GitLab Duo
Cheapest paid pathPro, $20/month ($17 billed annually)$0 plus provider rates; Go at $10/month
Heavy-use pathMax 5x $100, Max 20x $200Go Plus $40, or pay as you go
SurfacesTerminal, VS Code, JetBrains, desktop app, web, iOS/AndroidTerminal, desktop app, web UI (opencode pair), IDE terminal integration
Default permissionsAuto mode (v2.1.283+): a classifier reviews actions, no prompt; Manual mode, which prompts, for claude -pv2 allows everything except paths outside the workspace and .env reads
OS sandboxSeatbelt (macOS), bubblewrap (Linux, WSL2); off by default; none on native WindowsNone documented; shell runs with your user's rights
UndoCheckpoints for its file-edit tools, not BashSnapshots around every model step; needs a Git repo
Project instructionsCLAUDE.md; reads AGENTS.md when there's no CLAUDE.md (v2.1.277+)AGENTS.md (v2 dropped the CLAUDE.md fallback)
LSPVia code-intelligence pluginsBuilt in on v1; v2 doesn't run language servers
Releases, 30 days to Oct 226 (latest v2.1.287)8 v1.18.x releases, plus 23 v2 tags since Sep 11
GitHub stars, Oct 2148,912211,389

Sources: Claude Code overview, cloud providers, permission modes, permissions, sandboxing, checkpointing, memory and LICENSE.md; claude.com pricing; OpenCode homepage, providers (v1), IDE, v2 install, v2 providers, v2 permissions, v2 snapshots and v2 migration guide; release and star counts from the GitHub API for anthropics/claude-code and anomalyco/opencode.

Choose Claude Code if:

  • Opus or Fable is the model you want, and you'd spend more than about $100 a month on it at API rates. Max is the cheaper way to buy it.
  • You want a check on by default: a classifier that reviews shell commands and network requests before they run, plus an OS sandbox one command away.
  • Your day moves between terminal, JetBrains, the desktop app and your phone.
  • Your company already buys Claude through Bedrock, Google Cloud or Foundry.

Choose OpenCode if:

  • You want GLM, Kimi, DeepSeek, Qwen, GPT or a local model, switchable per task.
  • You need to read, patch or fork the harness itself.
  • You want a fixed $10–$40 bill for open models, with per-model limits published in dollars.
  • You already pay for ChatGPT Plus/Pro or Copilot and want to spend it in a terminal agent.

Can OpenCode use your Claude Pro or Max subscription?

No. Anthropic's Claude Code legal and compliance page reserves subscription OAuth for Claude Code and Anthropic's own apps, and says third-party developers may not "route requests through Free, Pro, or Max plan credentials on behalf of their users." OpenCode's providers documentation says the same from its side: community plugins exist, "Anthropic explicitly prohibits this," and OpenCode stopped bundling them as of 1.3.0.

The sequence, from the primary records:

  • January 9, 2026: issue #7410, "Broken Claude Max", is filed against OpenCode 1.1.8 when subscription calls start failing.
  • March 19, 2026: PR #18186, titled "anthropic legal requests", is merged. It removes the built-in opencode-anthropic-auth plugin and the Anthropic-specific prompt file; 1.3.0, released March 22, is the first version without them.
  • Now: the legal page adds that Anthropic may enforce the rule "without prior notice." Community plugins that restore subscription sign-in still exist; using one breaks Anthropic's terms for your Claude account, whatever the tool allows.

What still works is paying per token. An Anthropic API key in OpenCode bills at list price, and OpenCode Zen resells Claude at the same list price (Opus 5.5 at $4 per million input tokens, $20 output, $0.20 cached reads), passing card fees through at 4.4% + $0.30 per transaction.

Decision rule: if Claude is your main model, the subscription is the cheap way to buy it, and the subscription only works in Claude Code. Anthropic's cost guide puts enterprise deployments at $150–250 per developer per month on average, above Max 5x's $100. Max still caps usage by five-hour window and week; our Claude Code rate limits breakdown covers what that feels like in practice.

Can Claude Code run GLM, DeepSeek or local models?

Technically yes, officially no. Claude Code sends requests to $ANTHROPIC_BASE_URL/v1/messages with ANTHROPIC_AUTH_TOKEN as a bearer token (gateway setup docs), so any endpoint that speaks Anthropic's Messages format can answer. OpenCode Go serves MiniMax and Qwen models on exactly such an endpoint and lists Claude Code as a validated client (Go docs).

  • Support. Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway" (LLM gateways page).
  • Features. With a non-Anthropic base URL, MCP tool search is off by default, so tool definitions are no longer deferred, and Remote Control is disabled since v2.1.196 (environment variables reference).
  • Billing. A gateway credential replaces your subscription login, and the traffic bills per token to whoever owns that credential.

Decision rule: Claude Code on DeepSeek, GLM or a local model behind an Anthropic-compatible endpoint is fine for an afternoon's experiment. If non-Claude models are your default, use a harness that supports them on purpose.

What does each cost per month?

Claude Code costs a subscription or per-token API spend. OpenCode costs nothing itself; you pay a model provider, OpenCode's Zen gateway, or a Go subscription. Prices checked October 2, 2026.

OptionPriceWhat it buysWatch for
Claude Pro$20/month, or $17/month billed annuallyClaude Code plus chat; Opus, Sonnet, HaikuFive-hour windows plus weekly limits, one pool shared with chat
Claude Max 5x / 20x$100 / $200, monthly billing only5x or 20x Pro's usage per five-hour windowPast the limit, usage credits bill at API rates
Anthropic API keyOpus 5.5 $4 in / $20 out; Sonnet 5.5 $2 / $10No windows; per-token billingAnthropic's enterprise average: about $13 per developer per active day
OpenCode + your own keys$0 + provider ratesAny of 75+ providers, or local modelsCaching and tool-calling quality vary by provider
OpenCode ZenPay as you go at listed ratesCurated models, including Claude, GPT, GLM, Kimi; a few free modelsCard fees passed through at cost
OpenCode Go / Go Plus$10 / $40 per monthA dollar allowance per model, e.g. GLM-5.3 $15 / $120, DeepSeek V4.1 Flash $60 / $120Five-hour cap is 20% of the monthly allowance, weekly cap 50%; one subscriber per workspace

Sources: claude.com pricing, Max plan help article, Claude Code cost guide, OpenCode Zen, OpenCode Go.

Worked example: which Go plan? Go Plus multiplies your allowance by a different factor per model. For GLM-5.3 it's $120 against Go's $15: eight times the allowance for four times the price, or about 1,760 requests per five hours instead of 220 by OpenCode's own estimate. For DeepSeek V4.1 Flash it's $120 against $60, only twice the allowance. So Go Plus pays off when your main model is GLM-5.3 (8×) or Kimi K3, Grok 4.7, GPT 6 Luna and DeepSeek V4 Pro (4×), and least when it's DeepSeek V4.1 Flash, MiMo-V2.6-Flash or Muse Spark (2×). When a cap hits, Go can fall back to your Zen balance if you enable that in the console.

The same math isn't possible for Claude plans. Anthropic's pricing FAQ says there's "no fixed message count," so you learn your ceiling by hitting it.

Which one solves more real tasks? Claude Code vs OpenCode on 25 real PRs

On our run, Claude Code with Opus 5 solved four more tasks and paid less per solved task; OpenCode with GLM-5.2 was cheaper and faster on a typical task, but three tasks ate more than half its bill. We make Octomind, and octobench is our benchmark: 25 tasks from pull requests merged in 2026 across five languages, graded by each project's own held-out tests (methodology).

Agent + model (run of 2026-07-30)SolvedJudge total /2500Total costWall timeCost per solved task
Claude Code + claude-opus-523/252262$81.796.7h$3.56
OpenCode + glm-5.219/252093$129.543.3h$6.82

What the per-case table at the pinned octobench commit adds (our counts):

  • No OpenCode-only wins. OpenCode solved nothing Claude Code missed. Claude Code solved four tasks OpenCode failed: two yaml-cpp cases, guzzle's cookie prefixes and anyio's IDNA 2008 handling. Both failed pino-pretty's control-character stripping and commonmark's fence tabs.
  • OpenCode's median task was cheaper. $1.80 and 7 minutes against $2.46 and 9 minutes; OpenCode was cheaper on 11 of 25 tasks.
  • Three tasks made OpenCode's bill. carbon's period-end sync ($43.06), a fastify feature ($16.62) and a symfony JSONPath fix ($11.52) were 55% of its $129.54. Claude Code's worst was the same carbon task: $15.31, but 164 minutes.

Read it with the caveats on. The models differ. GLM-5.2 ran through Ollama cloud with no prompt caching, re-buying its whole context at $1.40 per million every turn, while Opus billed about 97% of its context re-reads at $0.50 per million; the benchmark notes say a cache-enabled endpoint would shrink GLM's input bill several fold (Go lists GLM-5.2 cached reads at $0.26 per million).

Both agents ran with prompts off inside Docker (claude -p --output-format stream-json --dangerously-skip-permissions and opencode run --auto --format json). We ran it on July 30; our hub has since retired GLM-5.2 for GLM-5.3, though OpenCode Go still lists it. And 25 tasks is a small sample.

The harness alone shows up when the model is fixed. In the same run, OpenCode and Octomind used one model, endpoint and price list, and OpenCode pushed 30M input tokens through one task where Octomind needed 8M; the full same-model comparison is in Octomind vs OpenCode. On a separate, stricter 50-task set, our DeepSeek V4 Flash rerun, OpenCode solved 43 of 50 at about $0.031 a task, to Octomind's 45; we called that model "strong enough to be harness-neutral."

Decision rule: in OpenCode, measure cost per solved task for two or three models on your own repository before committing to a plan.

Which is safer by default?

Claude Code checks actions by default; OpenCode v2 doesn't. Since v2.1.283, interactive terminal and VS Code sessions start in auto mode: no routine prompts, but a background classifier checks shell commands and network requests against your request before they run (permission modes). On earlier versions auto was the start only on Pro, Max and Team. Manual mode, which prompts for shell commands outside a built-in read-only set and for file edits (permissions docs), is the start for claude -p and the Agent SDK, and whenever auto mode is unavailable or turned off.

Either is stricter than OpenCode v2's base policy, which allows every action and only asks for paths outside the workspace and for .env reads; its docs warn the shell tool has "the host user's filesystem, process, and network authority" (v2 permissions).

To set OpenCode permissions so v2 asks before shell commands but lets read-only Git through, add ordered rules to opencode.jsonc. The last match wins (from the v2 docs):

jsonc
{
	"$schema": "https://opencode.ai/config.json",
	"permissions": [
		{ "action": "shell", "resource": "*", "effect": "ask" },
		{ "action": "shell", "resource": "git status *", "effect": "allow" },
		{ "action": "shell", "resource": "git push *", "effect": "deny" }
	]
}

On v1.18.x the same idea uses the older permission object with a bash key (v1 permissions).

In Claude Code, put allow and deny rules in .claude/settings.json and turn on the OS sandbox. Run /sandbox or set sandbox.enabled to true (sandboxing docs):

json
{
	"permissions": {
		"allow": ["Bash(npm run *)", "Bash(git commit *)"],
		"deny": ["Bash(git push *)"]
	},
	"sandbox": { "enabled": true }
}

Two limits apply to the Claude Code sandbox: it "covers shell commands only," so file tools, MCP servers and hooks run outside it, and native Windows runs commands unsandboxed (use WSL2).

Undo works differently. Claude Code's checkpoints track only its own file-edit tools; a file removed by rm through Bash can't be rewound. OpenCode's snapshots compare the session's directory before and after each model step, so files changed through the shell can be restored too, but only inside a Git repository and on a best-effort basis. Neither reverses database writes, pushes or other side effects.

Both have shipped security fixes this year, of different kinds. The anthropics/claude-code repository lists 19 advisories published in 2026, 13 rated high, and 13 of the 19 are ways around its own approval prompts, trust dialog or sandbox, such as a sandbox escape through Git worktree paths fixed in 2.1.163.

OpenCode lists three, all in its local HTTP server or web UI: CVE-2026-22812, an unauthenticated server that could run shell commands (fixed in 1.0.216); CVE-2026-22813, command execution through the web UI (fixed in 1.1.10); and GHSA-632h-h47v-g4x4 on September 24, where a web page could install packages through opencode serve on npm, pnpm or Bun installs (fixed in 1.18.22).

Decision rule: treat prompts and the sandbox as a second layer, not the boundary. For unattended runs, put either agent in a container or VM, which is also what Anthropic's docs say about bypassPermissions. If you run opencode serve, be on 1.18.22 or later.

What carries over if you switch, and what OpenCode v2 broke

AGENTS.md is the one file both read without conversion; almost everything else needs translating. OpenCode v2 adds a second translation inside OpenCode itself. Its migration guide lists three intentional breaking changes (plugin API, server API, terminal config) and several dropped behaviors.

Claude CodeOpenCode 1.18.xOpenCode 2.0
InstructionsCLAUDE.md; AGENTS.md when no CLAUDE.md existsAGENTS.md; falls back to CLAUDE.md and ~/.claude/skillsAGENTS.md only
Permission syntaxpermissions.allow / deny with Bash(...) rulespermission object keyed by tool (bash)Ordered permissions array (shell)
MCP.mcp.json or claude mcp add; tools deferred via tool searchmcp objectmcp.servers; tools go through Code Mode by default
LSPCode-intelligence pluginsBuilt-in servers for popular languages, many auto-installedConfig accepted, but no language servers run
PluginsMarketplace plugins: skills, agents, hooks, MCP serversJavaScript/TypeScript modulesNew plugin API; v1 plugins don't run
Built-in subagentsExplore, Plan, general-purpose; custom ones in .claude/agents/General, Explore, ScoutGeneral, Explore

Sources: Claude Code memory docs, MCP docs, subagents docs, plugins docs, cost guide (code-intelligence plugins), OpenCode rules (v1), OpenCode LSP (v1), v2 instructions, v2 agents, v2 MCP.

Practical moves:

  • Keep instructions in AGENTS.md. With a CLAUDE.md present, Claude Code skips AGENTS.md by default; switch the Project instructions option in /config to claude-md-and-agents-md to load both.
  • Moving to Claude Code: /import (v2.1.213+) copies a supported agent's instruction files, MCP servers, commands, subagents and skills in one pass.
  • Moving to OpenCode v2: the docs suggest asking OpenCode itself to convert your config; v1 syntax keeps working meanwhile. v1 and v2 read the same config files, so keep a copy of the v1 setup until v2 checks out.
  • Stay on v1.18.x for now if you rely on LSP diagnostics, the CLAUDE.md fallback, or the instructions array in opencode.json, which v2 accepts but doesn't load yet.

Where Octomind fits

Octomind is ours, so weigh this accordingly. It sits on OpenCode's side of the line, Apache 2.0 and any model by provider:model, but puts its effort into context discipline and supervision: structural code search instead of grep-and-read, and a supervisor that checks whether a task is actually done. In the same 25-task run, Octomind with glm-5.2, on the same uncached endpoint OpenCode used, solved 24 of 25 for $63.43 in 3.6 hours. That run used a staged tap and a binary with an unfinished-handback check, so it measures our full setup, not a stock install.

bash
octomind run developer:general -m deepseek:deepseek-v4-flash

-m swaps only the conversation model; the supervisor and compression models stay on the shipped config until you repoint them.

It isn't a drop-in for either tool. It's a plain-line CLI with no TUI. Instead of approval prompts it enforces policy from .agents/guardrails.toml before tool calls, after results and after each turn, and its --sandbox flag restricts writes to the working directory while reads stay open. Anonymous usage telemetry is on by default; DO_NOT_TRACK=1 turns it off.

Where each one loses (honest version)

  • Claude Code: one vendor's models, on limits Anthropic may tighten "at our discretion," per its pricing FAQ. The harness is closed, and native installs update themselves; you can pin a model ID, but harness behavior moves with each release unless you use the Homebrew stable cask, which runs about a week behind. Non-Claude models are unsupported.
  • OpenCode: permissive defaults, three advisories in 2026 on its local server and web UI, and a v2 transition that dropped LSP, the CLAUDE.md fallback and v1 plugins. On our same-model A/B it used 30M input tokens on a task where Octomind used 8M. Go traffic is monitored for abuse, and only one member per workspace can subscribe.
  • Octomind: no TUI and no VS Code extension; editor support is Zed and JetBrains over ACP, plus a Neovim plugin. Its benchmark lead comes from our own benchmark, and its sandbox limits writes, not reads.

Get Octomind: the open-source, any-model harness that solved 24 of 25 in the same real-PR run.

FAQ

Can I use my Claude Pro or Max subscription in OpenCode?

No. Anthropic's terms reserve subscription sign-in for Claude Code and Anthropic's own apps, and OpenCode removed its built-in Claude subscription plugin in March 2026 after legal requests. You can still use Claude in OpenCode with an Anthropic API key or through OpenCode Zen, both billed per token at list price.

Is OpenCode free?

The OpenCode software is free and MIT-licensed. You pay for models: directly to a provider, pay-as-you-go through OpenCode Zen, or by subscribing to OpenCode Go ($10/month) or Go Plus ($40/month), which include dollar allowances per open model. Zen also lists a handful of free models, and local models through Ollama, LM Studio or vLLM cost only your hardware.

Can Claude Code use GLM, DeepSeek or other non-Claude models?

Only unofficially. Pointing ANTHROPIC_BASE_URL at an Anthropic-compatible endpoint works, and OpenCode Go lists Claude Code as a validated client, but Anthropic doesn't support non-Claude models in Claude Code. MCP tool search and Remote Control turn off, and the traffic bills per token instead of against your subscription.

Is Claude Code better than OpenCode?

On our 25 real-PR tasks, Claude Code with Opus 5 solved 23 for $81.79 and OpenCode with GLM-5.2 solved 19 for $129.54, on an uncached endpoint. Claude Code is the better pick for Claude models at subscription prices and for stricter defaults. OpenCode is better for model choice, local models and an open-source harness you can change.

Should I upgrade to OpenCode v2?

Upgrade if your setup is plain config, AGENTS.md, MCP servers and agents, which v2 reads as-is. Wait if you depend on LSP diagnostics, a CLAUDE.md fallback, or v1 plugins: v2 doesn't run language servers, reads only AGENTS.md, and needs plugins ported to its new API.