Skip to content
← articles
updated OpenCodeClaude CodeAI CodingHarness EngineeringDeveloper Tools

OpenCode vs Claude Code: I Switched, Built Twelve Agents, and Came Back

I left Claude Code for OpenCode in May 2026, built a twelve-agent pipeline on open models, then came back. What OpenCode does better, what Claude Code does better, and the one variable that decided it for me: who pays for the tokens.

I did not leave Claude Code because it was bad. I left because I wanted to own the harness. I came back because of who pays for the tokens.

OpenCode is an open-source coding agent you configure down to the permission of each agent, with any of more than 75 model providers behind it. Claude Code is Anthropic’s harness, tuned for Claude models and covered by a Claude subscription. If you want open models, per-phase agents and your own rules, OpenCode is the better harness. If you want frontier Claude all day at a flat price, Claude Code is the only harness the plan covers.

I have run both for real work. On May 3, 2026, I moved off a $200 Max plan to OpenCode with open models, for two reasons: cost, and learning to manage tokens when every one of them has a visible price. I built twelve agents. Then I came back. This is the report.

The round trip

Claude Code, OpenCode, and back

  1. Before May 2026Claude Code on Max 20x

    Daily driver at $200 a month. The harness I knew best, on the model it was built for.

  2. Switch to OpenCode with open models

    Seven primary agents and five hidden subagents on OpenCode Go: DeepSeek V4 Pro, GLM-5.1, Kimi K2.6 and Mimo V2.5 Pro.

  3. Plans in markdown, an explore tab, RTK

    Plans moved from JSON to markdown, an explore agent that cannot edit became the default, and RTK got its own permission.

  4. Same agents, flat-rate provider

    I moved the agents to a provider selling flat-rate access to open models. Its plans landed close to the price of a Claude plan.

  5. After thatBack to Claude Code on Max

    Open models at a frontier price was the wrong trade. I kept the OpenCode config in my agent config repo.

Dates come from my decision log and the commit history of my agent config repo. The return is the one step I never committed anywhere.

What OpenCode got right: the agent is the unit

OpenCode’s best idea is not a model or a feature. It is that an agent is a bundle of decisions you can name. Each agent carries its own model, temperature, step budget, prompt and permissions. Press Tab and you switch the whole bundle at once.

Here is the review agent from my config, exactly as it ran, with only the UI color removed:

"03-review": {
  "description": "Validates implementation against plan and criteria",
  "mode": "primary",
  "model": "opencode-go/glm-5.1",
  "temperature": 0.0,
  "steps": 4,
  "permission": {
    "edit": "deny",
    "bash": {
      "*": "ask",
      "bash *": "allow",
      "sh *": "allow",
      "cd *": "allow",
      "ls *": "allow",
      "cat *": "allow",
      "git *": "allow"
    }
  },
  "prompt": "{file:~/.config/opencode/prompts/review.md}"
}

Temperature zero, four steps, no edits, and a short shell allowlist where anything else has to ask. Its prompt checks eight categories (plan completeness, acceptance criteria, correctness, security, performance, style, error handling, edge cases) and returns APPROVE or REQUEST_CHANGES. One critical issue means REQUEST_CHANGES. It cannot quietly fix what it was supposed to report, because the harness will not let it touch a file.

The whole pipeline worked the same way:

The agents, before the provider switch

The two orchestrators hand work to hidden subagents: Mimo V2.5 Pro writes the design spec, Kimi K2.6 builds the components, and the creative pipeline plans, creates and refines. Twelve agents, four open models.
AgentModelTempStepsPermissions
00-exploreglm-5.10.7defaultno edits
01-plandeepseek-v4-pro0.27no edits, no shell
02-buildkimi-k2.60.112edits ask, shell allowlist
03-reviewglm-5.10.04no edits, short shell allowlist
04-fixdeepseek-v4-pro0.16edits ask, shell allowlist
05-designdeepseek-v4-pro0.28may call only its two subagents
06-creativedeepseek-v4-pro0.28may call only its three subagents
The two orchestrators hand work to hidden subagents: Mimo V2.5 Pro writes the design spec, Kimi K2.6 builds the components, and the creative pipeline plans, creates and refines. Twelve agents, four open models.

The plan agent’s prompt ends with one rule I would put in any harness: a developer should be able to implement this plan without asking questions. That is spec-driven development living inside the harness instead of beside it. Build is told to never add features that are not in the plan and never leave a TODO. Fix touches only critical and major issues and flags the rest.

None of this needs a frontier model. It needs a harness that lets you say no per agent. In pi, which has no modes of its own, I missed it enough to write the same idea as a package.

What Claude Code does better

Be fair to the product I came back to. Claude Code is a serious piece of engineering, and a 2026 study of its source, Dive into Claude Code, shows how much: a permission system with seven modes and a classifier, a five-layer compaction pipeline, four extension mechanisms (MCP, plugins, skills and hooks), and subagent orchestration, all around a simple loop.

The bigger advantage is the pairing. Anthropic tunes the harness and the model together. The system prompt, the tool descriptions and the compaction rules are written for Claude, and you feel it in long sessions. In OpenCode I was the one tuning prompts for four models with four different habits.

