OpenCode vs Claude Code is a choice between model freedom and a polished first-party agent. OpenCode is a free, MIT-licensed coding agent that runs models from more than 75 providers, local ones included, and since 30 October it can also use a Claude Pro or Max subscription by driving your installed copy of Claude Code. Claude Code is Anthropic's closed-source agent for Claude models, with features OpenCode doesn't have: a classifier-based auto mode, an operating-system sandbox for shell commands, cloud sessions and a maintained GitHub Action.
Price follows the model more than the tool. The same month of daily agent work costs $20 on a Claude Pro plan or $282.24 on Claude Opus 5.5 at API prices, in either tool. Move to an open model in OpenCode and the month costs $7.47 with DeepSeek V4.1 Flash on DeepSeek's own key off-peak, or fits inside the $10 OpenCode Go plan. Everything below was checked on 5 November 2026 against OpenCode 2.2.5 (30 October) and Claude Code 2.1.318 (3 November).
OpenCode vs Claude Code at a glance
| OpenCode 2.2.5 | Claude Code 2.1.318 | |
|---|---|---|
| License | MIT, open source | Proprietary, "All rights reserved" |
| Cost of the tool | Free, with some free models | Needs a paid Claude plan, an API key or a cloud account |
| Models | 75+ providers through models.dev, plus Ollama, LM Studio and vLLM | Claude models; other models only through unsupported gateways |
| Subscriptions it can use | ChatGPT Plus or Pro, GitHub Copilot, Claude (through Claude Agent) | Claude Pro, Max, Ultra, Team, Enterprise |
| Where it runs | Terminal, desktop app, browser via opencode pair | Terminal, VS Code, JetBrains, desktop app, web and mobile |
| Default permissions | Everything allowed except reading .env files | Asks the first time each tool is used |
| Hands-off mode | Your own allow and deny rules | Auto mode (a classifier reviews actions) and a Bash sandbox |
| Project instructions | AGENTS.md only | CLAUDE.md, or AGENTS.md when there's no CLAUDE.md |
| Extensions | Plugins, agents, skills, commands, MCP | Plugins, hooks, skills, subagents, MCP |
| CI | GitHub Action removed in 2.2.0 | Claude Code GitHub Actions |
| GitHub stars, 5 Nov | 224,559 | 154,531 |

