OpenCode vs Claude Code: Open Source or Paid Agent?

OpenCode vs Claude Code compared: features, models, cost, skills and MCP, plus what Anthropic's terms say about using a Claude subscription inside OpenCode.

Josh Pocock7 min read

Claude Code vs OpenCode cover

AI Coding

Claude Code vs OpenCode

Stride AI Academy

OpenCode vs Claude Code comes down to one choice: an open-source agent that works with many model providers, or Anthropic's own agent built around Claude models and Claude plans. OpenCode is free, MIT licensed and lets you bring almost any provider. Claude Code comes with a Claude Pro or higher plan, or bills to an API key. If you want to use a Claude subscription, Claude Code is the tool Anthropic's terms are written for.

This comparison covers where each runs, which models they support, what they cost, how skills, MCP and instruction files work in each, and the subscription question. Everything here was checked on November 22, 2026 against OpenCode's docs, OpenCode providers, OpenCode Go, OpenCode skills, OpenCode MCP servers, OpenCode rules, the OpenCode repo, Claude's pricing page, Claude Code's legal and compliance page, Claude Code skills, Claude Code MCP and Anthropic's Consumer Terms.

Quick comparison

Claude Code OpenCode
Made by Anthropic Open-source project
License Anthropic's Consumer or Commercial Terms MIT
Interfaces Terminal, VS Code and JetBrains, desktop app, web Terminal, desktop app, web app
Models Claude models (Anthropic API or a supported cloud provider) Many providers from the models.dev catalog
How you pay Claude plan (Pro and up) or API key Free tool; you pay your model provider, or OpenCode Go
Instructions file CLAUDE.md AGENTS.md, falls back to CLAUDE.md
Skills .claude/skills .opencode/skills, plus .claude/skills and .agents/skills
MCP claude mcp add, .mcp.json opencode mcp add, opencode.json
Built-in modes Plan mode, subagents build and plan agents

What each tool is

Claude Code is Anthropic's coding agent. It reads your project, edits files and runs commands, and it runs in the terminal, IDE extensions, the desktop app and the web. Our Claude Code guide covers the basics.

OpenCode calls itself an open source coding agent. Its docs say it's available as a terminal interface, desktop app or web app, and the repo lists an MIT license. The README describes two built-in agents: build, the default with full access, and plan, a read-only agent for analysis that denies file edits by default.

Installing each

Claude Code on macOS, Linux or WSL:

Terminal
curl -fsSL https://claude.ai/install.sh | bash

OpenCode lists several install methods. Two of them:

Terminal
curl -fsSL https://opencode.ai/v2/install | bash
npm install -g @opencode/cli

OpenCode's docs also offer desktop installers for macOS, Windows and Linux, and note that Windows package managers aren't supported for the CLI.

Models

Claude Code runs Claude models. You can reach them through Anthropic directly or, per Anthropic's legal page, through cloud providers such as Amazon Bedrock, Google Cloud and Microsoft Foundry. On November 22, 2026, the current models are Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5 (models overview), and Anthropic's docs suggest starting with Opus 5.5 for most work.

OpenCode is provider-agnostic. Its providers page says it includes a provider and model catalog from models.dev. You run /connect, choose a provider, enter its credentials and then pick a model with /models. The page lists other sign-in methods for some providers, including ChatGPT sign-in, GitHub Copilot device OAuth and Azure CLI or Entra ID. You can also point a provider at a proxy or compatible endpoint with settings.baseURL.

So if you want to mix models, try open-weight models or keep one agent across several providers, OpenCode gives you that. If you plan to use Claude models anyway, Claude Code is Anthropic's own agent for them and works with your Claude plan.

Cost

Claude Code comes with Claude plans from Pro up, per Claude's pricing page. On November 22, 2026:

Plan Price Claude Code
Free $0 Not included
Pro $20/month, or $17/month billed yearly Included, 1x usage
Max $100/month Included, 5x Pro
Ultra $200/month Included, 10x Pro weekly

You can also pay per token with an API key. Opus 5.5 is $4 per million input tokens and $20 per million output, and Sonnet 5.5 is $2 and $10 (API pricing). For the full breakdown, see how much Claude Code costs.

OpenCode itself costs nothing. You pay whichever provider you connect at their rates. OpenCode also sells an optional subscription, OpenCode Go, which its docs describe as access to popular open coding models:

OpenCode Go plan Price
Go $10/month
Go Plus $40/month, higher limits
Go Teams $20/member/month, 2-member minimum

Go has a five-hour limit (20% of your monthly allowance) and a weekly limit (50%), and can fall back to a pay-as-you-go balance once you hit them. The docs say you don't need Go to use OpenCode.

Can OpenCode use a Claude subscription?

This is the question most people searching OpenCode vs Claude Code want answered. Here's what each source says on November 22, 2026, without guessing past it.

