Which to pick
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.
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
| OpenCode | Claude Code | |
|---|---|---|
| License | MIT (anomalyco/opencode) | No license file detected by GitHub in anthropics/claude-code |
| Models | Many providers via /connect, any OpenAI-compatible endpoint, local via Ollama, LM Studio or llama.cpp | Claude models. Anthropic doesn't support routing it to non-Claude models through a gateway |
| How you pay | Free to install; you pay your model provider. Optional OpenCode Go plan at $10/month | Requires 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 file | AGENTS.md. OpenCode 1 falls back to CLAUDE.md; OpenCode 2 reads AGENTS.md only | CLAUDE.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 |
| Headless | opencode run with --format json | claude -p with --output-format json |
| Default permissions | Permissive: most tools allowed; .env reads denied; outside-directory access asks | Permission 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:
| Pair | Index | Terminal-Bench 4.0 | Avg API cost / task |
|---|---|---|---|
| Claude Code + Sonnet 5.5 (max) | 68.4 | 66.2% | $14.19 |
| Claude Code + Sonnet 5.5 (xhigh) | 62.9 | 58.1% | $3.33 |
| OpenCode + GLM-5.3 (max) | 53.6 | 39.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:
@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.
Get new rigs by email
New job recipes and harness changes, a few times a month. Each one with copy-ready config and dated sources.
Sources
- OpenCode 1 docs: rules · checked Oct 18, 2026
- OpenCode 2 docs: instructions · checked Oct 18, 2026
- OpenCode 1 docs: providers · checked Oct 18, 2026
- OpenCode 1 docs: permissions · checked Oct 18, 2026
- OpenCode 1 docs: CLI · checked Oct 18, 2026
- OpenCode 1 docs: TUI (/undo) · checked Oct 18, 2026
- OpenCode 2 docs: intro · checked Oct 18, 2026
- OpenCode 2 docs: MCP servers · checked Oct 18, 2026
- Claude Code docs: CLAUDE.md, AGENTS.md and memory · checked Oct 18, 2026
- Claude Code docs: MCP · checked Oct 18, 2026
- Claude Code docs: checkpointing · checked Oct 18, 2026
- Claude Code docs: run Claude Code programmatically · checked Oct 18, 2026
- Claude Code docs: setup · checked Oct 18, 2026
- Claude Code docs: LLM gateway · checked Oct 18, 2026
- Claude pricing · checked Oct 18, 2026
- Artificial Analysis: Coding Agent Index v1.5 · checked Oct 18, 2026
- GitHub repo metadata (license, last push), via the GitHub API · checked Oct 18, 2026
Spotted something out of date? Email sternberg@mail.grokbot.com.