CoralBack to the site

OpenCode vs Claude Code: open source or Anthropic’s agent

OpenCode vs Claude Code as of October 2026: open source vs closed, any model vs Claude, pricing, permissions, AGENTS.md and CLAUDE.md, and which to pick.

Updated

OpenCode is an open source (MIT) coding agent that runs any model from 75+ providers, in the terminal, a desktop app or your IDE. Claude Code is Anthropic’s closed source agent, built for Claude models and paid for with a Claude plan. Pick OpenCode if you want to choose your model, run local models or read the code; pick Claude Code if Claude is your model and you want it on a flat subscription.

As of October 2026. Both projects ship often, so check the linked docs.

Summary

OpenCodeClaude Code
Made byAnomalyAnthropic
SourceOpen, MITClosed
Where it runsTerminal UI, desktop app (beta), IDE extension, webTerminal, VS Code and Cursor extension, JetBrains, desktop app, web, mobile
Models75+ providers via Models.dev, plus local modelsClaude only (Anthropic, Bedrock, Google Cloud, Foundry)
Cost of the toolFreeComes with a Claude plan, or pay per token
Bring a subscriptionChatGPT Plus/Pro, GitHub Copilot, GitLab DuoClaude Pro, Max, Team, Enterprise
Claude Pro/Max loginNot allowed by Anthropic; use an API keyYes
Default permissionsMost tools allowed; asks outside the projectAuto mode with a classifier
InstructionsAGENTS.md, falls back to CLAUDE.mdCLAUDE.md, or AGENTS.md
ExtendJS/TS plugins, MCP, custom agentsHooks, MCP, skills, subagents, plugins

What each one is

OpenCode is “the open source AI coding agent” from opencode.ai. It has over 215,000 GitHub stars and is MIT licensed, so you can fork it, audit it and run it anywhere. It ships a terminal UI, a desktop app in beta for macOS, Windows and Linux, an IDE extension, and a web version. Install it with:

curl -fsSL https://opencode.ai/v2/install | bash

npm, Homebrew, Arch, Nix and mise packages exist too. On Windows the docs recommend WSL.

Claude Code is Anthropic’s agent. Install it with curl -fsSL https://claude.ai/install.sh | bash, then run claude in a project. The same engine runs in VS Code (and Cursor), JetBrains, the Claude desktop app and on the web (overview). Its source isn’t public: the GitHub repo is for issues and its license says “All rights reserved”.

Models and pricing

This is the core difference.

OpenCode works with almost any model. Run /connect to add a provider and /models to switch. Options (providers docs):

  • Free models. Big Pickle plus promotional models, about 200 requests a day, no account.
  • OpenCode Zen. Pay as you go for a curated set of models tested for coding agents, at provider cost plus a $1.23 card fee per $20 top-up (Zen).
  • OpenCode Go. $10/month, or Go Plus at $40/month, for low-cost models like Kimi, GLM, Qwen, DeepSeek, MiniMax, GPT 6 Luna and Claude Haiku 5.5, with limits per 5 hours, week and month (Go).
  • Your subscriptions. ChatGPT Plus/Pro, GitHub Copilot and GitLab Duo log in directly.
  • Your API keys. Anthropic, OpenAI, Google, Bedrock, Azure, xAI and more, or local models through an OpenAI-compatible server.

One catch for Claude fans: OpenCode’s docs say Anthropic explicitly prohibits using Claude Pro/Max subscriptions in it, and OpenCode stopped bundling those plugins in 1.3.0. To use Opus or Sonnet in OpenCode you pay API prices with a key.

Claude Code runs Claude. It defaults to Opus 5.5 on paid plans; /model switches to Sonnet 5.5, Haiku 5.5 or Fable 5.1. Plans (pricing): Pro $20/month ($17 yearly), Max from $100/month (5x or 20x Pro usage), and Team seats. Usage resets on a five-hour and weekly window; see Claude Code usage limits. It can also run on an API key, Bedrock, Google Cloud or Microsoft Foundry.

The upshot: if you use a lot of Claude, Claude Code on a Max plan is usually cheaper than the same tokens through OpenCode. If you want cheaper or open-weight models, or switch models per task, OpenCode is the flexible one.

Permissions and sandboxing

OpenCode trusts by default. Its permissions resolve to allow, ask or deny per tool, per pattern and per agent. Most default to allow, so the build agent edits and runs shell commands without asking. It asks when the agent reaches outside the project (external_directory) or loops on the same call (doom_loop), and .env files are denied. The docs don’t describe an OS sandbox. To ask before every command, set it in opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "edit": "ask",
    "bash": "ask"
  }
}