Both install with one command. OpenCode 2 uses curl -fsSL https://opencode.ai/v2/install | bash or npm install -g @opencode/cli; the older opencode-ai npm package still installs OpenCode 1. Claude Code uses curl -fsSL https://claude.ai/install.sh | bash, and the Claude Code install guide covers the other platforms.
Model choice: OpenCode's clearest advantage
OpenCode's provider docs cover nearly every route to a model. Run /connect, pick a provider, paste a key or sign in, then choose a model with /models:
- Pay-per-token keys for Anthropic, OpenAI, Google, xAI, DeepSeek, OpenRouter, Bedrock, Azure, Vertex and others in the models.dev catalog.
- Sign-ins that bill an existing plan: ChatGPT Plus or Pro, GitHub Copilot, and Claude through the Claude Agent provider described below.
- Local models. OpenCode finds Ollama at
127.0.0.1:11434without any setup, and LM Studio and vLLM at their default ports. - Any OpenAI-compatible endpoint, as a custom provider with a base URL and a model list.
- OpenCode's own services: Zen, the pay-as-you-go model gateway now listed as OpenCode Console, and Go, a $10, $40 or $20-per-member monthly plan for open models. The OpenCode Zen post covers both in detail.
You can switch models in the middle of a session, and a subagent can use a different model from its parent, so a Claude model can plan while a low-cost model does the edits.
Claude Code is built for Claude. It defaults to Opus 5.5 on every plan and on the API, and it can reach Claude through Bedrock, Google Cloud and Microsoft Foundry. Pointing ANTHROPIC_BASE_URL at an Anthropic-compatible gateway does work with other models: OpenCode's own Claude Code guide runs claude --model gpt-6.1-sol that way, and the Terminal-Bench 4.0 leaderboard lists Claude Code on GLM-5.3 at 41.8%. But Anthropic's gateway docs say it "doesn't support routing Claude Code to non-Claude models through any gateway", so you're on your own when something breaks.
Features and day-to-day use
The biggest day-one difference is permissions. Claude Code's default mode asks the first time each tool runs, and its permission modes go from plan mode (read-only) to auto mode, where a background classifier checks shell commands and network requests before they run. An optional OS-level sandbox limits which files and hosts Bash commands can reach.
OpenCode 2 starts from the other end. Its default policy allows every action and asks only before reading .env files, and paths outside the project are allowed too, a change from OpenCode 1, which asked. To get prompts back, add rules to opencode.jsonc (the last matching rule wins):
{
"$schema": "https://opencode.ai/config.json",
"permissions": [
{ "action": "shell", "resource": "*", "effect": "ask" },
{ "action": "shell", "resource": "git status *", "effect": "allow" },
{ "action": "shell", "resource": "git push *", "effect": "deny" },
{ "action": "external_directory", "resource": "*", "effect": "ask" }
]
}
The rest of the day-to-day comparison:
- Both have a read-only plan mode, subagents with their own context, undo (
/undoand/redoin OpenCode, checkpoints and rewind in Claude Code), skills and MCP servers. - OpenCode runs several sessions on one project in parallel, has a
/goalcommand that keeps a session working until a review step confirms the objective is met, and opt-in scheduled prompts. - Claude Code adds cloud sessions on claude.ai/code, the mobile app, IDE extensions for VS Code and JetBrains, and an official GitHub Action that answers
@claudein issues and pull requests. OpenCode stopped publishing its GitHub Action in 2.2.0. - OpenCode 2 no longer runs language servers. Its migration guide says it "does not run language servers, expose LSP tools, or produce LSP diagnostics", so use your linter and type checker instead.
Extensibility is close. Claude Code has hooks, plugins, skills and subagents. OpenCode has plugins, Markdown agents, commands and skills, and its server API lets other apps drive it. OpenCode 2 changed the plugin API, so plugins written for OpenCode 1 have to be ported.
Moving between the two is easier than it looks. OpenCode 2 reads only AGENTS.md and ignores CLAUDE.md, while Claude Code 2.1.277 and later reads AGENTS.md when a project has no CLAUDE.md (memory docs). Rename the file to AGENTS.md and both tools follow it. OpenCode also loads skills from .claude/skills, so existing Claude Code skills work as they are.
Using Claude models in OpenCode
There are three ways, and they bill differently:
| Route | Setup | Billed to | Notes |
|---|---|---|---|
| Anthropic API key | /connect, choose Anthropic, paste the key | Your Claude Console account, per token | Supported by both companies |
| Claude Agent provider (OpenCode 2.2.3 and later) | Install Claude Code, run claude auth login, then /connect and choose Claude Agent | Your Claude plan's usage limits, or whatever login Claude Code has | New on 30 October, details below |
| Zen (OpenCode Console) | Prepaid balance and an oc_sk_ key | OpenCode, per token | Same list price as Anthropic on Opus 5.5; Sonnet 5.5 cache reads cost twice as much |
The subscription login: status in November 2026
Claude subscriptions left OpenCode early in 2026. In January, Anthropic began rejecting Claude subscription logins sent from third-party tools, OpenCode included (Hacker News, 15 January), and on 19 March OpenCode merged a pull request titled "anthropic legal requests" that removed its bundled Claude login plugin. OpenCode 1's docs still say community plugins for this exist and that "Anthropic explicitly prohibits this."
On 30 October, OpenCode announced that Claude subscriptions work again, through a different design. The Claude Agent provider in OpenCode 2.2.3 never reads or forwards your Claude login. It starts the claude program you installed, through Anthropic's Claude Agent SDK, and Claude Code makes every request with its own login. Anthropic's legal page says its rules don't stop a user "signing in to the unmodified Claude Code binary" with their own subscription, and its help article on the Agent SDK says Agent SDK and third-party app usage draws from your plan's limits.
One gap remains. The Agent SDK docs say that "unless previously approved", third-party products may not offer claude.ai login. An OpenCode maintainer wrote in the pull request that the team has Anthropic's permission and that the setup complies with Anthropic's terms. Anthropic hadn't said anything publicly about it by 5 November, so treat it as approved by OpenCode's account only.
To set it up:
curl -fsSL https://claude.ai/install.sh | bash # Claude Code 2.1.248 or later
claude auth login # sign in with your Pro, Max or Ultra plan
opencode # then /connect, choose Claude Agent, then /models
What changes when Claude runs through OpenCode
According to OpenCode's design spec, Claude Code's own tools are switched off and Claude gets OpenCode's tools instead, so there's one permission system and you can switch models mid-session. Claude Code's settings, CLAUDE.md, hooks, MCP servers and skills aren't loaded; OpenCode's versions apply. Auto mode, the Bash sandbox, cloud sessions, /loop and /usage for plan limits aren't available, and the provider doesn't work in hosted OpenCode or remote workspaces.
Watch your limits in the first weeks. A GitHub issue opened on 1 November reports the 5-hour limit draining about 1.8 times faster than in Claude Code itself, which the reporter traces to how the SDK labels its requests; a fix is in review. Another reports lower prompt-cache reuse on Opus 5.5 than in native Claude Code. If your plan's limits already feel tight, use Claude Code directly for Claude-heavy days.
OpenCode vs Claude Code cost: the same month of work
To compare like with like, take the daily month from the Claude Code pricing breakdown: 20 working days, 300 model calls a day, 60,000 tokens of context per call (92% cache reads, 8% new), and 600 output tokens per call, thinking included. That's 331.2 million cache-read tokens, 28.8 million new input tokens and 3.6 million output tokens. Prices are list prices on 5 November.
| Tool and route | Model | Month |
|---|---|---|
| Claude Code, Pro plan | Opus 5.5 or Sonnet 5.5 | $20, if the limits hold your usage |
| Claude Code, Max plan | Opus 5.5 or Sonnet 5.5 | $100 |
| Claude Code, API key | Sonnet 5.5 | $141.12 |
| Claude Code, API key | Opus 5.5 | $282.24 |
| OpenCode, Claude Agent on Pro | Opus 5.5 or Sonnet 5.5 | $20, with limits reported to drain faster |
| OpenCode, Anthropic key | Opus 5.5 | $282.24 |
| OpenCode, Zen | Opus 5.5 | $296.10 |
| OpenCode, Zen | Sonnet 5.5 | $182.80 |
| OpenCode, OpenAI key | GPT-6.1 Sol | $141.12 |
| OpenCode, Go plan | DeepSeek V4.1 Flash | $10 (the month uses 7.5% to 15% of the model's allowance) |
| OpenCode, DeepSeek key, off-peak | DeepSeek V4.1 Flash | $7.47 |
| OpenCode, DeepSeek key, peak | DeepSeek V4.1 Flash | $14.95 |
| OpenCode, Ollama | A local model | $0 in tokens, plus your hardware |

What the table shows:
- For Claude models, the tool doesn't change the token bill. A Claude plan costs least for daily use in either tool, and Claude Code gets more out of the same plan for now, going by the reports above.
- Zen adds a 4.6% plus $0.31 processing fee to each purchase of prepaid balance ($296.10 assumes $100 purchases), and lists Sonnet 5.5 cache reads at $0.20 against Anthropic's $0.10, which is why its Sonnet month costs $182.80 instead of $141.12.
- OpenCode's real saving comes from open models. DeepSeek's off-peak hours (outside 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays, per its pricing page) cover the whole US working day.
- Go's allowance is set per model in dollars. The $10 plan covers $100 a month of DeepSeek V4.1 Flash but only $15 of GLM-5.3 or Kimi K3.1 Pro, and the same month on GLM-5.3 comes to $142.27 at list price, so on Go the larger open models suit lighter use.
A lower-priced model doesn't do the same work, though. On Artificial Analysis's Coding Agent Index, Claude Code with Opus 5.5 scores 62 at $11.42 per task, and OpenCode with GLM-5.3 scores 49 at $5.23. Claude Code's own score falls to 43 at $1.84 per task when it runs Step 5 Preview, which suggests the model drives most of the difference. Neither Artificial Analysis nor Terminal-Bench has run OpenCode and Claude Code on the same model.
The arithmetic, to redo with your own counts from /usage or a provider dashboard:
def month(cache_read, new_input, output, calls=6_000, context=60_000,
read_share=0.92, out_tokens=600):
"""US$ for one month. Prices are per 1M tokens; new_input is the
cache-write price where the provider charges one, else the input price."""
m_read = calls * context * read_share / 1e6
m_new = calls * context * (1 - read_share) / 1e6
m_out = calls * out_tokens / 1e6
return round(m_read * cache_read + m_new * new_input + m_out * output, 2)
print(month(0.20, 5.00, 20.00)) # Claude Opus 5.5: 282.24
print(month(0.10, 2.50, 10.00)) # Claude Sonnet 5.5 or GPT-6.1 Sol: 141.12
print(month(0.003, 0.15, 0.60)) # DeepSeek V4.1 Flash, off-peak: 7.47
Which one to pick

Pick Claude Code if:
- Most of your work runs on Claude models and you pay for a Claude plan. It gets the most out of the plan's limits and has every feature on day one.
- You want guardrails by default: permission prompts, auto mode's classifier and the Bash sandbox.
- You use cloud sessions, the mobile app, the GitHub Action or the JetBrains plugin.
Pick OpenCode if:
- You want to switch between Claude, GPT, DeepSeek, GLM and local models, or route easy work to low-cost models.
- You already pay for ChatGPT Plus or GitHub Copilot and want to use that plan in a terminal agent.
- Code can't leave your machine, and a local model through Ollama, LM Studio or vLLM is good enough.
- You need an open-source agent you can audit, fork or embed through its server API.
Running both is common: in a 4 November Hacker News thread on agent setups, several developers use Claude Code on a Claude plan and OpenCode for other models. If you're also weighing OpenAI's agent, see Codex vs Claude Code, and for more options, the Claude Code alternatives roundup.
Using Aight models in OpenCode
OpenCode accepts any OpenAI-compatible provider, so Aight can be configured as an OpenAI-compatible provider: one key for Claude, GPT, Gemini, DeepSeek and Grok models, at the makers' list prices on most models. Claude Code can't use Aight, because it speaks Anthropic's Messages API.
{
"$schema": "https://opencode.ai/config.json",
"model": "aight/claude-sonnet-5-5",
"providers": {
"aight": {
"name": "Aight",
"env": ["AIGHT_API_KEY"],
"package": "@opencode/ai/providers/openai-compatible",
"settings": { "baseURL": "https://api.getaight.ai/v1" },
"models": {
"claude-sonnet-5-5": { "name": "Claude Sonnet 5.5" },
"claude-opus-5-5": { "name": "Claude Opus 5.5" }
}
}
}
}
Set AIGHT_API_KEY to your sk-aight-... key before starting OpenCode. Aight's API reference lists only model, messages and stream as chat completion fields, so test tool calling with your own key before relying on it for agent work.
With the 10% extra on a $100 recharge ($103 paid for $110 of balance), the daily month costs $264.28 on Opus 5.5 and $132.14 on Sonnet 5.5. A Claude Pro or Max plan still costs less for daily Claude use, and DeepSeek's own key off-peak or Go costs less for DeepSeek, where Aight charges the flat peak price. What Aight adds is a monthly cap, an expiry date and an allowed-model list on each key.
What developers report
- "you can now use your claude subscription in OpenCode" (OpenCode on X, 30 Oct 2026, link)
- In a test on a Pro plan, the same
claude -pjobs moved the 5-hour meter about twice as much per dollar when labeled as SDK traffic; an OpenCode maintainer called it "a real degradation of the SDK." (GitHub issue #61072, 1 to 3 Nov 2026, link) - A user measured 3.9 times less prompt-cache reuse for Opus 5.5 through Claude Agent than in Claude Code, from aggregate sessions rather than a controlled test (GitHub issue #61282, 2 Nov 2026, link)
- On the $10 Go plan, running mostly DeepSeek Flash in OpenCode, the commenter had not yet hit the usage limit (a Hacker News commenter, 4 Nov 2026, link)
- "If you're just using the coding agent, you're not affected." (a Hacker News commenter on the 17 October OpenCode Console breach, 17 Oct 2026, link)
FAQ
Is OpenCode free?
The agent is free and MIT-licensed, and it comes with a few free models you can use without an account, though some of them may use your prompts for training. Everything else is billed by the provider you connect: a pay-per-token key, a ChatGPT, Copilot or Claude plan, Zen's prepaid balance or a Go subscription.
Is OpenCode better than Claude Code?
Not for Claude-only work. Claude Code on Opus 5.5 scores higher on Artificial Analysis's index than OpenCode on GLM-5.3, gets more out of a Claude plan, and has auto mode, sandboxing and cloud sessions. OpenCode is the better choice when you want other models, local models or an open-source tool.
Can a Claude Max subscription be used in OpenCode?
Yes, since OpenCode 2.2.3 on 30 October, through the Claude Agent provider, which needs Claude Code installed and signed in on the same machine. Usage counts against your plan's normal limits, and early reports say the 5-hour limit drains faster than in Claude Code. Older community plugins that copy your Claude token are a different thing, and Anthropic's terms prohibit them.
Does OpenCode read CLAUDE.md?
OpenCode 2 doesn't; it reads only AGENTS.md. Claude Code reads AGENTS.md when there's no CLAUDE.md, so renaming the file works for both tools.
Was OpenCode hacked?
On 17 October, OpenCode reported a breach of its Console service that exposed provider API keys some users had saved there, affecting 1.4% of Console users. BleepingComputer reported unauthorized charges of up to $1,700. The open-source agent and keys stored on your own machine weren't named as affected; if you saved provider keys in Console, rotate them.
Sources
- OpenCode docs: Install and intro, Providers, Provider accounts, Permissions, Agents, Skills, Instructions, Snapshots, Migrate from V1, Console models and pricing, Go, Claude Code harness, V1 providers, opencode.ai
- OpenCode on GitHub: repository, releases 2.2.0 to 2.2.5, PR #18186, PR #58782, Claude Agent provider spec, issues #61072 and #61282; @opencode/cli on npm
- OpenCode on X: 17 Oct 2026, 30 Oct 2026
- Claude Code docs: Overview, Permissions, Sandboxing, Checkpointing, Memory and AGENTS.md, Model configuration, LLM gateways, GitHub Actions, CLI reference, Legal and compliance, Agent SDK overview
- Anthropic: claude-code on GitHub, @anthropic-ai/claude-code on npm, API pricing, Plans and pricing, Use the Claude Agent SDK with your Claude plan
- Other prices: OpenAI API pricing, DeepSeek models and pricing
- Benchmarks: Artificial Analysis, Claude Code vs Opencode; Terminal-Bench 4.0 leaderboard
- Reporting and discussion: BleepingComputer, 19 Oct 2026; Zed, What Anthropic's new Claude billing means for Zed users; Hacker News threads 46625918, 50133401 and 50366117
- Aight: Models and pricing, API reference, Refund policy
Checked on 5 November 2026. Updated 17 November 2026: Aight's current model list; Claude Code 2.1.326 changes nothing else compared here.