Get updates
Compare

OpenCode vs Claude Code

Claude Code is Anthropic's agent for Claude models, sold through Claude plans. OpenCode is an MIT-licensed agent that runs almost any model, including local ones. The real question is whether you want to be tied to one model vendor.

Checked against official docs on Oct 18, 202617 sourcesNo affiliate links

Which to pick

OpenCode

Pick OpenCode if…

you want to switch models freely, run local models through Ollama or LM Studio, sign in with an existing ChatGPT Plus/Pro plan, or need an open-source license you can audit and fork.

Claude Code

Pick Claude Code if…

you mostly use Claude models, want subagents, hooks and permission modes that Anthropic documents in depth, and are fine paying for a Claude plan (Pro or above) or Console usage.

Side by side

OpenCodeClaude Code
LicenseMIT (anomalyco/opencode)No license file detected by GitHub in anthropics/claude-code
ModelsMany providers via /connect, any OpenAI-compatible endpoint, local via Ollama, LM Studio or llama.cppClaude models. Anthropic doesn't support routing it to non-Claude models through a gateway
How you payFree to install; you pay your model provider. Optional OpenCode Go plan at $10/monthRequires Pro, Max, Team, Enterprise or Console. Pro is $20/month billed monthly ($17/month billed annually); Max from $100/month. The free plan doesn't include Claude Code
Instructions fileAGENTS.md. OpenCode 1 falls back to CLAUDE.md; OpenCode 2 reads AGENTS.md onlyCLAUDE.md. Reads AGENTS.md when no CLAUDE.md exists (v2.1.277+)
MCP config"mcp" in opencode.json (V2: mcp.servers)claude mcp add, .mcp.json for project scope
Headlessopencode run with --format jsonclaude -p with --output-format json
Default permissionsPermissive: most tools allowed; .env reads denied; outside-directory access asksPermission modes (default, acceptEdits, auto, dontAsk …) plus allow/deny rules
Undo/undo reverts file changes using Git (repo required)Automatic checkpoints before each prompt; /rewind (or Esc twice) restores files

Prices from claude.com/pricing and opencode.ai/v2/docs on Oct 18, 2026, excluding tax. Plans change; check before you buy.

What the benchmark says, and doesn't

Artificial Analysis tests harness + model pairs on its Coding Agent Index v1.5 (DeepSWE v1.1, Terminal-Bench 4.0 and SWE-Atlas-QnA). As shown on Oct 18, 2026:

PairIndexTerminal-Bench 4.0Avg API cost / task
Claude Code + Sonnet 5.5 (max)68.466.2%$14.19
Claude Code + Sonnet 5.5 (xhigh)62.958.1%$3.33
OpenCode + GLM-5.3 (max)53.639.9%$4.24

Run both on one repo

You don't have to choose per repo. Keep one AGENTS.md as the source of truth; both tools read it. Only add a CLAUDE.md if you need Claude-only notes, and import the shared file from it:

CLAUDE.md (only if you need Claude-specific rules)
@AGENTS.md

## Claude Code
Use plan mode for changes under `src/billing/`.

MCP servers need separate config in each tool. The MCP setup page has both formats.

FAQ

Is OpenCode free?

OpenCode is MIT-licensed and free to install. You pay for whatever model you connect, or nothing extra for a local model. OpenCode also sells an optional OpenCode Go plan at $10/month.

Can OpenCode read my CLAUDE.md?

OpenCode 1 uses CLAUDE.md as a fallback when there's no AGENTS.md, and reads ~/.claude/CLAUDE.md and ~/.claude/skills/. OpenCode 2 reads AGENTS.md only.

Does Claude Code work without a subscription?

You need a Pro, Max, Team or Enterprise plan, or a Claude Console account billed by usage. Bedrock, Google Cloud and Microsoft Foundry are also supported. The free Claude plan doesn't include it.

Which scores higher?

On Artificial Analysis's index, Claude Code's best tested pair (Sonnet 5.5 max, 68.4) is well above OpenCode's only tested pair (GLM-5.3, 53.6). But those runs used different models, so it isn't a clean harness-only comparison.

Sources

  1. OpenCode 1 docs: rules · checked Oct 18, 2026
  2. OpenCode 2 docs: instructions · checked Oct 18, 2026
  3. OpenCode 1 docs: providers · checked Oct 18, 2026
  4. OpenCode 1 docs: permissions · checked Oct 18, 2026
  5. OpenCode 1 docs: CLI · checked Oct 18, 2026
  6. OpenCode 1 docs: TUI (/undo) · checked Oct 18, 2026
  7. OpenCode 2 docs: intro · checked Oct 18, 2026
  8. OpenCode 2 docs: MCP servers · checked Oct 18, 2026
  9. Claude Code docs: CLAUDE.md, AGENTS.md and memory · checked Oct 18, 2026
  10. Claude Code docs: MCP · checked Oct 18, 2026
  11. Claude Code docs: checkpointing · checked Oct 18, 2026
  12. Claude Code docs: run Claude Code programmatically · checked Oct 18, 2026
  13. Claude Code docs: setup · checked Oct 18, 2026
  14. Claude Code docs: LLM gateway · checked Oct 18, 2026
  15. Claude pricing · checked Oct 18, 2026
  16. Artificial Analysis: Coding Agent Index v1.5 · checked Oct 18, 2026
  17. GitHub repo metadata (license, last push), via the GitHub API · checked Oct 18, 2026

Spotted something out of date? Email sternberg@mail.grokbot.com.

Related