OpenCode vs Claude Code
OpenCode is an open-source coding agent for models from any provider; Claude Code is Anthropic's agent for Claude. What each costs, what each does, and how to run either on one API key.
Published November 29, 2026
OpenCode and Claude Code are both coding agents for the terminal. OpenCode is open source and free to use, and it works with models from any provider: Claude, GPT, Gemini, local models and more. Claude Code is Anthropic's own agent for its Claude models. It isn't open source, and it needs a paid Claude plan or an API account. Both can run on an API key instead of a plan.
OpenCode 2.0 came out in September 2026 and renamed the keys in its config file: provider became providers, npm became package and options became settings. Guides written before then show the old names. OpenCode 2 still reads the old format.
At a glance
| OpenCode | Claude Code | |
|---|---|---|
| Made by | Anomaly | Anthropic |
| Open source | Yes, MIT | No, all rights reserved |
| Where it runs | A terminal UI, a desktop app, a web UI, a phone app that steers sessions on your computer, and an SDK | A CLI, VS Code and JetBrains, a desktop app, the web, phones, GitHub Actions |
| Models | Any provider's: Claude, GPT, Gemini, local models and more | Claude models |
| The tool costs | Nothing, and it comes with some models that are free for a limited time | A Pro, Max, Ultra, Team or Enterprise plan, or an API account |
| Plans | None needed. OpenCode Console sells model access per request, and Go plans cost $10 or $40 a month | Pro $20, Max $100 and Ultra $200 a month; Team seats $25 or $125 a month |
| Your own API | Any OpenAI- or Anthropic-compatible base URL, as a provider in its config file | ANTHROPIC_BASE_URL, for an API in Anthropic's Messages format |
Made by
- OpenCode
- Anomaly
- Claude Code
- Anthropic
Open source
- OpenCode
- Yes, MIT
- Claude Code
- No, all rights reserved
Where it runs
- OpenCode
- A terminal UI, a desktop app, a web UI, a phone app that steers sessions on your computer, and an SDK
- Claude Code
- A CLI, VS Code and JetBrains, a desktop app, the web, phones, GitHub Actions
Models
- OpenCode
- Any provider's: Claude, GPT, Gemini, local models and more
- Claude Code
- Claude models
The tool costs
- OpenCode
- Nothing, and it comes with some models that are free for a limited time
- Claude Code
- A Pro, Max, Ultra, Team or Enterprise plan, or an API account
Plans
- OpenCode
- None needed. OpenCode Console sells model access per request, and Go plans cost $10 or $40 a month
- Claude Code
- Pro $20, Max $100 and Ultra $200 a month; Team seats $25 or $125 a month
Your own API
- OpenCode
- Any OpenAI- or Anthropic-compatible base URL, as a provider in its config file
- Claude Code
ANTHROPIC_BASE_URL, for an API in Anthropic's Messages format
Models
OpenCode comes with a catalogue of providers and their models: /connect adds a provider with its credentials, and /models picks one of its models. Instead of an API key it can use a ChatGPT Plus or Pro plan, or GitHub Copilot, and it finds local models from Ollama, LM Studio and vLLM by itself. An API with a model list of its own goes in the config file as a custom provider (OpenCode's docs).
Claude Code runs Claude models, picked by aliases such as opus, sonnet, haiku and fable (Anthropic). Besides Anthropic's own API, it can reach them on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS (Anthropic). ANTHROPIC_BASE_URL sends it to a gateway that speaks Anthropic's Messages format, but Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway" (Anthropic).
What each can do
- Agents. OpenCode has two main agents: Build, its default, and Plan, which explores and plans without editing your project's files. In version 2, Shift+Tab cycles between them, and a Markdown file adds an agent of your own. Both tools have subagents. OpenCode's run in their own child sessions, in the background; in Claude Code each one "runs in its own context window with a custom system prompt, specific tool access, and independent permissions" (Anthropic).
- Extensions. OpenCode takes MCP servers, skills, custom commands and plugins; plugins written for version 1 don't run in version 2. Claude Code takes MCP servers, skills, subagents, hooks and plugins (Anthropic). Its hooks are shell commands you write, which it runs at set points in its work (Anthropic).
- Project instructions. OpenCode reads
AGENTS.md, and a folder'sCLAUDE.mdwhen it has noAGENTS.md. Claude Code readsCLAUDE.md, andAGENTS.mdtoo (Anthropic). - Undo. In OpenCode,
/undoand/redotake back recent conversation and file changes together. In Claude Code,/rewindor/undoopens a menu to roll back its edits (Anthropic). - Code intelligence. OpenCode 2 doesn't run language servers; version 1 did. Claude Code connects to a language server through plugins, one per language (Anthropic).
- Editors and CI. OpenCode works in Zed through the Agent Client Protocol (
opencode acp), andopencode runreplies without opening its interface, for scripts and CI; its VS Code extension and GitHub agent are documented for version 1 only. Claude Code has extensions for VS Code and JetBrains,claude -pfor scripts, and a GitHub Action that answers@claudein pull requests and issues (Anthropic). - Permissions. OpenCode's rules allow, ask or deny each kind of action. Version 2 lets its agents reach files outside the project without asking; version 1 asked first.
What you pay
OpenCode costs nothing. Its free models are free for a limited time, with a daily request limit, and OpenCode says "your data and information is only stored when you use our free models." Past those, you pay the provider you connect. OpenCode also sells model access in its Console, per request from prepaid credit, with a fee of 4.6% + $0.31 on each purchase, and Go plans at $10 or $40 a month for "popular open coding models". Console charges Anthropic's own prices for Claude: Opus 5.5 is $4 / $20 per million tokens there (OpenCode's docs).
Claude Code needs a Pro, Max, Ultra, Team or Enterprise plan, or an API account (Anthropic). Pro costs $20 a month ($17 billed yearly), Max $100 with 5 times Pro's usage, and Ultra $200 with 10 times Pro's weekly usage (Anthropic). On an API key it bills each request by its tokens. Across enterprise deployments, Anthropic puts the average at about $13 per developer per active day at its own prices (Anthropic).
A Claude plan in OpenCode
OpenCode used to sign in to Claude Pro and Max accounts itself, through plugins it came with. In January 2026 its docs began to say: "We've received reports of some users having their subscriptions blocked while using it with OpenCode." On 19 March a pull request titled "anthropic legal requests" removed the plugin, and version 1.3.0, released on 22 March, shipped without it (OpenCode's repository and docs).
Since version 2.2.3, from 30 October 2026, OpenCode has a provider called Claude Agent instead. It runs Claude Code on your machine with your Claude Code login: "Claude Code calls the model, and OpenCode does everything else." Your Claude Code settings, CLAUDE.md files, hooks, MCP servers, skills and memory aren't loaded. OpenCode shows the cost of a plan login as "None, your plan covers it", and adds: "If you have several interchangeable accounts, OpenCode can move to the next one when an account hits its usage limit." (OpenCode's docs)
Anthropic's pages don't name OpenCode. On signing in with a plan, its legal page for Claude Code says (Anthropic):
- "OAuth authentication is intended exclusively for purchasers of Claude Free, Pro, Max, Ultra, Team, and Enterprise subscription plans and is designed to support ordinary use of Claude Code and other native Anthropic applications."
- "Anthropic does not permit third-party developers to offer Claude.ai login into their own applications, or to route requests through Free, Pro, Max, or Ultra plan credentials on behalf of their users."
- The rules don't "prevent an end user from signing in to the unmodified Claude Code binary with their own Claude subscription".
- "Advertised usage limits for Pro, Max, and Ultra plans assume ordinary, individual usage of Claude Code and the Agent SDK." Anthropic "reserves the right to take measures to enforce these restrictions and may do so without prior notice."
Its help centre adds that, for now, "Claude Agent SDK, claude -p, and third-party app usage still draw from your subscription limits" (Anthropic). None of these pages names OpenCode or its Claude Agent, so we can't tell you whether Anthropic counts it as ordinary use. If you plan to rely on it, read Anthropic's page yourself. An API key leaves plans out of it: OpenCode takes an Anthropic key, or a /model key, like any other provider's.
Run either one on /model
One /model key works in both, and Claude models cost less here than at Anthropic's prices:
Claude prices here
Prices as of Nov 30, 06:33 PM UTCPer 1M tokens, input / output, at the cheapest channel serving each model now.
- Claude Opus 5.5Anthropic's price:
$4.00 / $20.00Here: $0.55 / $2.7586% off - Claude Sonnet 5.5Anthropic's price:
$2.00 / $10.00Here: $0.275 / $1.37586% off - Claude Haiku 5.5Anthropic's price:
$0.10 / $0.50Here: $0.033 / $0.16367% off - Claude Fable 5.2Anthropic's price:
$8.00 / $40.00Here: $2.60 / $13.0067% off
In OpenCode, add /model to the config file as a custom provider: the base URL, your key in an environment variable, and the models you want. Every chat model here answers in OpenAI's format, so the list can hold Claude, GPT, Gemini, Kimi, GLM and the rest. The OpenCode guide has the config.
In Claude Code, two settings do it:
export ANTHROPIC_BASE_URL="https://api.slashmodel.com"
export ANTHROPIC_AUTH_TOKEN="$SLASHMODEL_API_KEY"
claudeClaude Code's own model names then get you Claude models. ANTHROPIC_MODEL can pick Kimi, GLM, DeepSeek, MiniMax, MiMo or Hunyuan instead, which /model also serves in Anthropic's format. Anthropic doesn't support non-Claude models in Claude Code, as quoted above, but we ran GLM 5.3 and Kimi K3.1 Pro this way on 28 November 2026. GPT and Gemini models need a program in between, such as Claude Code Router. The Claude Code guide has the details.
Which to choose
- Choose OpenCode for an open-source agent you can read and change, for models from many makers in one tool, local ones included, or to steer sessions from a desktop app, a browser or your phone.
- Choose Claude Code for Anthropic's own agent and its Claude models, with extensions for VS Code and JetBrains, hooks, a GitHub Action, and plans at a fixed price a month.
- Use both: one /model key works in each.
Sources
Each opened on November 29, 2026.
- OpenCode's docs: providers, config, Claude Agent, agents, permissions, snapshots, Console, Go, and moving from version 1
- OpenCode's press, product and mobile pages, its changelog, and pull requests #9721 and #18186 and release 1.3.0 in its repository
- Anthropic: Claude Code legal and compliance
- Anthropic: the Claude Agent SDK with your Claude plan
- Anthropic: Claude plans
- Anthropic: set up Claude Code
- Anthropic: Claude Code costs
- Anthropic: Claude Code overview
- Anthropic: Claude Code model configuration
- Anthropic: Claude Code on cloud providers
- Anthropic: Claude Code and LLM gateways
- Anthropic: Claude Code features
- Anthropic: subagents
- Anthropic: hooks
- Anthropic: checkpointing
- Anthropic: code intelligence plugins
- Anthropic: Claude Code GitHub Actions
- Claude Code's license on GitHub