Use Claude Code if you pay for a Claude Pro or Max plan. Use OpenCode if you want to pick the model yourself. For most people that settles it, and the rest of this page is the detail behind it.
Claude Code is Anthropic’s coding agent. It runs Claude models and comes with your Claude plan. OpenCode is a free, open-source agent that connects to more than 75 model providers. It doesn’t support Claude plan logins, so the choice comes down to how you want to pay for models.
This guide uses the vendors’ own pages, read on October 26, 2026: Anthropic’s docs and help center, and OpenCode’s docs, terms and GitHub. OpenCode has two release lines, and its homepage now installs OpenCode 2. Where version 1 differs, this guide says so.
- Pick Claude Code if you pay for Claude Pro ($20 a month) or Max ($100 or $200). The plan covers it. Anthropic’s rules bar that login in third-party tools, and OpenCode’s docs say so too.
- Pick OpenCode if you want to choose the model. It is free, MIT-licensed, and connects to 75+ providers and local models. You pay the provider you connect, or OpenCode’s own Zen and Go.
- Claude inside OpenCode is pay per token. It runs through an Anthropic API key or a gateway like Zen. Anthropic’s own average for Claude Code is about $13 per developer per active day, so price it before you switch.
- AGENTS.md, skills and MCP carry over. Both can read AGENTS.md, OpenCode reads
.claude/skills, and both speak MCP. The catch is that OpenCode 2 doesn’t fall back to CLAUDE.md. - Running Claude Code? Context Board shows its limits and sessions on one live board. Free for 3 days, then $12 a month.
Claude Code vs OpenCode at a glance
| Claude Code | OpenCode | |
|---|---|---|
| Made by | Anthropic | Anomaly Innovations, Inc. |
| License | Public repo, all rights reserved | MIT, open source on GitHub |
| Cost of the tool | Included in Claude Pro, Max, Team and Enterprise | Free |
| Models | Claude models, Opus 5.5 by default | 75+ providers and local models, you choose |
| Claude Pro or Max login | Yes, the supported way in | No. Anthropic bars it in third-party tools |
| Other ways to pay | Anthropic API key or a cloud provider, per token | Your own API keys, Zen pay as you go, Go from $10 a month, ChatGPT Plus or Pro and GitHub Copilot sign-ins |
| Runs in | Terminal, VS Code and Cursor, JetBrains, desktop app, web, mobile, Slack, CI | Terminal, desktop app (beta), browser, IDE extension |
| Instructions file | CLAUDE.md, or AGENTS.md if there is no CLAUDE.md | AGENTS.md (OpenCode 2 doesn’t fall back to CLAUDE.md) |
| Plan mode | Yes, Shift+Tab | Yes, the Plan agent on Tab |
| Subagents | Built in and custom | Built in and custom, with a model per agent |
| Language servers | Plugins, one per language | Not run by OpenCode 2 (OpenCode 1 has them, off by default) |
| MCP | Local and remote HTTP servers, OAuth sign-in | Local and remote Streamable HTTP servers, OAuth sign-in |
| Default permissions | Auto mode on current versions: a second model reviews actions | Allows everything; reading .env files asks first (OpenCode 2) |
Can you use a Claude Pro or Max plan in OpenCode?
No. As of October 26, 2026, Anthropic’s rules and OpenCode’s own docs point the same way. If you hoped to point a Max plan at OpenCode, that door is closed.
Anthropic’s legal and compliance page for Claude Code says plan sign-in is for Anthropic’s own apps. It calls OAuth “intended exclusively for purchasers of Claude Free, Pro, Max, Team, and Enterprise subscription plans” and meant for “ordinary use of Claude Code and other native Anthropic applications.” Then it draws the line: “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.” Developers should use API key authentication, and Anthropic says it may enforce the rule without prior notice.
That page doesn’t name OpenCode. OpenCode’s providers page does, from its side: “There are plugins that allow you to use your Claude Pro/Max models with OpenCode. Anthropic explicitly prohibits this.” Older OpenCode versions bundled those plugins. That stopped as of 1.3.0.
So in OpenCode, Claude runs on an API key from the Claude Console, billed per token. Run /connect, choose Anthropic, and paste the key.
Two more things are worth knowing.
- Max plans include API credits. Anthropic’s help article says Max 5x comes with $100 a month in credits for the Claude API and Max 20x with $200, claimed by linking a Console organization. Any API key in that organization draws from the balance. Pro doesn’t get them, and they don’t cover interactive Claude Code. The article doesn’t mention OpenCode, so check your Console balance after your first session.
- A help article on the Agent SDK mentions “third-party apps.” It says you can still use the Agent SDK,
claude -pand third-party apps with your subscription limits. It names no apps and doesn’t mention OpenCode. The legal page above is where Anthropic sets the sign-in rule. Until Anthropic says in writing that OpenCode is covered, use an API key.
The same logic applies to every provider. OpenCode’s docs list sign-in with a ChatGPT Plus or Pro plan and with GitHub Copilot, but whether a plan login is allowed in a third-party tool is that provider’s rule. Read its terms before you rely on one.
Price: what each one costs
On a plan, Claude Code costs what your Claude plan costs. OpenCode costs nothing, and the models behind it cost what their providers charge.
Claude Code comes with Pro, Max, Team and Enterprise plans, per Claude’s pricing page. Claude’s Free tier doesn’t include it.
- Pro: $20 a month, or $17 a month billed yearly.
- Max 5x: $100 a month.
- Max 20x: $200 a month, per Anthropic’s Max plan article.
Plans have a five-hour session limit and a weekly limit, shared with Claude chat. If a plan runs out, usage credits keep Claude Code going at standard API rates. Our guide to checking Claude Code usage covers where to see your limits, and Claude Max vs Pro helps you pick a tier.
You can also run Claude Code on an API key and pay per token. Anthropic lists Opus 5.5 at $4 per million input tokens and $20 per million output, and Sonnet 5.5 at $2 and $10. Its cost page puts the average at about $13 per developer per active day, or $150 to $250 a month, across enterprise deployments, with 90% of users under $30 a day.
OpenCode is free to install. What you pay depends on where the model comes from.
- Your own API keys: at each provider’s prices.
- Zen: OpenCode’s pay-as-you-go list of models its team tested for coding agents. The OpenCode 2 docs call it Console. You add a $20 balance (plus a $1.23 card fee) and pay per request, and OpenCode says it adds no markup. Opus 5.5 is $4 and $20 per million tokens there, the same as Anthropic’s list.
- Go: a subscription at $10 a month, or $40 for Go Plus. Its list includes Kimi, GLM, MiniMax, Qwen and DeepSeek models, GPT 6 Luna, Gemini 4 Argon and Claude Haiku 5.5. Opus and Sonnet are not on it. Go has limits of its own: each model gets a monthly dollar allowance, with 20% of it available every five hours and 50% a week.
- Plan logins: OpenCode’s docs list ChatGPT Plus or Pro and GitHub Copilot.
- Free models: no account needed, and offered for a limited time. OpenCode says it stores your data only when you use them, and its privacy list says a few may use it to improve the model while they’re free. Read that list before you point one at private code.
- Local models: these run on your own hardware.
So which is cheaper? A flat plan wins if you use it all day, and metered billing wins if you don’t. Anthropic’s own estimate of $150 to $250 a month for Claude Code on the API sits around the price of Max 20x ($200). For heavy Claude use, the plan is likely the better deal. For light use, or work you hand to cheaper models, OpenCode can cost less. Anthropic’s figures are for Claude Code, so your OpenCode bill will differ.
Models and providers
Claude Code runs Claude models. On Pro, Max, Team, Enterprise and the API, the default is Opus 5.5, per its model docs. Switch with /model to Sonnet 5.5, Haiku 5.5 or Fable 5.1, or use opusplan to plan on Opus and build on Sonnet. It can reach Claude through Anthropic, Amazon Bedrock, Google Cloud’s Agent Platform (formerly Vertex AI), Microsoft Foundry or Claude Platform on AWS. What it can’t do is run other companies’ models. Anthropic’s gateway docs say it doesn’t support routing Claude Code to non-Claude models through any gateway.
OpenCode runs models from many providers. Its homepage says it supports 75+ providers through Models.dev, plus local models. The providers page lists OpenAI, Anthropic, Google Vertex AI, Amazon Bedrock, Azure, xAI, Groq, OpenRouter, GitHub Copilot, Ollama and LM Studio, among others. You can set a model per agent, so a review subagent can run on a cheap model while the main agent uses a strong one.
With that freedom, you do the choosing. Zen is OpenCode’s shortcut: a list of models its team says it benchmarked for coding agents.
Which one gives better results? That depends on the model, the repo and the task, and the same model can behave differently in different tools. A benchmark can’t settle it for you. Run one real task from your repo in both.
Where each one runs and how you start
Claude Code runs in the terminal, VS Code and Cursor, JetBrains IDEs, a desktop app, on the web at claude.ai/code and on mobile. It also runs in Slack, and in CI through GitHub Actions and GitLab CI/CD, per the Claude Code docs. On macOS, Linux and WSL, install it with curl -fsSL https://claude.ai/install.sh | bash, or use Homebrew or WinGet. Run claude in a project and sign in.
OpenCode runs in the terminal, in a desktop app that its README marks beta, in a browser, and as an extension for VS Code and forks such as Cursor. opencode run sends one prompt without the interface, which suits scripts and CI jobs. The repo has more than 220,000 GitHub stars. Install it with curl -fsSL https://opencode.ai/v2/install | bash, or with npm, Homebrew and others. Run opencode, then /connect to add a provider.
The older docs at opencode.ai/docs still describe OpenCode 1, so check which line a page covers. Both lines use the opencode command, and they can’t be installed side by side under the default command.
One gap is reach. Claude Code also runs in Anthropic’s web and mobile apps and in Slack.
Plan mode, subagents, sessions and language servers
Plan mode: both have one. In Claude Code, Shift+Tab cycles permission modes, and in plan mode it blocks edits until you approve a plan. In OpenCode, Tab switches between the Build agent and the Plan agent, which explores and plans without editing normal project files. Tab back and tell it to go ahead.
Subagents: Claude Code has built-in Explore, Plan and general-purpose subagents, and you can write your own as Markdown files. Each runs in its own context window, and its requests count toward the same usage limits as your main conversation. OpenCode has built-in General and Explore subagents, and custom agents are Markdown files in .opencode/agents/. Each can have its own model and permissions, and subagents run in child sessions, in the foreground or the background. The difference is the model. A Claude Code subagent can use a cheaper Claude model like Haiku. An OpenCode subagent can use any provider’s.
Sessions and undo: Claude Code saves sessions. claude --continue reopens the last one and claude --resume opens a picker. /rewind restores the code, the conversation or both to an earlier prompt. OpenCode keeps sessions too. In it, /undo removes your last message and the file changes it caused, and /redo cancels the undo. File restore needs a Git repository.
Language servers: Claude Code uses code intelligence plugins, one per language. Install the language server, then a plugin such as typescript-lsp, and Claude sees type errors after each edit and can look up symbols. Its cloud sessions don’t start them. OpenCode 1 has built-in language server support, off by default. OpenCode 2 doesn’t. Its migration guide says V2 “does not run language servers, expose LSP tools, or produce LSP diagnostics,” and tells you to use your lint, typecheck or compiler commands instead.
Permissions and safety
Defaults differ, and both can be changed.
Claude Code has permission modes. Manual mode asks before most edits, shell commands and network requests. Plan mode blocks edits. Auto mode lets a second model review actions instead of you, and per Anthropic’s docs it is the starting mode for interactive terminal and VS Code sessions from version 2.1.283. A built-in sandbox for the Bash tool is available on macOS, Linux and WSL2.
OpenCode 2 uses ordered rules, each one allow, ask or deny for an action and a path. Its permissions page lists the starting policy: every action is allowed, except that reading .env files asks first. Reads and edits outside the project run without a prompt unless you add a rule, and shell commands run with your user’s access to files, processes and the network. To make it ask before it runs commands, add an ask rule for shell.
Check the defaults before you point either one at a repo you care about.
Instructions, skills and MCP
Instructions: Claude Code reads CLAUDE.md. Per its memory docs, it reads AGENTS.md when your project has no CLAUDE.md. OpenCode 2 recognizes AGENTS.md only and doesn’t use CLAUDE.md as a fallback. OpenCode 1 did. So a repo with only a CLAUDE.md loads in Claude Code and not in OpenCode 2.
Skills and extensions: both load skills from SKILL.md files, and OpenCode looks in .claude/skills as well as .opencode/skills, so skills you wrote for Claude Code load there. Claude Code adds hooks, which run a script, a web request, an MCP tool call, a prompt or a subagent when something happens, and plugins that bundle skills, hooks, subagents and MCP servers. OpenCode extends through plugins, which are JavaScript or TypeScript modules. OpenCode 2 uses a new plugin API, and OpenCode 1 plugins don’t run on it.
MCP: both handle local and remote servers. In Claude Code, claude mcp add --transport http notion https://mcp.notion.com/mcp adds a remote server, per its MCP docs. The older SSE transport is deprecated, local servers run over stdio, and servers that need sign-in use OAuth from /mcp. Its tool search defers tool definitions until Claude needs them, so only tool names and server instructions load at session start.
In OpenCode 2, opencode mcp add context7 --url https://mcp.context7.com/mcp adds a remote server. Per its MCP docs, remote servers use the Streamable HTTP transport, and OAuth is on by default: OpenCode finds the authorization server, signs in with PKCE and refreshes tokens. If a server needs sign-in, run /mcps. The docs warn that MCP tools use up model context, so add only the servers you need. Our guide to listing your MCP servers shows how to see what Claude Code and Codex have, and what MCP is covers the basics.
OpenCode or Claude Code: which should you pick?
- You pay for Claude Pro or Max: Claude Code. It is the supported way to use that plan.
- You want to switch between Claude, GPT, Gemini and open models: OpenCode. The model is a setting, and each agent can have its own.
- You want to read and fork the code: OpenCode. It is MIT-licensed. Claude Code’s repo is public, but its license reads “All rights reserved.”
- You want web, mobile or Slack surfaces: Claude Code. Anthropic ships all three.
- You want local models: OpenCode, with Ollama or LM Studio. They run on your machine.
- You want a flat monthly bill: a Claude plan. You want to pay for what you use: an API key in either tool, or Zen.
- You want language server errors in the loop: Claude Code with a plugin, or OpenCode 1.
- You’re not sure: if you already pay for a Claude plan, start with Claude Code. Then try OpenCode on a branch with a free model or a Zen top-up.
If your other choice is Codex rather than OpenCode, Claude Code vs Codex does the same job for that pair.
Using both
You can run both. Claude Code on your plan does the big work, and OpenCode with a cheaper model takes small jobs or a second opinion. Much of the setup is shared.
- Rules: keep shared instructions in AGENTS.md. OpenCode 2 reads it, and Claude Code reads it when the repo has no CLAUDE.md. If you keep a CLAUDE.md, put
@AGENTS.mdat its top and Claude Code loads the same file. - Skills: put them in
.claude/skills. Both pick them up. - MCP servers: each tool keeps its own config, so add a server in both.
claude mcp addis one,opencode mcp addthe other. - One repo, two agents: give each its own branch or Git worktree, so their edits don’t collide.
Watching Claude Code’s limits and sessions on a board
On a Claude plan it is easy to lose track of how much of the five-hour window and the week is left, and of which sessions are still running.
Context Board is ours, so weigh the bias. Its AI usage widget shows what is left of Claude Code’s window and week as rings that empty as you use them, green at half or more, amber from 20% and red under 20%, each with when it resets, as Claude Code last checked. Agent activity and Needs you list every Claude Code session on your computer, with its title and project and whether it is working, done or waiting for you. You add AI usage from the gallery, or start from the Agents template, which already has AI usage, Needs you, Git activity and Agent activity.
- Claude Code · docsasks to run the build4m
34% left this window. The big refactor waits for the reset.
A small program you set up once with one line from Connect feeds those widgets. Only names, states and percentages leave your computer, never what was said in a session, and more than one computer works.
OpenCode can also use the board. OpenCode 2’s docs support remote MCP servers over Streamable HTTP with browser sign-in, and the board accepts any app that speaks MCP over HTTP, so you add it by its address and approve it on an Allow page. After that the agent can read the board, add tasks and notes, post an update and say what it is working on. The usage and session widgets read Claude Code and Codex only.
Context Board is free for 3 days, then $12 a month. If you already watch Claude Code’s usage with other tools, the Claude Code dashboard guide compares them.