# OpenCode vs Claude Code: what changes when you switch

Choose between Claude Code and OpenCode by subscription access, API cost, permissions and what carries over. Includes the OpenCode 1 and 2 migration differences.

Author: Ravi Parikh

Canonical: https://voyager.so/blog/opencode-vs-claude-code

Published: 2026-10-29T13:09:04-07:00
Updated: 2026-10-29

![OpenCode's Anthropic provider instructions show connecting with an API key and warn that Anthropic prohibits plugins that use Claude Pro or Max subscription access.](https://cdn.moda.app/voyager/blog/opencode-vs-claude-code/hero-crop-02d51609f4f8073b.webp)

Choose **Claude Code** if you want to spend your Claude Pro or Max subscription allowance on coding. Choose **OpenCode** if you want an MIT-licensed agent with many model providers or local inference. Moving to OpenCode changes the harness, authentication and bill, even when you keep the same Claude model.

The short version: keep Claude Code for subscription-funded Claude work; try OpenCode when model choice or control of the source matters more. You can use both. Max subscribers also get separate API credits that can fund Claude API calls from another harness, subject to eligibility and credit limits.

Prices and documented behavior were checked against primary sources on **29 October 2026**. This is a documentation comparison, not a current coding-quality test. Voyager, the desktop app our team builds, runs Claude Code on its official runtime with your own sign-in; that preserves Claude Code's billing route, rather than transferring your allowance to another agent ([product details](/blog/why-we-forked-t3-code)).

## What each is

**Claude Code** is Anthropic's proprietary agent for terminal, IDE, desktop and cloud coding sessions ([overview](https://code.claude.com/docs/en/overview), [license](https://github.com/anthropics/claude-code/blob/main/LICENSE.md)). Its latest release is **2.1.312**, published 27 October. Anthropic supports Claude models through its own platform and supported cloud providers; non-Claude models through a gateway are unsupported ([release](https://github.com/anthropics/claude-code/releases/tag/v2.1.312), [gateway policy](https://code.claude.com/docs/en/llm-gateway)).

**OpenCode** is Anomaly's open-source coding agent, licensed MIT. Its documentation lists 75+ providers and local models; the software is free, while model access has its own bill ([repository](https://github.com/anomalyco/opencode), [providers](https://docs.opencode.ai/docs/providers/)).

Check which OpenCode you install. On 29 October, `opencode-ai` on npm is **1.19.5**, published 28 October, while `@opencode/cli` is **2.2.2**, published 29 October ([V1 registry](https://registry.npmjs.org/opencode-ai/latest), [V2 registry](https://registry.npmjs.org/@opencode/cli/latest)). Homebrew core points at V2, currently **2.2.1** ([formula](https://formulae.brew.sh/formula/opencode)). Both use the `opencode` command; remove a package-managed V1 installation before installing V2 ([migration guide](https://opencode.ai/v2/docs/migrate-v1/)).

## At a glance

| Decision                                 | Claude Code                                                    | OpenCode                                                      |
| ---------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------- |
| Claude Pro or Max subscription allowance | Yes                                                            | No bundled Claude subscription login                          |
| Model choice                             | Claude, officially                                             | Multiple providers and local servers                          |
| Software license                         | Proprietary                                                    | MIT                                                           |
| Default approvals                        | Auto mode on supported interactive sessions; classifier review | Most actions allowed; configure ask rules                     |
| Shell isolation                          | Optional OS sandbox                                            | No built-in sandbox; use a container or VM                    |
| Existing Claude setup                    | Native instructions, skills and plugins                        | Skills carry over; check instructions, MCP config and plugins |
| Remote work                              | Anthropic-hosted cloud sessions                                | Remote access to your running host                            |

Sources, read 29 October 2026: [Claude Code authentication](https://code.claude.com/docs/en/authentication), [permission modes](https://code.claude.com/docs/en/permission-modes), [sandboxing](https://code.claude.com/docs/en/sandboxing) and [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web); OpenCode's [providers](https://docs.opencode.ai/docs/providers/), [V2 permissions](https://opencode.ai/v2/docs/permissions/), [security policy](https://github.com/anomalyco/opencode/blob/dev/SECURITY.md), [migration guide](https://opencode.ai/v2/docs/migrate-v1/) and [remote access notes](https://opencode.ai/changelog).

## Can you use your Claude subscription in OpenCode?

**Your subscription allowance does not transfer.** Anthropic's current login guidance says included usage is for its native applications. It prefers API keys for third-party tools and may allow selected tools through usage credits, billed separately from subscription limits. Attempts to disguise a client or route third-party traffic against those limits are prohibited ([Claude account authentication](https://support.claude.com/en/articles/13189465-log-in-to-your-claude-account)).

![Claude Support's subscription authentication section distinguishes native application usage from third-party tools, recommends API keys and describes separate usage-credit billing.](https://cdn.moda.app/voyager/blog/opencode-vs-claude-code/anthropic-login-crop-9b71dcd875996a98.webp)

The billing distinction matters more than the sign-in button. Anthropic's current authentication guidance, captured signed out on 29 October 2026.

OpenCode removed its bundled Anthropic OAuth plugin in **1.3.0 on 22 March 2026**, following the **19 March** merge of a change titled “anthropic legal requests” ([release](https://github.com/anomalyco/opencode/releases/tag/v1.3.0), [PR #18186](https://github.com/anomalyco/opencode/pull/18186)). Its provider instructions now direct you to an API key and warn against subscription-auth plugins, as shown in the opening screenshot ([providers](https://docs.opencode.ai/docs/providers/#anthropic)).

Three routes remain distinct:

* **Claude API key in OpenCode:** pay for API consumption through your Anthropic organization.
* **Max monthly API credits:** Max 5x includes **US$100**, Max 20x **US$200** per month. Claim them after seven days on an eligible plan and link a Console organization. They expire monthly and exclude interactive Claude Code. Our reading is that an OpenCode request using that organization's Anthropic API key draws on this balance because it is a Claude API request; Anthropic does not name OpenCode in the coverage terms ([API credit terms](https://support.claude.com/en/articles/17154008-monthly-api-credits-for-max-and-team-plans)). An OpenCode Console key is a different billing account.
* **Another app running Claude Code:** Anthropic allows the unmodified binary inside other products, with each user authenticating and paying directly. Its SDK guidance also preserves subscription-limit use when signed in with a Claude plan. Neither statement authorizes a replacement harness to replay subscription credentials ([embedding conditions](https://code.claude.com/docs/en/legal-and-compliance), [SDK guidance](https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan)).

Anthropic's posted Usage Policy, scheduled to take effect **12 November 2026**, also prohibits unauthorized services routing requests through consumer subscriptions ([policy](https://www.anthropic.com/legal/aup)).

## Compare the bill you would actually pay

Claude Pro is **US$20 monthly or US$200 annually**; Max 5x is **US$100 monthly** and Max 20x **US$200 monthly**, before applicable tax, checked 29 October 2026 ([pricing](https://claude.com/pricing), [Max plans](https://support.claude.com/en/articles/11049741-what-is-the-max-plan)). Plans have five-hour and weekly limits shared with Claude chat ([plan usage](https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan)). The [Claude usage limits guide](/blog/claude-usage-limits) explains the meters and reset behavior.

Anthropic reports enterprise API averages of roughly **US$13 per active developer-day and US$150–250 per developer-month** ([cost guide](https://code.claude.com/docs/en/costs)). Those are Claude Code fleet figures, not an OpenCode quote or proof that Max is cheaper for your tasks. A subscription is attractive when its allowance covers your work; occasional API use can cost less than an unused monthly plan. Count Max's separate API credit only if you qualify and would use it.

**Standard token rates, US dollars per million tokens, checked 29 October 2026:**

| Model and route                                    | Input | Cache read | Output |
| -------------------------------------------------- | ----: | ---------: | -----: |
| Opus 5.5, Anthropic or OpenCode Console            | $4.00 |      $0.20 | $20.00 |
| Sonnet 5.5, Anthropic                              | $2.00 |      $0.10 | $10.00 |
| Sonnet 5.5, OpenCode Console                       | $2.00 |      $0.20 | $10.00 |
| Haiku 5.5, either route, prompts up to 100K tokens | $0.10 |      $0.01 |  $0.50 |

Sources: [Anthropic API pricing](https://platform.claude.com/docs/en/about-claude/pricing), [OpenCode Console pricing](https://opencode.ai/v2/docs/console/models/). These are token rates, excluding cache-write premiums and other charges. Haiku has higher rates above 100K input tokens. Console still lists a higher Sonnet cache-read rate than Anthropic; do not assume identical pricing from identical model names.

OpenCode Console is optional pay-as-you-go access to multiple models. Its billing and model pages now agree on a **4.6% + US$0.31 processing fee per credit purchase**: US$50 of credits costs US$52.61 ([billing](https://opencode.ai/v2/docs/console/billing/)). A direct provider key avoids this Console purchase route.

**OpenCode Go** is a separate subscription: **US$10/month**, **Go Plus US$40/month**, or **Go Teams US$20/member/month**. Go and Go Plus require single-member workspaces. Each model has its own allowance: Haiku 5.5 and Kimi K3 get US$15 on Go or US$60 on Plus; GLM-5.3-Flash gets US$60 or US$180. Five-hour and weekly caps are 20% and 50% of the monthly allowance. Opus and Sonnet are absent from the current Go catalog ([Go plans and allowances](https://opencode.ai/v2/docs/console/go/)).

Choose Claude Code when its subscription fits your workload. Choose OpenCode when a different model or billing route fits better; check the provider's limits before counting an existing ChatGPT or Copilot subscription as sufficient ([supported sign-ins](https://docs.opencode.ai/docs/providers/)).

## Permissions and data change with the harness

Claude Code's supported interactive sessions start in auto mode unless settings override it. Routine project reads and edits proceed; a classifier reviews other actions. This reduces prompts without guaranteeing safety ([permission modes](https://code.claude.com/docs/en/permission-modes)). Its shell sandbox is **off by default**; `/sandbox` enables filesystem and network restrictions on macOS, Linux and WSL2 ([sandboxing](https://code.claude.com/docs/en/sandboxing)).

OpenCode's defaults allow most actions. V1 asks about outside-project access; V2 allows outside paths. Both now ask about direct `.env` reads ([V1 defaults](https://docs.opencode.ai/docs/permissions/#defaults), [V2 defaults](https://opencode.ai/v2/docs/permissions/#defaults)). Its security policy explicitly says permissions do not provide sandbox isolation; use Docker or a VM if you need that boundary ([security policy](https://github.com/anomalyco/opencode/blob/dev/SECURITY.md)).

For **OpenCode 2**, this `opencode.json` asks before edits, shell commands and access outside the project:

```text
{
  "$schema": "https://opencode.ai/config.json",
  "permissions": [
    { "action": "edit", "resource": "*", "effect": "ask" },
    { "action": "shell", "resource": "*", "effect": "ask" },
    { "action": "external_directory", "resource": "*", "effect": "ask" }
  ]
}
```

V2 uses `permissions` and `shell`; V1 uses `permission` and `bash`. Later matching rules win, including agent rules, so review those too ([V2 rules](https://opencode.ai/v2/docs/permissions/)).

Before storing provider keys in hosted Console, review the **17 October 2026 disclosure**: OpenCode reported a breach affecting **1.4% of Console users**. Its cofounder distinguished Console-stored keys from keys kept in local OpenCode ([company disclosure](https://x.com/opencode/status/2111519637049319818), [cofounder clarification](https://x.com/thdxr/status/2111572618340188393)).

Data follows the provider and tools you enable. Local model inference is an option, but it does not make remote MCP servers or web tools local. Go's privacy table varies by model: some contributor endpoints permit training, and DeepSeek's zero-retention agreement is renewed monthly. Check the current row before sending private code ([Go privacy](https://opencode.ai/v2/docs/console/go/#privacy)).

Choose Claude Code for its integrated classifier and optional shell isolation. Choose OpenCode for provider control, with explicit permissions and any isolation you require configured before the first task.

## What carries over when you switch

Save your Claude configuration, choose the OpenCode version, then migrate one repository:

| Item                        | What to do                                                                                                               |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| Model access                | Run `/connect`. Use a provider key or supported sign-in, then check which account pays.                                  |
| Project instructions        | Put shared guidance in `AGENTS.md`. V1 falls back to `CLAUDE.md`; V2 currently discovers only `AGENTS.md`.               |
| Skills                      | Both versions discover `.claude/skills`. Check scripts, dependencies and tool names.                                     |
| MCP servers                 | Recreate the server entries under OpenCode's `mcp` configuration.                                                        |
| Hooks and plugins           | Rebuild Claude-specific integrations. V2 also needs ports of V1 OpenCode plugins.                                        |
| Language-server diagnostics | V1 has LSP support. V2 accepts `lsp` config but does not run language servers; use lint, typecheck or compiler commands. |
| Conversations               | Keep Claude Code available for its existing sessions; OpenCode's import command documents OpenCode session exports.      |

Sources, read 29 October 2026: [V1 rules](https://docs.opencode.ai/docs/rules/), [V2 instructions](https://opencode.ai/v2/docs/instructions/), [skills](https://opencode.ai/v2/docs/skills/), [MCP configuration](https://docs.opencode.ai/docs/mcp-servers/), [migration guide](https://opencode.ai/v2/docs/migrate-v1/) and [CLI import](https://docs.opencode.ai/docs/cli/). For the distinction between portable instructions and tool connections, use [MCP vs skills](/blog/mcp-vs-skills).

If both agents will share instructions, keep `AGENTS.md` as the source and have `CLAUDE.md` import it with `@AGENTS.md`. Claude Code also supports `AGENTS.md` directly, but its default discovery depends on whether a Claude-specific instruction file applies ([memory documentation](https://code.claude.com/docs/en/memory)).

Choose V1 if LSP diagnostics are essential today. Choose V2 if its current feature set fits, after checking the migration guide rather than assuming every accepted config field is implemented.

## Does the harness change coding quality?

There is evidence that it can, but it does not establish a current winner for Claude models. Liu and Han's preprint, submitted **3 October 2026**, compared fixed models across harnesses. With Qwen3.8-27B, Claude Code solved **347 of 444 paired tasks**, OpenCode **312**. The Qwen3.6 gap was not statistically significant. Costs also differed substantially ([paper and results](https://arxiv.org/html/2610.04433v1)).

Those runs used **Claude Code 2.1.259–2.1.273 and OpenCode 1.18.30–1.18.31**, with unequal time budgets on the local Qwen arms. Claude models were run only in Claude Code, so this is not evidence that today's Claude Code beats OpenCode 2 on Claude. OpenCode subsequently added output-limit continuation in 2.0.29, addressing one failure mode discussed in the paper ([changelog](https://opencode.ai/changelog)).

Before moving daily work, compare a bug fix and a multi-file change on separate clean branches. Hold the model, prompt and acceptance tests fixed. Record accepted diffs, interventions, time and cache-adjusted API cost. A cheaper request is useful only if it produces work you accept.

## Which should you choose?

| Your deciding need                                                | Start with                 | Purchase or setup check                                             |
| ----------------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------- |
| Use Claude's subscription allowance                               | Claude Code                | Does the plan cover your working week?                              |
| Mix providers or run local inference                              | OpenCode                   | Is your chosen model good enough for your tasks?                    |
| Keep Max and try another harness                                  | Both                       | Claim eligible API credits and use the linked organization's key    |
| Review actions with a classifier and optionally sandbox the shell | Claude Code                | Check the active mode; enable the sandbox                           |
| Modify or embed the agent                                         | OpenCode                   | MIT source; V2 plugins and server integrations need their own ports |
| Keep tasks running with your laptop closed                        | Claude Code cloud sessions | OpenCode remote pairing needs its host to remain running            |

Claude Code's [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web) run on Anthropic infrastructure. OpenCode's [remote pairing](https://opencode.ai/changelog) reaches a running OpenCode host; you can keep a separate host online, but pairing alone does not supply one.

## Frequently asked questions

**Can I use Claude Max with OpenCode?** Use an Anthropic API key, with eligible Max API credits claimed in the linked organization. That is separate from routing OpenCode through your Max subscription allowance ([credit coverage](https://support.claude.com/en/articles/17154008-monthly-api-credits-for-max-and-team-plans), [authentication guidance](https://support.claude.com/en/articles/13189465-log-in-to-your-claude-account)).

**Is OpenCode free?** The MIT-licensed software is free. Hosted inference is a separate purchase unless a provider includes it in an existing plan or promotion; local inference needs your own hardware ([providers](https://docs.opencode.ai/docs/providers/)).

**Will Anthropic ban me for using OpenCode?** Anthropic's staff recommended the API route. Its current rules prohibit disguised clients and attempts to charge third-party traffic against subscription limits. An API key still carries Anthropic's usage terms ([staff response](https://github.com/anthropics/claude-code/issues/17118#issuecomment-3730286463), [authentication rules](https://support.claude.com/en/articles/13189465-log-in-to-your-claude-account)).

**Does OpenCode read CLAUDE.md?** V1 uses it as a fallback. V2 currently discovers `AGENTS.md`; move the relevant instructions there or configure instruction files explicitly ([V2 instructions](https://opencode.ai/v2/docs/instructions/)).


## Voyager is a desktop AI agent for creative work

Describe what you want to make; Voyager plans it, uses your apps and tools, and keeps everything editable.

[Sign up](/sign-up)