← Back to blog

OpenCode vs Claude Code: which coding agent, and when

· 7 min read · By ClawMetry Team

OpenCode and Claude Code do the same job from the same place: a terminal agent that reads your repo, edits files and runs commands. The differences are in who makes them, how you pay, which models you can point them at, and how much of the machinery you can see. This comparison sticks to the official documentation as of September 2026.

At a glance

  • OpenCode: open source (MIT) coding agent from Anomaly, about 203k GitHub stars. Terminal UI, a desktop app in beta, and IDE extensions. Bring your own API key for any provider, or use OpenCode Zen, a curated set of models billed pay-as-you-go with, in their words, "zero markups".
  • Claude Code: Anthropic's agentic coding tool. Terminal, VS Code and JetBrains extensions, a desktop app, and a web version at claude.ai/code. Most surfaces need a Claude subscription (Pro is $20 a month, or $17 billed annually; Max plans start at $100 with 5x or 20x Pro usage) or an Anthropic Console account billed at API rates. The terminal, VS Code and JetBrains surfaces also support third-party providers.

License and openness

OpenCode's source is MIT licensed and developed in the open on the dev branch, with the desktop app, a plan agent, a build agent and a general-purpose subagent all in the repository. Claude Code is a proprietary product; its behaviour is documented in detail, and it exposes customisation through CLAUDE.md files, skills, hooks, plugins and MCP servers, but you do not get the source.

How you pay

  • OpenCode: the software is free. You pay a provider directly with your own key, or fund a Zen balance ($20 initial balance plus a $1.23 card processing fee, auto top-up of $20 when the balance reaches $5, monthly spend limits available).
  • Claude Code: a Claude subscription with usage limits, or API pay-as-you-go through the Console. Team seats are $20 per seat per month billed annually ($25 monthly), with a $100 premium seat; Enterprise is seat price plus usage at API rates.

The practical difference: with OpenCode your bill is whatever the provider charges for the tokens you used. With a Claude subscription the bill is flat and the constraint is the usage limit, which is why "claude code usage limit" and "claude usage tracker" are such common searches.

Models

OpenCode is model agnostic by design. Claude Code runs Anthropic models (Opus, Sonnet, Haiku) on Anthropic's own surfaces, and can be pointed at third-party hosting of those models from the terminal and IDE extensions. If your team is standardised on one model family, that difference is small. If you route hard tasks to one model and cheap tasks to another, OpenCode makes that a configuration choice.

Interfaces and workflow

  • OpenCode: Plan mode proposes without editing, Build mode edits; toggle with Tab. @ fuzzy-finds files, images drag into the prompt, /undo and /redo exist, /share makes a link to a conversation. It writes an AGENTS.md for project conventions.
  • Claude Code: CLAUDE.md for standing instructions, auto memory across sessions, subagents that a lead agent coordinates, background agents you can watch from one screen, hooks before and after actions, skills as slash commands, plugins, routines that run in the cloud on a schedule, and hand-off between terminal, desktop, web and phone.

Control and safety

Both ask before running commands by default and both can be told to stop asking. Claude Code adds hooks, which let you run your own check before a tool executes and block it; that is the mechanism ClawMetry's pre-tool gate uses on Claude Code. OpenCode's approval model is the Plan/Build split plus per-command confirmation.

Which to pick

  • Pick OpenCode if you want the source, want to choose or mix providers, or want the bill to be exactly the tokens you used.
  • Pick Claude Code if you are already paying for a Claude plan, want subagents, hooks, routines and the desktop and web surfaces, or need the deepest integration with Anthropic's models.
  • Many teams run both. The question then stops being "which" and becomes "what did each one do, and what did it cost".

See both on one screen

Both tools record every session on your machine. ClawMetry reads those files with no SDK and no code change and shows OpenCode and Claude Code side by side: sessions, every tool call, per-turn tokens split into input, output, cache read and cache write, and cost per session, per model and per hour. For OpenCode it also surfaces multi-provider routing when a hard turn fans out to several providers; for Claude Code it renders the sub-agent tree with each child's tokens rolled up under the parent. Both get the stuck-loop and no-progress detectors and the kill switch. Details on the OpenCode page and the Claude Code page.

Sources

Two agents, one bill you can read

OpenCode and Claude Code side by side, per session and per dollar. Open source, no SDK.

Get ClawMetry
Cookie preferences