Anthropic's Claude Code legal page says OAuth sign-in is intended for Claude plan subscribers and is designed for ordinary use of Claude Code and other native Anthropic apps. It says developers building products should use API keys from the Claude Console or a supported cloud provider. It also says Anthropic doesn't permit third-party developers to offer Claude.ai login in their own apps, or to route requests through Free, Pro, Max or Ultra credentials on behalf of their users, and that Anthropic may enforce this without notice.

Anthropic's Consumer Terms (effective October 8, 2025) bar accessing the services through automated or non-human means, "except when you are accessing our Services via an Anthropic API Key or where we otherwise explicitly permit it."

OpenCode's providers page doesn't mention a Claude Pro or Max login at all. It lists API-key setup through /connect, and names ChatGPT sign-in, GitHub Copilot and Azure as providers with other sign-in methods.

What that means in practice:

  • To use Claude models in OpenCode, connect an Anthropic API key, or a cloud provider account that offers Claude models. That's billed per token, not against your Claude plan.
  • To use your Claude plan, use Claude Code. Usage there counts against the same limits as chat.
  • Third-party plugins that add a Claude subscription login to other tools exist outside OpenCode's docs. Read Anthropic's terms above before relying on one. If you're unsure about your own case, the legal page points you to Anthropic's sales team.

Skills

Both tools use SKILL.md skills that the model loads when a task matches. Claude Code reads .claude/skills/<name>/SKILL.md in a project and ~/.claude/skills for all projects.

OpenCode reads its own .opencode/skills and ~/.config/opencode/skills, and also .claude/skills and .agents/skills. So skills written for Claude Code mostly appear in OpenCode unchanged. Claude Code-only fields, such as forking a skill into a subagent, aren't in OpenCode's docs. Our OpenCode skills guide covers paths, frontmatter and permissions in detail.

MCP servers

Both support MCP for local and remote servers.

Claude Code:

Terminal
claude mcp add --transport http context7 https://mcp.context7.com/mcp
claude mcp list

OpenCode:

Terminal
opencode mcp add context7 --url https://mcp.context7.com/mcp
opencode mcp list

Claude Code stores project servers in .mcp.json, and user or local servers in ~/.claude.json. OpenCode stores them under mcp.servers in opencode.json, uses OAuth for remote servers unless you set oauth: false, and lets you keep a server configured but off with "disabled": true.

Instruction files

Claude Code reads CLAUDE.md. OpenCode reads AGENTS.md, and in any folder without one it reads CLAUDE.md instead. Globally, it falls back to ~/.claude/CLAUDE.md when ~/.config/opencode/AGENTS.md doesn't exist. You can turn that off with OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1.

If you use both, AGENTS.md vs CLAUDE.md explains how to keep one set of rules for both.

Which should you use?

Pick Claude Code if:

  • You already pay for Claude Pro, Max or Ultra and want that plan to cover your coding.
  • You want IDE extensions for VS Code and JetBrains.
  • You're happy using Claude models only.

Pick OpenCode if:

  • You want open-source code you can read and change.
  • You want to switch between providers or use open-weight models.
  • You already pay for API access with several providers, or want OpenCode Go.

Use both if you want a second agent for reviews. Shared skills in .claude/skills and a shared AGENTS.md keep both on the same rules. For more options, see the best AI coding agents.

Learn to build with Claude Code

The Stride AI Coding course teaches Claude Code and Codex for building client tools, written for non-programmers, with weekly live calls to review your builds. Many of the free guides cover Claude Code setups, and the Claude Code community is where members compare theirs.

FAQ

Is OpenCode free?

Yes. OpenCode is open source under the MIT license and costs nothing to install. You pay the model provider you connect, or for the optional OpenCode Go subscription, which starts at $10 a month.

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

OpenCode's providers page doesn't offer a Claude plan login. Anthropic's Claude Code legal page says plan sign-in is meant for Claude Code and Anthropic's own apps, and that developers should use API keys. To use Claude models in OpenCode, connect an Anthropic API key.

Does OpenCode read CLAUDE.md and Claude Code skills?

Yes. It reads AGENTS.md first and falls back to CLAUDE.md in folders without one. It also loads skills from .claude/skills and ~/.claude/skills. Environment variables let you turn both off.

Which is cheaper, Claude Code or OpenCode?

OpenCode the tool is free, but model usage isn't. With an API key, the cost depends on the provider and model you pick. Claude Code starts at $20 a month on Claude Pro, which bundles usage into a flat price.

Is OpenCode better than Claude Code?

Neither is better for every job. OpenCode wins on openness and provider choice. Claude Code is Anthropic's own agent, works with Claude plans and has IDE extensions. Try both on the same task in your own project.

Build it with us in Stride AI Academy

Four courses, weekly live calls and a community of people building and selling AI. Or start with 320+ free guides.

Keep reading

Free AI Coding guides