← Blog

OpenCode vs Claude Code: Open Source or First-Party?

October 5, 2026

AI CodingTool Comparisons

OpenCode and Claude Code look alike for the first five minutes: a terminal interface, a prompt box, an agent that reads your files and runs commands. The difference sits underneath. This OpenCode vs Claude Code comparison is really a choice between two designs.

OpenCode is an open source harness that treats the model as a setting. Claude Code is Anthropic's own harness, built around Claude.

  • Pick OpenCode if you want to switch providers, run a local model, or read and fork the source.
  • Pick Claude Code if you want Anthropic's first-party experience: its cloud sessions, desktop app, and sandbox, with the models it is built for.
  • You can run both against the same repository, and we show below why that is easy.

One catch gets its own section, because it decides whether OpenCode can replace Claude Code for people who pay for a Claude subscription.

Quick comparison

OpenCodeClaude Code
SourceOpen source, MIT licenceNot open source, all rights reserved
Models75+ providers via Models.dev, plus local modelsClaude models
Where you reach the modelAny configured providerAnthropic, Amazon Bedrock, Google Cloud, Microsoft Foundry
SurfacesTerminal UI, desktop app, IDE extension, browser UITerminal, VS Code, JetBrains, desktop app, web
AgentsPrimary agents and subagents, custom ones in configSubagents with their own context windows
PermissionsAllow, ask, or deny rules per tool and patternPermission modes, rules, optional OS-level sandbox
MCPLocal and remote serversYes
Claude subscription loginDocs say Anthropic prohibits itSupported, it is Anthropic's own client

Open source against first-party

OpenCode's code lives in the anomalyco/opencode repository. Older links to sst/opencode still redirect there, so the project moved but is the same one. The LICENSE file is the MIT licence, and so are the LICENSE files in the repo's other packages. You can read how the agent builds its prompts, fork it, and patch it.

Claude Code has a public GitHub repository, but its LICENSE file says "All rights reserved" and points to Anthropic's Commercial Terms. You can read what the tool does in the documentation; you can't fork the agent. Our post on whether Claude is open source draws that line in detail.

Does that matter to you? For many teams it doesn't. It matters when you need to audit the agent, run it in an air-gapped environment, or fix a bug without waiting for a release.

Provider freedom is OpenCode's real pitch

OpenCode's models page says it uses the AI SDK and Models.dev to support 75+ LLM providers, and that it supports running local models. The providers page lists the major labs, the cloud platforms, and local servers such as Ollama, LM Studio, and llama.cpp. It also documents OpenCode Zen, a list of tested and verified models from the OpenCode team.

The freedom reaches down to individual agents. In OpenCode's agent config, each agent can have its own model, so you can plan with one provider's model and run a read-only exploring agent on a cheaper or local one. A single task can span several vendors.

Claude Code takes the opposite position. You choose among Claude models (the docs list aliases such as sonnet, opus and haiku), and you can reach them through Anthropic's API or through Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry. That gives you real procurement flexibility, since your cloud contract may already cover it. It does not give you other labs' models. Anthropic's gateway documentation states it plainly: Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway."

So "Claude-only" is accurate for the models and loose for the plumbing. If your reason to leave Claude Code is a model you can't get through it, only OpenCode-style tools solve that. For other open options, Claude Code alternatives compares the wider field.

Using a Claude subscription: the catch

This is the point people miss. If you pay for a Claude plan and expect OpenCode to run on it, read this first.

OpenCode's providers page has a note under Anthropic. It says there are plugins that let you use Claude Pro/Max models with OpenCode, and that "Anthropic explicitly prohibits this." Earlier OpenCode versions bundled those plugins; that is "no longer the case as of 1.3.0." The login screen the page shows offers a manual API key.

Anthropic's own terms point the same way. Its legal and compliance page says OAuth sign-in is intended for purchasers of Claude plans and is designed for ordinary use of Claude Code and other native Anthropic applications. It tells developers building their own products to use API key authentication, and says Anthropic does not permit routing requests through Free, Pro, or Max plan credentials on behalf of users.

One wrinkle: as of October 2026, the FAQ on OpenCode's homepage still lists Claude Pro/Max among the subscriptions you can use. The providers documentation says otherwise, and Anthropic's own terms agree with the documentation. Treat the docs and Anthropic's terms as the answer.

In practice, Claude models in OpenCode mean an API key (or a cloud provider), billed per token under your provider's terms. A Claude plan stays with Claude Code. OpenCode's docs name other subscriptions that do work without extra setup: ChatGPT Plus and Pro, GitHub Copilot, and GitLab Duo.

Agents, permissions, and MCP

Both tools have the same shape of building blocks, with different defaults.

OpenCodeClaude Code
Main agentsBuild (full tools) and Plan (restricted), switched with TabOne main session, with plan mode
SubagentsGeneral, Explore, and Scout built in, or your own in markdown filesBuilt-in and custom subagents, each with its own context window, tools, and permissions
Approval modelallow, ask, deny per tool, with pattern matchingModes from manual approval to auto mode, plus rules
IsolationRules decide what is approvedOptional OS-level sandbox for shell commands
InstructionsAGENTS.mdCLAUDE.md, and it can read AGENTS.md

