Most "OpenCode vs Claude Code" write-ups I find were written in spring, and they hold up on the big picture: Claude Code is Anthropic's tightly integrated agent, OpenCode is the open-source one you can point at almost any model. What they miss is that OpenCode shipped a V2 since then, and V2 changed the config format my team actually edits every week. So this is a narrower comparison: the parts that touch day-to-day setup, written after moving my team's config back and forth between the two.
One scoping note first. Both tools are for changing code that already exists. When the job is a brand-new product surface from nothing, a landing page plus a companion app, I don't open either of them; I use begin, which builds a website, iOS app, Android app or Chrome extension from one prompt. Everything below is about the other case, an existing repo with tests and reviewers.
OpenCode vs Claude Code: the short version
| Claude Code | OpenCode | |
|---|---|---|
| License | Proprietary | Open source |
| Models | Claude, via subscription, Console, or Bedrock / Google Cloud / Microsoft Foundry | 75+ providers via Models.dev, local models, plus optional Zen and Go |
| Surfaces | Terminal, VS Code, JetBrains, desktop app, web | Terminal, desktop app, IDE extension (V1); terminal, desktop, web (V2) |
| Project memory |
CLAUDE.md, can also read AGENTS.md
|
AGENTS.md, falls back to CLAUDE.md
|
| Permission precedence | deny, then ask, then allow | Last matching rule wins |
| Built-in subagents | Explore, Plan, general-purpose | General, Explore, Scout |
| Entry price | Pro at $20/month ($17/month billed annually) | Free; you pay your model provider, or Go at $10/month |
If you only read one row, read "Permission precedence". It's the one that caused real surprises for us.
What changed with OpenCode V2
The V2 migration guide lists three intentional breaking changes: a new plugin API, new server API contracts, and terminal client config moving from layered tui.json files into one global cli.json (migrated automatically). V1 and V2 both use the opencode command and no longer install side by side, so remove a package-managed V1 before installing V2.
The good news: V2 reads your existing opencode.json from the same locations as V1 and normalizes V1 fields in memory, so agents, commands and skills in .opencode/ keep working. The part I'd flag is permissions. V2 replaces the per-tool permission object with an ordered permissions array, and renames actions: bash becomes shell, task becomes subagent, and write/patch fold into edit. Your V1 file still loads, but every doc example and every snippet a teammate pastes from now on will be in the new shape.
V2 install, from the official docs:
# OpenCode V2
curl -fsSL https://opencode.ai/v2/install | bash
# or
npm install -g @opencode/cli
# Claude Code (macOS, Linux, WSL)
curl -fsSL https://claude.ai/install.sh | bash
Permissions: same words, opposite logic
Both tools use allow / ask / deny. They resolve conflicts in opposite ways, and this is where copying a rule from one to the other goes wrong.
Claude Code evaluates deny first, then ask, then allow. The first match in that order decides, and specificity doesn't matter. The docs spell out the consequence: a broad deny like Bash(aws *) blocks aws s3 ls even if you also have an allow rule for exactly that. You can't carve an exception out of a deny.
OpenCode does the reverse. The last matching rule wins, so you write the broad rule first and the exceptions after it. That's true in V1's object syntax and in V2's array.
Here is the same intent, "ask before shell commands, allow git status and diff, never push", in both:
Claude Code, in .claude/settings.json:
{
"permissions": {
"allow": ["Bash(git status *)", "Bash(git diff *)"],
"deny": ["Bash(git push *)", "Read(./.env)"]
}
}
OpenCode V2, in opencode.jsonc (order matters, last match wins):
{
"$schema": "https://opencode.ai/config.json",
"permissions": [
{ "action": "shell", "resource": "*", "effect": "ask" },
{ "action": "shell", "resource": "git status *", "effect": "allow" },
{ "action": "shell", "resource": "git diff *", "effect": "allow" },
{ "action": "shell", "resource": "git push *", "effect": "deny" }
]
}
In Claude Code I don't need the catch-all "ask" line, because Manual mode already prompts for Bash commands outside a built-in read-only set. In OpenCode the catch-all matters. V1 starts from permissive defaults where most permissions are allow (with .env reads denied, and doom_loop and external_directory set to ask). The V2 docs say that when no rule matches, OpenCode uses ask. If your team moved from V1 to V2 without writing explicit rules, the number of prompts you see may change. Check before you assume either behavior.
The other difference is how you skip prompts. Claude Code has named modes: Manual (default), acceptEdits, plan, auto, where a background classifier reviews actions instead of you, dontAsk, and bypassPermissions. OpenCode has opencode --auto, which approves anything not explicitly denied. Deny rules still hold in both, so write your denies first and your conveniences second.
Memory files: you can share one
This used to be a migration headache and mostly isn't anymore.
- Claude Code reads
CLAUDE.mdat the start of every session, and its docs say it can read an existingAGENTS.mdon its own or alongsideCLAUDE.md. - OpenCode reads
AGENTS.mdand usesCLAUDE.mdas a fallback when noAGENTS.mdexists. It also falls back to~/.claude/CLAUDE.mdfor global rules and picks up~/.claude/skills/.
So a single committed AGENTS.md works for a mixed team. The trap is the global fallback. If you run both tools on one machine, OpenCode will quietly load your personal Claude Code instructions unless you have a ~/.config/opencode/AGENTS.md. If that isn't what you want, set OPENCODE_DISABLE_CLAUDE_CODE=1 (or the narrower _PROMPT and _SKILLS variants).
Subagents and agents
The two are closer here than the marketing suggests. Both delegate to a child agent with its own context and return a result to the parent.
OpenCode gives you two primary agents you cycle with Tab, Build (everything enabled) and Plan (edits and bash set to ask), plus three subagents: General, Explore (read-only codebase search) and Scout, which is read-only research on external docs and dependency source. You can also @-mention a subagent directly. Custom agents live in .opencode/agents/*.md or in opencode.json, each with its own model and permissions. In practice that means a cheap model for search and a strong one for edits, in the same session.
Claude Code ships Explore, Plan and general-purpose, with custom agents in .claude/agents/, and adds background agents and cloud routines on top. Model choice per agent exists, but it's choice within Claude, unless you route the whole tool through Bedrock, Google Cloud, Foundry or an LLM gateway via ANTHROPIC_BASE_URL.
Cost: a subscription vs. a meter
| Claude Code | OpenCode | |
|---|---|---|
| Tool | Included with Pro / Max / Team / Enterprise | Free |
| Cheapest paid path | Pro: $20/month, or $17/month billed annually | Go: $10/month |
| Heavier use | Max from $100/month, 5x or 20x Pro usage | Go Plus: $40/month, or pay-per-request on Zen |
| Pay as you go | Console API tokens | Any provider key you already have |
| Limit shape | Plan usage limits | Go: per-model dollar caps, 5-hour = 20% and weekly = 50% of the monthly cap |
For API-billed teams, Anthropic's cost docs give a useful anchor. Across enterprise deployments the average is about $13 per developer per active day and $150–250 per developer per month, with 90% of users under $30 per active day.
One detail I didn't expect: OpenCode's own Go docs list Claude Code as a validated client for the Go endpoint. If the reason you're looking at OpenCode is cheap open models rather than the open harness, that's worth knowing.
Where I landed
- Claude Code for the repos where review quality matters most and the team is already on Claude plans. Deny-first rules are easier to audit, and the modes are better for people who don't want to think about config.
- OpenCode for experiments with new open models, for anyone who wants a local or non-Anthropic provider, and wherever we want permissions with real exceptions ("deny all edits except these docs paths"), which last-match-wins handles cleanly.
-
One
AGENTS.mdcommitted to every repo, so switching tools costs nothing.
FAQ
Is OpenCode a free alternative to Claude Code?
The tool is free and open source. Model usage isn't, unless you use a free model. You bring a provider key, log in with GitHub Copilot or ChatGPT Plus/Pro, or subscribe to OpenCode Go.
Can OpenCode use Claude models?
Yes. Anthropic is one of the providers it supports, alongside OpenAI, Google and local models.
Does OpenCode read CLAUDE.md?
Yes, as a fallback when there's no AGENTS.md, plus ~/.claude/CLAUDE.md globally. Turn it off with OPENCODE_DISABLE_CLAUDE_CODE=1.
Will my OpenCode V1 config work in V2?
Mostly. V2 reads V1 config from the same paths. Plugins and server API integrations need porting, and permissions are worth converting to the new ordered array so the rule order is explicit.
Closing
The honest summary of OpenCode vs Claude Code in late 2026: same agent loop, different opinions about who owns the harness, and permission semantics that are close to opposite. Pick based on that, keep your instructions in AGENTS.md, and read the OpenCode docs on permissions before you copy a rule across. When the task is a new product rather than a change to an old one, I still hand it to begin, because hosting, sign-in and Stripe payments come wired into the first build.
Top comments (0)