Blog
OpenCode vs Claude Code: models, providers and pricing
How the open-source OpenCode agent and Anthropic's Claude Code compare on models, setup, safety defaults and cost, checked against both projects' docs.
Alex Mercer
OpenCode is an open-source coding agent that works with almost any model provider, while Claude Code is Anthropic's own agent and runs only Claude models. Choose OpenCode to pick or mix providers, run local models, or use a ChatGPT or GitHub Copilot subscription; choose Claude Code if you mainly use Claude on a Claude plan, since Anthropic says plan sign-in is designed to support Claude Code and its other native apps (legal and compliance).
Both read project instruction files, connect to MCP servers and load skills, and OpenCode reads Claude Code's files, so much of a setup carries over. Product details below come from each project's docs as of October 13, 2026. For more agents side by side, see our ranking of AI coding tools and agents on Bug Bench.
Feature lists don't show how the code turns out, so this comparison also uses Bug Bench, cubic's public benchmark of the bugs found in AI-written code during review. In the week of October 5, Claude Code wrote 78.1% of the AI-written code cubic reviewed and OpenCode 0.7%, and Bug Bench lists OpenCode as not ranked yet.
OpenCode vs Claude Code at a glance
OpenCode | Claude Code (Anthropic) | |
|---|---|---|
Where it runs | Terminal, desktop app, IDE extension, browser, GitHub Actions | CLI, VS Code and JetBrains, desktop app, web and mobile, Slack |
Models | 75+ providers through Models.dev, plus local models | Claude models only |
Subscriptions it accepts | ChatGPT Plus or Pro, GitHub Copilot, OpenCode Go | Claude Pro, Max, Team and Enterprise |
Pay per token | Any provider's API key, or OpenCode Zen credits | Claude Console API key, Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry |
Instruction file | AGENTS.md, falling back to CLAUDE.md | CLAUDE.md, or AGENTS.md when there is no CLAUDE.md |
Default permissions | Most actions allowed | Auto mode: a classifier model reviews actions |
MCP | Local and remote servers in |
|
License | MIT | All rights reserved |
What each one is and where it runs
OpenCode
OpenCode's docs call it "an open source AI coding agent," available as a terminal interface, a desktop app or an IDE extension. The code is on GitHub at anomalyco/opencode.
Terminal: install with the script from opencode.ai, npm (
opencode-ai), Bun, pnpm, Yarn, Homebrew, Arch packages, Chocolatey, Scoop, Mise or Docker. On Windows, the docs recommend WSL.IDE: run
opencodein the integrated terminal of VS Code, Cursor, Windsurf or VSCodium and the extension installs itself. Any editor with a terminal works too.Browser and server:
opencode webstarts a local server and opens the interface in your browser (web).opencode serveruns a headless HTTP server with an OpenAPI endpoint for other clients (server).GitHub: mention
/opencodeor/ocin an issue or pull request comment, and OpenCode runs the task in your GitHub Actions runner. For fixes, it works in a new branch and opens a pull request (GitHub).
Its home page also lists LSP support, several agents running in parallel on one project, and shareable session links, and says OpenCode "does not store any of your code or context data."
Claude Code
Claude Code runs on more surfaces, and most of them need a Claude subscription or a Console account:
CLI: macOS, Linux, WSL and Windows, through a native installer, Homebrew, WinGet, a Linux package manager or npm (setup).
IDEs: a VS Code extension, which also installs in Cursor, and a JetBrains plugin.
Desktop app: macOS and Windows, with a beta for Ubuntu and Debian.
Web and mobile: cloud sessions at claude.ai/code and in the Claude app for iOS and Android, plus Remote Control for steering a session on your own machine (platforms).
Integrations: Chrome, Slack, GitHub Actions and GitLab CI/CD.
Cloud sessions and mobile need a Claude subscription, and so does the desktop app outside some enterprise and gateway setups, per the feature availability page. The CLI, VS Code and JetBrains also work with third-party providers.
Models and providers
This is the biggest difference between the two.
OpenCode works with almost any provider
OpenCode uses the AI SDK and Models.dev "to support 75+ LLM providers," and it runs local models through tools such as Ollama and LM Studio (models, providers). You add a provider with /connect, pick a model with /models, and can set a default in opencode.json.
It also accepts two subscriptions directly: log in with OpenAI to use a ChatGPT Plus or Pro account, or with GitHub to use a Copilot account. OpenCode sells two optional services of its own:
OpenCode Zen: a gateway to models the OpenCode team has tested, charged per request from credits you add. Its list includes Claude, GPT and Gemini models, among them Claude Opus 5.5 and GPT 5.6 Sol.
OpenCode Go: a monthly subscription with two tiers, Go and Go Plus, for open coding models from families such as GLM, Kimi, DeepSeek, Qwen and MiniMax.
You don't need either one to use OpenCode.
Claude Code runs Claude models
Claude Code runs Anthropic's models only. On the Anthropic API, the opus alias points to Opus 5.5 and sonnet to Sonnet 5.5, and Anthropic calls Fable 5.1 and Fable 5 "the most capable models in Claude Code" (model configuration). Besides a Claude plan or a Console API key, it runs through Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS, where the aliases can point to older versions.
Claude plans and OpenCode
You can use Claude models in OpenCode with an Anthropic API key or through a provider that serves them, such as Zen. On Claude plans, Anthropic's legal and compliance page says Claude Code's OAuth sign-in "is intended exclusively for purchasers of Claude Free, Pro, Max, Team, and Enterprise subscription plans and is designed to support ordinary use of Claude Code and other native Anthropic applications." It also says Anthropic does not permit third-party developers "to offer Claude.ai login into their own applications, or to route requests through Free, Pro, or Max plan credentials on behalf of their users."
Rules files and configuration
Both tools read a Markdown file of project instructions, and OpenCode also reads Claude Code's.
OpenCode reads AGENTS.md. Running /init scans the repo and creates one, or improves the one you have (rules). Global rules go in ~/.config/opencode/AGENTS.md. For people coming from Claude Code, it falls back to a project CLAUDE.md when there is no AGENTS.md, to ~/.claude/CLAUDE.md when there are no global rules, and it loads skills from ~/.claude/skills. The instructions field in opencode.json adds more files, including globs such as .cursor/rules/*.md and remote URLs.
Settings live in opencode.json or opencode.jsonc. OpenCode layers an organization's remote config, your global config and the project config, with later layers overriding earlier ones, and managed settings override all of them (config).
Claude Code reads CLAUDE.md files at the organization, user, project and local (CLAUDE.local.md) levels, with @path imports (memory). Since v2.1.277 it also reads AGENTS.md, but by default only when there is no CLAUDE.md in the working directory or above it. The Project instructions setting changes that, for example to read both.
A repo with one AGENTS.md and no project CLAUDE.md gives both tools the same rules on current versions. Our guide to CLAUDE.md and AGENTS.md covers what to put in the file. Rules only state what you want, though; how to configure coding agents that follow your team's standards covers checking that the code follows them.
MCP, skills and agents
Both support the same building blocks, configured differently.
OpenCode | Claude Code | |
|---|---|---|
MCP servers | Local and remote servers under |
|
Skills |
|
|
Agents | Build and Plan primary agents, switched with Tab; General, Explore and Scout subagents; custom agents (docs) | Plan mode; built-in subagents such as Explore and Plan; custom subagents (docs) |
Packaging | Agents, commands, plugins, skills and tools in | Plugins that bundle skills, agents, hooks and MCP servers, installed from marketplaces (docs) |
OpenCode's docs warn that each MCP server adds to the context, and that some, like the GitHub MCP server, "tend to add a lot of tokens."
Permissions and safety defaults
The two start from opposite ends.
OpenCode starts permissive. With no permission block, OpenCode "starts from permissive defaults," and most permissions are set to allow (permissions). Two checks ask first: touching paths outside the working directory, and the same tool call repeating three times with identical input. Reading .env files is denied. You can set allow, ask or deny per tool with patterns, such as "git *": "allow" and "rm *": "deny". The built-in Plan agent asks before every edit and shell command, and opencode --auto approves anything that isn't explicitly denied.
Claude Code starts with a second model checking. Since v2.1.283, interactive terminal and VS Code sessions start in auto mode, where "a second model, the classifier, reviews actions instead of you" (permission modes). Manual mode asks before most edits, shell commands and network requests. Deny rules block in every mode. An OS-level sandbox for shell commands exists but is off by default; /sandbox turns it on, and on native Windows it needs WSL2 (sandboxing).
A team adopting OpenCode should commit a permission block to the project's opencode.json before anyone points it at a real repository.
Pricing
OpenCode is free software under the MIT license (license). You pay whoever runs the model:
your own API keys, billed by each provider
a ChatGPT Plus or Pro, or GitHub Copilot, subscription
OpenCode Zen credits, charged per request
an OpenCode Go or Go Plus subscription, priced on the Go page
nothing extra for local models, beyond your own hardware
Claude Code "is included in all paid plans," per Anthropic's pricing page: Pro, Max, Team and Enterprise. It "shares the same usage limits as the rest of your plan," so terminal work and chats draw from one pool. For heavy use you can switch to pay-as-you-go API credits through a Console account, or pay through a cloud provider.
Which is cheaper depends on volume. A plan has a fixed price and usage limits, while API keys bill every token.
What Bug Bench shows
How the data works
Counted bug: a cubic review finding on AI-written code that a developer upvoted or an AI coding agent addressed.
Relative bug rate: counted bugs per AI-attributed line, divided by the rate across all AI-attributed lines in the window. 1.00 is average, and lower is better.
Statistically tied: the two models' 95% confidence intervals overlap, so neither is clearly ahead.
Bug Bench is observational, not causal. Teams choose their models, so a rate reflects the code each model was used for as well as the model. Agent shares describe the code in Bug Bench's data, not the whole market.
OpenCode is in the data, but not ranked yet
Bug Bench's coding agents page lists OpenCode at 0.7% of AI-written code in the week of October 5, marked "Not ranked yet." There is no published bug rate for any model used inside OpenCode.
Claude Code wrote 78.1% in the week of October 5, up from 64.8% in the week of June 22.
Inside Claude Code, the model matters
Model, used in Claude Code | Relative bug rate | Statistically tied with | In Bug Bench since |
|---|---|---|---|
Claude Fable 5.1 | 1.09 | Claude Sonnet 5.5 | week of Aug 31 |
Claude Sonnet 5.5 | 1.24 | Claude Fable 5.1, Claude Opus 5 | week of Sep 28 |
Claude Opus 5 | 1.33 | Claude Sonnet 5.5 | week of Jul 20 |
Claude Opus 5.5 | 1.49 | none | week of Sep 21 |
Inside Claude Code, Fable 5.1 had 9% more counted bugs than the all-model average and is statistically tied with Sonnet 5.5. Opus 5.5, the model the opus alias points to on the Anthropic API, had 49% more. Across all agents, Sonnet 5.5 had 15% fewer counted bugs per line than Opus 5.5 (1.27 vs 1.50). Sonnet 5.5 and Opus 5.5 are new to Bug Bench, so their rates rest on two and three weeks of data.
What it means for OpenCode users
Bug Bench has no rates inside OpenCode, but its overall ranking covers models OpenCode can run. GPT-5.6 Sol is first of seven ranked models at 0.65, on data since the week of July 6, and it's on OpenCode Zen's list. Claude Fable 5.1 is second at 1.09, statistically tied with GPT-6 Astra, GPT-6.1 Sol and Claude Sonnet 5.5.
Those rates come almost entirely from code written through other agents. In the week of October 5, Claude Code, Codex and Cursor together wrote 98.5% of the AI code in the data. Whether OpenCode's own prompts and tools raise or lower a model's rate is something Bug Bench can't show yet.
Which one to use
You want to choose the model, or switch providers: OpenCode, with 75+ providers and local models.
You pay for Claude Pro or Max: Claude Code. Anthropic says plan sign-in is designed to support Claude Code and its other native apps.
You already pay for ChatGPT Plus or Pro, or GitHub Copilot: OpenCode can use those subscriptions.
You want to run models locally: OpenCode, through Ollama or LM Studio.
You want an agent you can read and fork: OpenCode is MIT-licensed. Claude Code's license reads "All rights reserved."
You want cloud sessions, a phone app or Slack: Claude Code.
You want guarded defaults without writing config: Claude Code starts in auto mode, while OpenCode needs a
permissionblock.Your team uses both: keep one
AGENTS.mdand put shared skills in.claude/skills, which both tools read.
The same trade-offs against OpenAI's and Google's agents are in Codex vs Claude Code and Gemini CLI vs Claude Code.
Whichever agent writes the code, review it before it merges. On GitHub, cubic reviews pull requests, finds bugs and learns your team's rules. The AI code review guide explains the approach, and how successful teams ship AI-generated code to production covers the process around it.
FAQ
Can I use Claude Code in OpenCode?
No, they are separate agents. You can run Claude models in OpenCode with an Anthropic API key or through OpenCode Zen. On Claude plans, Anthropic's legal and compliance page says sign-in is designed to support Claude Code and its other native apps, and that third-party developers may not route requests through Free, Pro, or Max plan credentials on behalf of their users. Parts of a Claude Code setup do carry over, since OpenCode reads CLAUDE.md and .claude/skills.
Is OpenCode as good as Claude Code?
Bug Bench can't say yet, since it doesn't rank models inside OpenCode or compare agents directly. On features, OpenCode covers the same basics (rules files, MCP servers, skills and subagents) and adds 75+ providers, local models and an MIT license. The software is free, so trying it costs only model usage. The trade-offs are permissive defaults you should tighten, and paying for Claude models through an API key or Zen rather than a Claude plan.
Is there anything better than Claude Code?
Bug Bench doesn't rank agents against each other, only models inside each agent. Inside Claude Code, Claude Fable 5.1 had the lowest relative bug rate, 1.09, statistically tied with Claude Sonnet 5.5. Across all agents, GPT-5.6 Sol ranks first at 0.65; Claude Code doesn't run it, while Codex and OpenCode can. Bug Bench has no rates inside OpenCode yet.
Which is better for coding, OpenAI or Claude?
On Bug Bench's ranking of seven models, OpenAI's GPT-5.6 Sol is first at 0.65, followed by Claude Fable 5.1 at 1.09, GPT-6 Astra at 1.13, GPT-6.1 Sol at 1.23 and Claude Sonnet 5.5 at 1.27, which are all statistically tied with each other. Further down, Claude Opus 5 is at 1.33 and Claude Opus 5.5 at 1.50. Sonnet 5.5 and GPT-6.1 Sol are ranked on two weeks of data and Opus 5.5 on three. OpenCode can run models from both companies, while Claude Code runs only Claude.
