Terminal coding agents became part of the daily workflow for many engineering teams in 2026. Claude Code is Anthropic's agent, built around Claude models and included in paid Claude plans. OpenCode is an open-source agent from Anomaly that connects to models from 75+ providers, including models you run locally.
Claude Code's draw is Anthropic's models paired with an agent designed around them, while OpenCode's is model choice, with GPT, Gemini, open-weight, and local models all running in one MIT-licensed agent. The two moved further apart in early 2026, when Anthropic stopped Claude subscriptions from working in third-party tools and OpenCode dropped its bundled Claude login. Since then, the choice is often framed as a managed agent tied to one lab against an open one that runs anything.
That framing undersells how much the two have converged. Both read AGENTS.md files, connect to MCP servers, load skills from .claude/skills folders, and split work across subagents, so the decision usually turns on which models you need, how you pay for them, and how each agent behaves out of the box. Performance is best judged on your own codebase, since a benchmark on someone else's repo only tells you so much.
This is where OpenCode vs Claude Code stand on models, pricing, and features in 2026.
OpenCode vs Claude Code: quick comparison
| OpenCode | Claude Code | |
|---|---|---|
| Models | 75+ providers, local models | Claude models only |
| Tool cost | Free, MIT licensed | Included from Pro plan |
| Model billing | Provider key, Zen, or Go | Plan allowance or API |
| Claude Pro/Max login | Not permitted | Supported |
| Interfaces | Terminal, desktop, VS Code | Terminal, desktop, IDEs, web |
| Instruction file | AGENTS.md, CLAUDE.md fallback | CLAUDE.md, AGENTS.md fallback |
| Default permissions | Actions allowed by default | Auto mode with checks |
| Respan tracing | Supported | Supported |
What is OpenCode?
OpenCode is an open-source AI coding agent from Anomaly, released under the MIT license. It runs as a terminal UI, as a desktop app that's still in beta, and as a VS Code extension that also installs in forks like Cursor and Windsurf. For scripts and CI, opencode run takes a prompt non-interactively and opencode serve exposes the agent as a headless HTTP server.
OpenCode isn't tied to a model vendor. It connects to 75+ providers and to local models, and OpenCode's own Zen and Go model plans are optional. What you give up in exchange is a managed setup, because provider keys, permissions, and agent behavior all live in opencode.json and are yours to configure.
What is Claude Code?
Claude Code is Anthropic's agentic coding tool. It works through a codebase from the terminal, editing files and running commands, and the same agent is available as VS Code and JetBrains extensions, as a desktop app, and in the browser at claude.ai/code.
Access comes through a paid Claude plan starting at Pro, through pay-per-token billing in the Claude Console, or through a cloud deployment on Amazon Bedrock, Google Cloud's Agent Platform (formerly Vertex AI), or Microsoft Foundry. Whichever route you take, the models underneath are Claude models, so Claude Code isn't a fit for a team that wants GPT or Gemini inside the same agent.
Claude Code vs OpenCode: models
The two agents split first on model support, and most of the other differences follow from it.
Claude Code models
Claude Code runs Anthropic's models, and /model switches between them:
- Claude Opus 5.5 - The default on every paid plan and on the API.
- Claude Sonnet 5 - A lower-cost option for execution-heavy work, which is the tradeoff covered in Claude Opus vs Sonnet.
- Claude Haiku 4.5 - The model behind the
haikualias. - Claude Fable 5.1 - The model behind the
fableandbestaliases.
The opusplan alias combines the two main tiers, using Opus during plan mode and Sonnet for execution. Claude Code also runs through an LLM gateway set with ANTHROPIC_BASE_URL, and on Bedrock, Google Cloud's Agent Platform, and Foundry, where alias defaults differ by provider. However, Anthropic doesn't support routing Claude Code to non-Claude models through any gateway, so a gateway changes where Claude requests go and what gets logged, while the model family stays the same.
OpenCode models
OpenCode uses the AI SDK and Models.dev to connect to 75+ LLM providers, and /models switches between them mid-session:
- Closed models - GPT-6 and Gemini through their providers' API keys.
- Open-weight models - Kimi and other open models through provider keys or OpenCode Go.
- Claude models - An Anthropic API key, OpenCode Zen, or a cloud provider that serves Claude. A Claude Pro or Max subscription isn't an option, since Anthropic prohibits using those credentials in third-party tools and OpenCode stopped bundling the plugins that allowed it in version 1.3.0.
- Subscriptions - ChatGPT Plus or Pro, GitHub Copilot, and GitLab Duo sign-ins work with no extra setup.
- Local models - Ollama, LM Studio, and llama.cpp, with no per-token bill and hardware and electricity as the cost.
Because every provider sits behind the same config, one session can plan on one model and implement on another without changing anything else in the setup.
Claude Code vs OpenCode: pricing
Claude Code bundles the agent into a subscription, while OpenCode separates a free agent from whatever you pay for models.
Claude Code pricing
Claude Code is included in Pro and Max plans, with API billing as the alternative. Current Claude plans for individuals:
- Pro - $20/month, or $17/month billed annually.
- Max - $100/month for 5x Pro usage, or $200/month for 20x.
- API billing - Pay per token through the Claude Console or a cloud provider, with no plan allowance.
Plan usage draws from an allowance that resets on a rolling five-hour window and a weekly window, and that allowance is shared with Claude chat, so a long afternoon in the terminal and a long chat session come out of the same budget. A subscription keeps cost predictable until the allowance runs out, and usage credits let you keep working past it. API billing tracks usage directly instead, which means the bill has no ceiling unless you set spend limits.
OpenCode pricing
The OpenCode agent is free and MIT licensed, so pricing is really about the models behind it:
- Bring your own key - Pay each provider's standard rates directly.
- Zen - A pay-as-you-go credit balance on OpenCode's gateway, covering a curated set of models the OpenCode team has tested.
- Go - OpenCode Go costs $10/month for a lineup of coding models including Kimi, MiniMax, Qwen, GLM, and DeepSeek, with credit top-ups if you need more. Claude models aren't part of Go.
- Local models - No model bill, with hardware and electricity as the cost.
Because every path is either usage-based or tied to a model lineup, the OpenCode bill moves with your model choice. Running Opus through an API key in OpenCode costs what Opus costs anywhere else, while Go trades the full provider catalog, Claude included, for a flat monthly price.
See what Claude Code and OpenCode actually cost
Route, observe, and evaluate every LLM call your coding agents make. Respan traces Claude Code and OpenCode in one dashboard, with tokens and cost per developer and one gateway for 1,000+ models.
Claude Code vs OpenCode: features
Day-to-day features have largely converged, and a repo configured for one agent mostly works in the other.
Claude Code features
Claude Code's feature set centers on running one agent across several surfaces and extending it with packaged workflows:
- Interfaces - Terminal CLI, a VS Code extension that also installs in Cursor, a JetBrains plugin, a desktop app for macOS and Windows with Linux in beta, and the web at claude.ai/code.
- Project instructions - CLAUDE.md files load at the start of every session. From v2.1.277, Claude Code reads AGENTS.md when a repo has no CLAUDE.md.
- Plan mode and subagents - Plan mode explores the codebase and proposes changes without editing source files. Built-in subagents include a read-only Explore agent, a Plan agent, and a general-purpose agent for multi-step work.
- LSP - Official code-intelligence plugins connect Claude Code to language servers for Python, TypeScript, Go, Rust, Java, and other languages.
- Extensibility - MCP servers, skills, hooks that run shell commands before or after agent actions, and plugins installed from marketplaces, including Anthropic's official one.
Context is managed automatically as a session approaches the limit, with older tool outputs cleared first and the conversation summarized after that.
OpenCode features
OpenCode covers the same core workflow, with more ways to run the agent outside an interactive terminal:
- Interfaces - Terminal UI, a desktop app in beta for macOS, Windows, and Linux, a VS Code extension that works in forks like Cursor and Windsurf, and Agent Client Protocol support for other editors.
opencode webstarts a local browser UI, andopencode serveruns a headless HTTP server with an OpenAPI endpoint. - Project instructions - AGENTS.md, which
/initgenerates. If a repo has no AGENTS.md, OpenCode falls back to CLAUDE.md. - Build and Plan agents - Build is the default agent with every tool enabled, and Tab switches to Plan for analysis before changes. Built-in subagents are General, Explore, and Scout, which researches external docs and dependencies.
- LSP - Built-in language server integration feeds diagnostics back to the agent as it edits, so type errors surface inside the loop instead of at review.
- Extensibility - Local and remote MCP servers, skills (including existing
.claude/skillsfolders), plugins that hook into agent events, and custom commands.
In practice, the gaps are where LSP comes from and which surfaces each agent reaches, while instruction files, skills, and MCP servers carry over between the two with little change.
Claude Code vs OpenCode: performance
Performance depends on the model as much as the agent, so a comparison only tells you something about the agents when both run the same model.
Claude Code performance
Because Claude Code only runs Claude models, its defaults are set around them, with Opus 5.5 as the default on paid plans and opusplan available to move execution onto Sonnet. Subagents handle exploration in their own context and return a summary, which keeps the main session from filling up with file reads, and automatic compaction extends long sessions without a manual reset.
The permission mode also affects wall-clock time. Manual approvals add a pause at every edit and command, which auto mode removes.
Performance takeaway: Claude Code's speed depends mostly on which Claude model you pick and which permission mode you run in, and its default setup (Opus 5.5 in auto mode) avoids the approval pauses that slow Manual sessions.
OpenCode performance
OpenCode's speed follows whichever model you connect, which makes a same-model test the useful comparison. Builder.io's head-to-head test, published January 12, 2026, ran both agents on Claude Sonnet 4.5 in fresh Docker containers against a medium-sized TypeScript and Node.js project with an existing test suite.
The small tasks came out close, with a cross-file rename at 3m 13s for OpenCode against 3m 6s for Claude Code and a bug fix at about 40 seconds each. In a refactor task, OpenCode also fixed an unrelated type error along the way. The gap came from test writing, where OpenCode spent 9m 11s and wrote 94 tests against Claude Code's 3m 12s and 73 tests, because OpenCode ran pnpm install and then the full test suite to check for regressions.
Across the whole session, OpenCode took 16m 20s and Claude Code took 9m 9s. The author calls it a single, non-deterministic run, and it predates the current default models on both sides, so it reads better as a view of each agent's habits (the author frames Claude Code as built for speed and OpenCode for thoroughness) than as a benchmark of today's versions.
Performance takeaway: On the same model, OpenCode took longer and wrote more tests because it verified its work against the full suite, so expect its speed to follow the model you connect and its defaults to lean toward checking over finishing fast.
Claude Code vs OpenCode: privacy and data handling
Both agents send code to whichever model provider handles the request, so the difference is what each vendor keeps on top of that.
Claude Code privacy and data handling
On consumer plans (Pro and Max), Anthropic trains on Claude Code data only when the model-improvement setting is on, and retention is five years with that setting on and 30 days with it off. Under commercial terms, which cover Team, Enterprise, and the API, Anthropic doesn't train on Claude Code prompts or code, and standard retention is 30 days. Zero data retention is available to qualified Enterprise accounts.
Locally, Claude Code keeps session transcripts in plaintext under ~/.claude/projects/ for 30 days by default. Telemetry excludes code, prompts, and file paths, can be turned off with DISABLE_TELEMETRY=1, and is off by default on Bedrock, Google Cloud's Agent Platform, and Foundry.
OpenCode privacy and data handling
OpenCode doesn't store your code or context data. Requests go from your machine directly to the provider you configured, so that provider's retention policy is the one that applies.
Sharing is the main exception, since /share syncs a session to OpenCode's servers and creates a link anyone can open. It's manual by default and can be disabled in config. Traffic sent through Zen or Go also passes through OpenCode's gateway, where providers follow zero retention with listed exceptions, including 30-day retention on OpenAI and Anthropic models and possible training on some free models.
Claude Code vs OpenCode: security and permissions
The agents start from different defaults, and both let you tighten them.
Claude Code security and permissions
Claude Code's permission modes range from Manual, which starts read-only and asks before edits and commands, to bypassPermissions, which Anthropic scopes to isolated containers and VMs. From v2.1.283, interactive terminal and VS Code sessions start in auto mode, which allows actions with background safety checks, so Claude Code no longer asks before every edit by default.
A built-in sandbox adds filesystem and network isolation on macOS, Linux, and WSL2. It stays off until you enable it with /sandbox, and native Windows isn't supported.
OpenCode security and permissions
OpenCode starts from permissive defaults, with most permissions set to allow, so the default Build agent edits files and runs bash commands without asking.
Permissions are set per tool in opencode.json as allow, ask, or deny, with glob patterns for bash commands and file paths, and they can differ per agent. Setting bash to ask is a reasonable first change before pointing OpenCode at a repo with production credentials nearby.
Claude Code vs OpenCode: team and enterprise use
Both vendors sell an enterprise tier, with control sitting in different places.
Claude Code for teams and enterprise
Team and Enterprise plans add managed settings, delivered from the Claude admin console, an MDM system, or a file on disk, and they take precedence over local developer config. Admins can lock permission rules, allow or deny MCP servers and plugin marketplaces, restrict models, and set version floors, while SSO and SCIM are configured at the Claude account level.
Usage shows up in an analytics dashboard on Team and Enterprise, and OpenTelemetry export works on every provider. Anthropic publishes a SOC 2 Type 2 report and an ISO 27001 certificate, and a signed BAA extends to Claude Code traffic when zero data retention is enabled.
OpenCode for teams and enterprise
OpenCode Enterprise is priced per seat, with no token charge when you bring your own LLM gateway. A central config integrates with your SSO provider and can restrict every user to an internal AI gateway with other providers disabled. For smaller teams, Zen workspaces add admin and member roles with per-member monthly spend limits, and workspaces are free during the beta.
OpenCode points to a SOC 2 Type 2 report in its trust center. Self-hosted share pages are still on its roadmap, so teams that can't send sessions to OpenCode's servers should disable /share for now.
What are the biggest differences between OpenCode and Claude Code?
Instruction files, skills, and MCP servers carry over between the two agents, so the differences that change a decision sit elsewhere:
- Model choice - Claude Code runs Claude models only. OpenCode runs models from 75+ providers, plus local models.
- Billing - Claude Code draws from a plan allowance or API billing. OpenCode is free, the cost is whatever model you connect, and it can't run on a Claude subscription.
- Default permissions - Claude Code starts in auto mode with background safety checks. OpenCode allows most actions until you configure it otherwise.
- Surfaces - Claude Code adds a JetBrains plugin and a hosted web version. OpenCode adds a headless server, Agent Client Protocol support, and a local web UI.
- Source - OpenCode is MIT licensed, so you can read, fork, and modify the agent itself.
Model choice is also the axis in Codex vs Claude Code, where the alternative is tied to OpenAI's models rather than open to any provider.
Should I use OpenCode or Claude Code?
Use Claude Code if your team already works in Claude models, a subscription allowance fits your usage better than per-token billing, or you need JetBrains support, the web version, or admin-managed settings on a Claude plan. It's also the shorter path if you'd rather not configure providers and permissions yourself.
Use OpenCode if you need GPT, Gemini, Kimi, or local models in the same agent, you already pay for ChatGPT or GitHub Copilot, or you want an open-source agent you can run headless in CI. Running both on one repo is workable too, since each agent falls back to the other's instruction file.
If you'd rather have the agent inside an editor, the tradeoffs in Claude Code vs Cursor apply, and the wider set of OpenCode alternatives covers other agents. Whichever way you lean, one third-party test on someone else's TypeScript repo is thin evidence for a tool your team will run every day, and running both agents on your own tasks, traced the same way, gives you numbers that apply to your codebase.
Trace and compare OpenCode and Claude Code with Respan