The built-in plan agent (press Tab) is read-only and asks before bash.

Claude Code starts interactive sessions in auto mode (v2.1.283 and later), where a classifier reviews each action. Manual mode asks before edits and commands, acceptEdits approves edits, plan only reads. An OS sandbox for shell commands, Seatbelt on macOS and bubblewrap on Linux and WSL2, is off until you run /sandbox (permission modes).

Config files and extensibility

OpenCodeClaude Code
Project instructionsAGENTS.md, else CLAUDE.mdCLAUDE.md, else AGENTS.md
Global instructions~/.config/opencode/AGENTS.md, else ~/.claude/CLAUDE.md~/.claude/CLAUDE.md
Settingsopencode.json.claude/settings.json
Hooks and pluginsJS/TS plugins on about 30 events (tool.execute.before, permission.asked, session.idle…)Shell hooks on lifecycle events; plugin marketplaces
MCPYesYes
Agentsbuild, plan, @general, plus your ownSubagents, skills

Moving from Claude Code to OpenCode is gentle: OpenCode reads your project CLAUDE.md and ~/.claude/CLAUDE.md when there’s no AGENTS.md. Set OPENCODE_DISABLE_CLAUDE_CODE=1 to stop that.

Plugins are where OpenCode differs most. A plugin is a JavaScript or TypeScript file in .opencode/plugins/ that receives events and can change behavior, instead of a shell script that gets JSON. Claude Code’s hooks are shell commands, and its plugins bundle hooks, skills, subagents and MCP servers.

Where OpenCode is ahead

  • Open source. MIT, so you can audit, fork or self-host it.
  • Any model. Switch between Claude, GPT, Gemini, open-weight and local models in one session.
  • Cheap paths. Free models, Go from $10, and your existing ChatGPT or Copilot plan.
  • Privacy options. Local models keep code on your machine, and OpenCode says it doesn’t store your code or context.

Where Claude Code is ahead

  • Claude on a subscription. Opus 5.5 on a flat plan, which OpenCode can’t offer.
  • Safer defaults. A classifier reviews actions, and an OS sandbox is one command away.
  • Away from the desk. Cloud sessions, the Claude mobile app and scheduled tasks.
  • Enterprise. Bedrock, Google Cloud, Foundry and managed settings.

Pick OpenCode if…

  • You want to pick the model per task, or use open-weight or local models.
  • You already pay for ChatGPT or Copilot and want one agent for both.
  • Open source matters to you or your company.

Pick Claude Code if…

  • Claude is your main model and you want it on a Pro or Max plan.
  • You want a classifier and a sandbox rather than allow-by-default.
  • Your company buys AI through AWS, Google Cloud or Azure.

Running both

A common setup: Claude Code on a Max plan for the hard tasks, OpenCode with a cheaper model for chores or a second opinion. Give each its own git worktree, and keep shared rules in AGENTS.md. Run multiple Claude Code agents covers the setup.

Coral is a Mac app (with an iPhone app) that shows Claude Code and OpenCode, plus Codex, Copilot CLI and Grok, in one list in your Mac’s notch, the agent that has waited longest first. For OpenCode it adds one plugin file and tells you where. You answer with one key or from your iPhone, pick the model when you start an agent, and hand an agent off to a fresh session in Claude Code, Codex or OpenCode. It’s free, with an optional Pro plan. See Get started.

Questions

Is OpenCode better than Claude Code?

It depends on the model. With Claude models, Claude Code on a plan is the simpler and usually cheaper choice. For other or local models, or open source, OpenCode wins.

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

No. OpenCode’s docs say Anthropic prohibits it, and OpenCode removed those plugins in 1.3.0. Use an Anthropic API key, or ChatGPT, Copilot or GitLab Duo subscriptions, which OpenCode supports.

Is OpenCode free?

The tool is free and MIT licensed, and it includes free models with a daily limit. You pay for other models through Zen, Go ($10/month) or your own provider.

Does OpenCode read CLAUDE.md?

Yes, as a fallback. It reads AGENTS.md first, then CLAUDE.md in the project, and ~/.claude/CLAUDE.md globally.

Is Claude Code open source?

No. The anthropics/claude-code repo on GitHub is public, but its license reserves all rights.

Never leave an agent waiting.

Coral taps you in your Mac’s notch or on your iPhone when an agent needs you. Free.

Download for freeSee pricing

More guides

Coral alternatives and comparisons