And it is still very customizable from the inside. Skills, hooks, subagents, path-scoped rules, plugins and MCP cover most of what I wanted from OpenCode’s agents. What you cannot do on the subscription is swap the harness itself.

OpenCode

  1. 01Any of 75+ providers, local models included
  2. 02Agents with their own model, temperature, steps and permissions
  3. 03Permissions per command pattern: allow, ask or deny
  4. 04You tune prompts per model, and you own the result
  5. 05Open source, so you can read what the harness does

Claude Code

  1. 01Claude models, tuned together with the harness
  2. 02Skills, hooks, subagents, plugins and MCP for customization
  3. 03Permission modes and plan mode built in
  4. 04Anthropic tunes the prompts, you configure around them
  5. 05Covered by a Claude plan, the cheapest frontier tokens per dollar
Same job, two philosophies. Neither column is a mistake.

The variable that decided it: who pays for the tokens

No feature table shows this part. Since April 4, 2026, a Claude Pro or Max plan covers Anthropic’s own products: Claude Code, Cowork and the Claude apps. A third-party harness that logs in with the plan bills as extra usage at API rates. OpenCode’s own provider docs say it plainly: Anthropic explicitly prohibits using Claude Pro or Max through plugins in OpenCode.

So OpenCode with Claude means API prices. OpenCode with open models means cheap tokens, as long as the plan for those models stays cheap. OpenCode Go starts at $10 a month today. When I moved my agents to a flat-rate provider in July, its plans landed close to the price of a Claude plan, for models that are not frontier. At that point I was paying frontier money for non-frontier tokens, and Claude Code on Max won on plain arithmetic.

The logs make it concrete. ccusage puts all of my August in OpenCode and Hermes at $6.23 at API prices, against a plan that cost more than ten times that. My first four days back on Claude Code came to $626 at API rates, against $200 for a month of Max 20x. The full numbers are in is Claude Max worth it.

I was sad about it, and I will say so. I do not like losing the heavy harness customization. Owning the agent bundle, the permissions and the model per phase is the reason I left in the first place.

Can I use Claude Code with other models?

Yes. Claude Code talks to any endpoint that speaks Anthropic’s API through ANTHROPIC_BASE_URL, and Ollama documents exactly that setup for local and cloud open models. It works. It is also off the happy path: the harness was tuned for Claude, and an open model will not respond to its prompts the way Claude does. If open models are the plan, a harness built for many providers, like OpenCode or pi, is the better home.

Who should run which

OpenCode or Claude Code

  • Required:
    You code with frontier Claude most of the dayClaude Code on a Max plan. Nothing else gives you that model capacity at a flat price.
  • Required:
    You want open models or several providersOpenCode. It was built for many providers, and its agents let a strict harness carry cheaper models.
  • Optional:
    You want your own harness on a flat frontier planOpenCode on ChatGPT Plus or Pro, since September 29. Watch the weekly app limit and the October 30 Pro change.
  • Anti-pattern:
    You want to plug your Claude plan into OpenCodeAnthropic prohibits it. Use an API key and pay per token, or stay in Claude Code.

The lesson I kept from the round trip is not about either tool. Explore cannot edit. Plan cannot run commands. Review cannot fix. Those rules made four open models usable, and they work just as well around Claude. I explain where they fit in the best AI for coding, and why the harness matters more than the model in what an agent harness is.

OpenCode vs Claude Code, quick answers

Is OpenCode better than Claude Code?

OpenCode is the better harness if you want open models, several providers, and agents with their own model and permissions. Claude Code is the better choice if you want frontier Claude models all day at a flat price, because a Claude plan covers Anthropic's harness and not third-party ones.

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

No. Since April 4, 2026, third-party harnesses that log in with a Claude plan bill as extra usage, and OpenCode's documentation states that Anthropic explicitly prohibits using Claude Pro or Max through plugins in OpenCode. Use an Anthropic API key instead, billed per token.

Can I use ChatGPT Plus or Pro in OpenCode?

Yes. OpenCode supports signing in with ChatGPT Plus or Pro, and since September 29, 2026, OpenAI officially lets Plus and Pro subscribers use their plan in participating tools, with OpenCode among the launch partners. You can set a weekly usage limit per app in ChatGPT settings.

Is OpenCode free?

OpenCode itself is open source and free. You pay for the models: bring an API key, sign in with a supported plan, run local models, or use OpenCode Go, its own plan for open coding models, from $10 a month.

What are agents and modes in OpenCode?

Agents are named configurations, each with its own model, temperature, step budget, prompt and permissions. Primary agents are the ones you switch between with Tab; subagents are called by other agents or with an @ mention. Permissions for edit, bash and webfetch can be allow, ask or deny, and bash can be set per command pattern.

Can I use Claude Code with Ollama or other models?

Yes, through an endpoint that speaks Anthropic's API, set with ANTHROPIC_BASE_URL. Ollama documents this for local and cloud models. It works, but Claude Code is tuned for Claude, so a harness built for many providers is usually a better fit for open models.