Look at OpenCode's permissions page before you hand it a real repository. Rules resolve to allow, ask, or deny, and the last matching rule wins. The defaults are permissive: most permissions default to allow, while external_directory and doom_loop default to ask, and reads of most .env files are denied. Tighten it yourself, for example by setting bash to ask with git * allowed and rm * denied. It also has an --auto flag that approves everything not explicitly denied.

Claude Code's permission modes are a ladder: manual approval, accept-edits, plan, auto (where a second model reviews actions), a locked-down dontAsk for CI, and bypassPermissions for isolated containers. On top of that sits the Bash sandbox, which the operating system enforces on shell commands. The docs describe it as off by default, supported on macOS, Linux, and WSL2, and covering shell commands only. OpenCode's permissions documentation describes approval rules and doesn't describe an equivalent OS-level sandbox.

Neither is "safer" in the abstract. If you rely on rules, write them. If you rely on a sandbox, switch it on.

MCP works in both: OpenCode takes local and remote MCP servers in its config, and Claude Code connects to MCP servers too. OpenCode's own docs add a useful warning that applies to both: MCP servers add to your context, and some can exceed the context limit on their own.

Surfaces: where each one runs

OpenCode's docs describe it as available as a terminal interface, a desktop app, or an IDE extension. The repo README labels the desktop app beta. The IDE page names VS Code, Cursor, Windsurf, and VSCodium, and the extension installs when you run opencode in the editor's integrated terminal. There is also opencode web, a browser interface served from your own machine, and an opencode github command that runs it on GitHub issues and pull requests inside your Actions runner. OpenCode also now carries a v2 line of docs, so check which version you install.

Claude Code covers more first-party ground. It runs in the terminal, in VS Code, in a JetBrains plugin, in the desktop app, and on the web. Its cloud sessions run on Anthropic-managed infrastructure and keep going after you close your laptop. From a terminal you start one with claude --cloud and pull one down with claude --teleport. OpenCode's server mode (opencode serve plus opencode attach) is a different idea: you host the server yourself.

Both keep session history you can continue (--continue in each), and OpenCode adds share links that sync a conversation to its servers, so share only what you'd be comfortable making public.

Switching costs less than you'd expect

OpenCode's rules documentation has a section for people migrating from Claude Code. If a project has no AGENTS.md, OpenCode falls back to your CLAUDE.md, and it will load skills from ~/.claude/skills. Claude Code's memory docs say it can read a repository's AGENTS.md files too.

That makes a trial cheap. Point OpenCode at the repo you already use with Claude Code, connect a provider, and run the same task in both. Your instructions come along. Judge the output on your code rather than on published rankings, which age within months.

When Taku fits

Both tools assume you have a working development environment and enough context to judge what an agent did. The step before them is where many people stall: you watch someone share an agent setup that does exactly what you need, and you never get it running.

Taku works at that earlier step. It's an AI-native desktop workspace where you mirror an AI setup, app, or skill that someone already got working, run it, remix it, and keep it. It isn't a coding agent and doesn't compete with either of these; both are stronger when the job is changing a real codebase. Taku is in Beta, and the Mac app is available now.

Which one to use

Your situationStart with
Want to choose or switch model providersOpenCode
Want to run a local modelOpenCode
Need to read or fork the agent's sourceOpenCode
Pay for a Claude subscriptionClaude Code
Want cloud sessions and a desktop app from the model makerClaude Code
Want an OS-level sandbox for shell commandsClaude Code
Want a second opinion on a hard taskRun both

For a third option built around git commits, see Aider vs Claude Code. For the other big first-party agent, Claude Code vs Codex covers how similar the two have become.

FAQ

Is OpenCode the same project as the archived opencode-ai/opencode repository?

No. An older opencode-ai/opencode repository is archived, and its README says the project continued as Crush. The OpenCode in this comparison is the one at opencode.ai, whose repository is anomalyco/opencode.

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

OpenCode's providers documentation says Anthropic explicitly prohibits using those plans through plugins and that the bundled plugins were removed as of 1.3.0. Use an Anthropic API key or a cloud provider for Claude models in OpenCode, and keep your plan for Claude Code.

Can Claude Code use models from other labs?

Not as a supported setup. Anthropic's gateway documentation says it doesn't support routing Claude Code to non-Claude models through any gateway. You can reach Claude models through several providers, but the models stay Claude.

Is OpenCode free?

The software is open source under the MIT licence, so there is no licence fee. What you pay for is the model: the provider you connect bills you under its own terms, and a local model costs hardware instead. Claude Code needs a Claude plan or an Anthropic Console account, or a supported cloud provider.

Do my CLAUDE.md files and skills work in OpenCode?

Largely, yes. OpenCode's docs say it falls back to CLAUDE.md when no AGENTS.md exists and loads skills from .claude/skills and ~/.claude/skills. You can turn that off with an environment variable.

Which is better for a large repository?

It depends on the model and your code more than on the harness. Run the same task in each for a week on your own repository and compare the diffs and the review time.