OpenCode vs Claude Code: models, prices and token test
OpenCode is open source and works with the model you choose; Claude Code is Anthropic's own agent for Claude models. In our test on the same open-weight model, Qwen4 35B-A3B, both agents passed 9 of 9 checks, and Claude
OpenCode is open source and works with the model you choose; Claude Code is Anthropic's own agent for Claude models. In our test on the same open-weight model, Qwen4 35B-A3B, both agents passed 9 of 9 checks, and Claude Code used 2.2 to 3.7 times OpenCode's input tokens. This guide also compares what each maker publishes on licence, models and pricing. Checked against opencode.ai, claude.com and code.claude.com on 3 December 2026.
OpenCode vs Claude Code at a glance
Here is what Anomaly and Anthropic publish for each agent.
| OpenCode | Claude Code | |
|---|---|---|
| Licence | Open source under the MIT licence, built by Anomaly. | Proprietary. Its licence file reads "All rights reserved", under Anthropic's Commercial Terms of Service. |
| Models | More than 200 providers through Models.dev, including local models, plus any OpenAI-compatible endpoint you add. | Claude models, with Opus 5.5 as the default. Also works through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. |
| What you pay | Free agent; pay for the model you connect. Optional plans: OpenCode Go $10/month, Go Plus $40/month, Go Teams $20/member/month. | Claude plan (not Free) or per-token Console: Pro $20/month ($200/year up front), Max $100/month, Ultra $200/month; Team and Enterprise per seat. |
| Where it runs | Terminal interface, desktop app, web app, on a phone, and from your own code with its SDK. | Terminal, IDE extensions (VS Code, JetBrains), desktop app, web, mobile (iOS, Android), Agent SDK, and CI (GitHub Actions, GitLab CI/CD). |
| Project instructions | Loads AGENTS.md; in any folder without an AGENTS.md, reads CLAUDE.md instead. |
Loads CLAUDE.md files, and can read AGENTS.md in their place. |
The same open model in both agents: what we measured
On 4 December 2026 we ran OpenCode 2.4.4 (opencode run, Chat Completions) and Claude Code 2.1.335 (claude -p, Anthropic Messages), both released on 3 December, on Qwen4 35B-A3B via Vora Compute's API: "hi" in an empty folder, then three Python tasks (fix a bug, add a function with tests, rename a function across files), three runs each, checked with hidden tests. The token counts come from our API, counted with Qwen4's tokenizer for both agents; on Claude models the same requests count differently.
| OpenCode 2.4.4 | Claude Code 2.1.335 | |
|---|---|---|
| Input tokens before your prompt | 6,795 | 12,541 |
| Checks passed | 9 of 9 | 9 of 9 |
| Fix a bug | 45,843 input tokens, 10 s | 101,289 input tokens, 24 s |
| Add a function with tests | 59,951 input tokens, 20 s | 219,165 input tokens, 79 s |
| Rename a function across files | 43,604 input tokens, 14 s | 121,887 input tokens, 19 s |
Medians of three runs.
No request failed. The gap in input tokens repeats on every request because each agent resends its instructions and tool definitions (12 for OpenCode, 14 for Claude Code). Claude Code requested high reasoning effort; OpenCode sent none, so Vora's API defaulted to medium, explaining part of the time difference. Instruction files and skills add more: in an extra run with 15 skills in a .claude/skills folder above the project, OpenCode's first request reached 9,274 input tokens.
This covers one model, one small repository and one day; requests went one at a time through a logging proxy, so times include that wait. The test says nothing about Claude models. For those, see Systima (July 2026, Claude Sonnet 4.5, Claude Code 2.1.207 vs OpenCode 1.17.18: about 33,000 tokens before the prompt against about 7,000) and DevToolPicks (October 2026, Claude Sonnet 5.5, Claude Code 2.1.300 vs OpenCode 2.0.29: 18,903 tokens against 3,700 on the first request, with both passing all 8 hidden tests in every run).
What the extra tokens cost you
What those extra input tokens cost depends on how you pay.
- Per token: With a Console account for Claude Code, or with a per-token provider in OpenCode, input tokens are billed. Anthropic's documentation says Claude Code uses prompt caching automatically, billing repeated content like its system prompt at a lower rate, so twice the tokens is not twice the bill. We did not measure caching.
- Usage windows: Claude's Pro and Max plans have 5-hour and weekly limits, and Anthropic says how fast you reach them depends on the model, chat length and file size. OpenCode Go has 5-hour, weekly and monthly limits; see our OpenCode pricing guide.
- Flat rate with no token counting: The extra tokens cost you time, not money.
To compare a flat rate against pay per token with your own numbers, use our cost calculator.
Run each agent on another model
In OpenCode, you add any OpenAI-compatible endpoint as a custom provider in its config file. Our guide to OpenCode API keys and custom providers has the tested steps. OpenCode also finds a local model through Ollama without an account.
Claude Code reads the address in ANTHROPIC_BASE_URL and speaks the Anthropic Messages format (/v1/messages). Anthropic's documentation says it "doesn't support routing Claude Code to non-Claude models through any gateway". The setup worked in our test, but you run it without Anthropic's support. Below is the configuration for Vora Compute's Qwen4 35B-A3B model (existing configs using qwen3.8-27b route automatically to qwen4-35b-a3b).
Terminal
export ANTHROPIC_BASE_URL="https://api.voracompute.com"
export ANTHROPIC_AUTH_TOKEN="$VORA_API_KEY"
export ANTHROPIC_API_KEY=""
export ANTHROPIC_MODEL="qwen4-35b-a3b"
export ANTHROPIC_DEFAULT_OPUS_MODEL="qwen4-35b-a3b"
export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen4-35b-a3b"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="qwen4-35b-a3b"
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000
claude
The steps for both agents, and for others, are in Set up your agent.
Which one fits
OpenCode fits when
- You want to pick and change models: open-weight, local or from any provider.
- You want open source code you can read and change.
- You want to pay for the model only.
Claude Code fits when
- You work with Claude models and already pay for a Claude plan.
- You want the setup its maker supports, with no model to configure.
- You want the agent as an extension inside your IDE.
With the same model behind both agents in our test, the results matched, while token use and run time did not.
A flat rate for either agent
Vora Compute serves Qwen4 35B-A3B (1M native context, with automatic routing for qwen3.8-27b), open weights under Apache-2.0, on GPUs in the EU with zero API retention, at a flat monthly rate per person and up to 4 requests at once per account. OpenCode connects through Chat Completions and Claude Code through Anthropic Messages, both backed by open-weight models on European GPUs. Our developer guide has this test for eight agents.
API keys need a paid plan; Vora's free trial gives 15 messages in browser Chat with no card.
Frequently asked questions
Is OpenCode free?
OpenCode the agent is free and MIT licensed. Models are not free, with two exceptions: OpenCode's own free models, which have a daily request limit whose number OpenCode does not publish, and models you run on your own machine.
Can I use my Claude plan in OpenCode?
OpenCode's documentation describes a Claude Agent provider that runs Claude Code on your machine once you install version 2.1.248 or later and sign in. In its words, "Claude Code calls the model, and OpenCode does everything else." Your Claude Code settings, CLAUDE.md files, hooks, MCP servers, skills and memory are not loaded.
Does either agent train on my code?
For Claude Code, Anthropic trains on Free, Pro, Max and Ultra account data when that setting is on, but not on code or prompts under commercial terms (Team, Enterprise and the API) unless the customer has chosen to provide its data for model improvement. OpenCode's privacy policy says prompts are not stored, except by its hosted agents, and pass through to the model provider, whose policy applies.
Related guides
- OpenCode pricing: breakdown of OpenCode's built-in tiers versus bringing your own flat-rate EU API.
- OpenCode API key setup: step-by-step custom provider setup tested on OpenCode 2.4.4.
- Connect coding agents to Vora Compute: full configuration reference across eight coding tools.
- Qwen4 35B-A3B API: details on the open-weight model serving both Chat Completions and Anthropic Messages.
Run Qwen4 35B-A3B on a flat monthly rate.
Flat rate on European GPUs with zero API retention: β¬9.90/month or β¬99/year (β¬8.25/month) for the first year through 31 December 2026 (then β¬29/month or β¬288/year, excl. VAT). Up to 4 parallel requests.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.