Respan traces both agents into one dashboard, so you can compare OpenCode and Claude Code on your own tasks instead of a borrowed benchmark. Every agent turn becomes a trace with the prompt, thinking, each tool call (bash commands, file reads, and edits), token usage, cost, and latency, whether it comes from Claude Code's hook or from running respan integrate opencode.
The same traces keep working after the decision, as a running record of what each developer's agent did and what it cost:
- Side-by-side traces - Trace Claude Code, Codex, and OpenCode in one place and filter by agent, developer, or any custom metadata.
- Cost per developer - See tokens, cost, and session count broken down per developer across both agents.
- One gateway for both - Route OpenCode through the Respan AI gateway to reach 1,000+ models with one Respan API key, and point Claude Code at it with
ANTHROPIC_BASE_URLfor logging, spend limits, fallbacks, and caching of exact repeat requests. - Monitors - Get an alert in Slack, email, or a webhook when cost, errors, latency, or tokens cross a threshold.
- Compliance - SOC 2, HIPAA with a BAA, GDPR, and ISO 27001.
Trace OpenCode and Claude Code in one place
Route, observe, and evaluate every LLM call your coding agents make. Compare OpenCode and Claude Code on your own codebase with traces, per-developer cost, and one gateway for 1,000+ models.
FAQ
Can I use my Claude Pro or Max subscription with OpenCode?
No. Anthropic prohibits using Pro or Max credentials in third-party tools, and OpenCode stopped bundling the plugins that allowed it in version 1.3.0. To run Claude models in OpenCode, route it through the Respan gateway with a single Respan API key, or use an Anthropic API key, OpenCode Zen, or a cloud provider that serves Claude.
Is OpenCode free?
The OpenCode agent is free and MIT licensed, and you pay for the models it calls. Routing OpenCode through Respan lets you use your own provider keys or Respan credits with one record of spend across providers. Otherwise, the options are a provider API key, Zen credits, OpenCode Go at $10/month, or local models on your own hardware.
Can Claude Code use models other than Claude?
No, Anthropic doesn't support routing Claude Code to non-Claude models. What you can change is where Claude requests go, and routing Claude Code through Respan adds logging, per-developer cost tracking, spend limits, fallbacks, and caching across Claude models. For GPT, Gemini, or open models in a terminal agent, OpenCode through the Respan gateway covers 1,000+ models.
How do I track what Claude Code or OpenCode costs across a team?
Respan traces both agents into one dashboard, with tokens, cost, and session count per developer. Claude Code tracing connects through a hook, and OpenCode tracing sets up with respan integrate opencode. Each tool also reports on itself, with an analytics dashboard on Claude Team and Enterprise plans and per-member spend limits in OpenCode Zen workspaces.
Can OpenCode run with local models?
Yes. OpenCode connects to Ollama, LM Studio, and llama.cpp, so you can run a model on your own machine with no per-token bill. The cost moves to hardware and electricity instead, and coding quality depends on how capable a model your hardware can run.
Does OpenCode read CLAUDE.md files?
Yes. OpenCode falls back to CLAUDE.md when a project has no AGENTS.md, and to ~/.claude/CLAUDE.md for global instructions, and it also loads skills from .claude/skills folders. You can turn that off with OPENCODE_DISABLE_CLAUDE_CODE=1. In the other direction, Claude Code reads AGENTS.md when a repo has no CLAUDE.md.




