OpenCode vs Claude Code: Tasks, Permissions and Cost

OpenCode vs Claude Code: Tasks, Permissions and Cost

OpenCode is the stronger fit when choosing and changing model providers is part of your workflow. Claude Code is the more straightforward starting point if you want Anthropic’s own coding environment and already pay for an eligible Claude plan. The useful comparison is how each setup turns a repository task into a change you can accept: the permissions it needs, the work it preserves after an interruption and the total cost of getting there.

Version scope: OpenCode 2.4.1 and Claude Code 2.1.331, both released on 23 November 2026. We checked their documentation on 24 November. This is a documented capability comparison with a reproducible evaluation protocol, not a completed head-to-head benchmark. We have not measured a winner for code quality, speed or cost.

Your priorityOpenCodeClaude CodeOur pick for this requirement
Switch between hosted providers or local modelsProvider selection is a core part of the applicationThe first-party experience centres on Claude; compatibility gateways add another integrationOpenCode
Use an existing Claude subscription for codingCheck the selected integration and billing entitlement separatelyEligible plans include Claude Code within their usage limitsClaude Code
Keep an established Claude configurationInstructions and skills can transfer, but execution and permissions need auditingExisting Claude-specific settings remain in their native environmentClaude Code
Minimise the cost of accepted changesDepends on provider charges, retries and review effortDepends on plan utilisation or API charges, retries and review effortMeasure your own tasks

Our DIY AI data hub explains the wider evaluation approach. The coding tools dataset includes Claude Code but has no matching OpenCode result, so its scores cannot establish a winner between these versions.

Hold the model and billing route steady before comparing the agents

A coding Agent supplies the instructions, tools, context management and execution loop around a model. Selecting the same model in both applications removes one variable. The agents can still read different files, make different tool calls, delegate work differently and send different amounts of cached context.

Pass one should compare the agents. Where both support it, use the same Claude model ID through the same direct Anthropic API billing route. Start from identical repository snapshots and match the runtime, task prompt, project instructions, available tools and permission policy. Record any differences in reasoning settings or helper models. Keep optional plugins out of this first pass unless they are part of both configurations.

Pass two should compare the setups you would buy. That might be Claude Code on a subscription against OpenCode with a selected API provider or coding plan. Here, model choice and allowances can differ. Label the result as a comparison of complete setups rather than attributing every difference to the Agent.

OpenCode also documents a gateway that lets Claude Code call other model families. That makes an absolute claim that Claude Code can only run Claude, which is misleading. A gateway adds its own translation, billing and compatibility behaviour, which belongs in the test record.



Three repository tasks expose different kinds of failure

Use a clean checkout for each attempt and write the acceptance checks before giving either Agent the task. A small, dependency-free repository makes the comparison reproducible. Repeat the exercise on a representative project before concluding large codebases.

TaskFixed briefWhat earns acceptance
Scoped bug fixFix paginate(items, {page, pageSize}) so the final full page does not report another page. Preserve the public interface.Four items with page 2 and page size 2 produce hasNext: false. Earlier-page behaviour and the existing tests remain correct. No unrelated rewrite.
Behaviour-preserving refactorExtract duplicated line-item validation from quoteOrder(body) and createOrder(body).Both handlers retain their exact status codes, response bodies and error precedence. Shared validation actually replaces the duplication.
Feature with session recoveryAdd planImport(rows, {dryRun, checkpoint}) while preserving summariseRows(rows). Stop after validation and dry-run work, then resume for checkpoint handling.The completed stage survives, existing behaviour stays correct, and resuming from a checkpoint does not repeat completed rows. The final tests cover invalid data and repeated continuation.

The refactor needs human inspection even when every test passes. An Agent can preserve the outputs while leaving the duplication in place, or replace two short functions with an abstraction that takes longer to understand. Acceptance means the requested improvement is present and the diff remains proportionate.

For every attempt, record the starting commit, CLI version, full model ID, provider, billing route and configuration. Then retain the patch, baseline and final test logs, failed tool calls, corrective prompts, review minutes and actual charges. Mark the change as accepted unchanged, accepted after revision or rejected. Include failed attempts in the cost total.

Run each task at least three times and alternate which Agent goes first. Report the range alongside the median. Log cache usage and elapsed time rather than assuming every fresh chat starts with an empty provider cache. Three repetitions are a useful initial check, not a statistically conclusive ranking.

One current refactoring limitation deserves attention: OpenCode V2 accepts an old lsp configuration but does not run language servers or produce LSP diagnostics. Put the repository’s lint, typecheck or compiler commands in the acceptance checks. A configuration loading successfully does not prove that its old validation behaviour is active.

Match permission boundaries before counting interruptions

OpenCode V2 starts with a permissive base policy, including access outside the active project, with specific prompts for environment-file reads. Its ordered permission rules can allow, ask or deny, and the last matching rule wins. Explicitly configure the access your task needs instead of assuming an older version’s defaults still apply.

Claude Code has also changed. From version 2.1.283, Auto is the built-in starting mode for interactive terminal and VS Code sessions, subject to settings and availability. A classifier reviews actions in that mode. Manual mode asks before most edits, shell commands and network actions. Neither product can be fairly described by counting approval boxes without recording the selected mode.

For the controlled pass, select Claude’s Manual mode and a comparable OpenCode approval policy. Auto can involve a separate classifier model, so comparing only the main coding model would otherwise miss another source of behaviour and cost. Test the policy with a permitted read, a reversible edit, the test command and a dummy file outside the checkout.

Approval and operating-system isolation are separate controls. OpenCode’s shell runs with the host user’s authority. Claude Code’s shell sandbox is off by default and is available on macOS, Linux and WSL2; native Windows commands run without that sandbox. Claude’s file tools, MCP servers and hooks sit outside this shell boundary.

A Git worktree separates code changes, but it does not restrict access to your credentials or network. Use a disposable environment when you need that isolation. Instructions such as “do not deploy” remain useful guidance, while enforced permissions and service credentials determine what the process can actually do.

Compare the bill and the review time for an accepted change.

OpenCode’s application is free, while model access has its own terms. Its optional Go subscription starts at $10 per month for a selected model catalogue. Claude’s individual monthly plans currently start at $20 for Pro, with Max at $100 and Ultra at $200, before applicable tax. These are different allowances and model arrangements, not equivalent bundles of coding work. See Claude Code pricing for the detailed billing routes.

Confirm the active account before measuring anything. An approved ANTHROPIC_API_KEY can take precedence over a Claude subscription login. On the direct Anthropic route, non-interactive runs use a configured API key without the interactive approval step. Check /status. In OpenCode, record the selected provider and the account being billed, not just the model’s display name.

OpenCode V2 normally uses a shared background server. A key set in a new terminal may differ from the credentials that server uses. For a controlled CLI trial, use --standalone or verify the server’s active account before attributing charges to a run.

A working Claude login in another application does not establish access to your included subscription allowance. Anthropic identifies API keys, supported Cloud providers and linked billing as its preferred third-party routes. Some permitted integrations can draw from usage credits instead. Check the specific integration and balance before treating OpenCode as a way to reuse a Claude plan.

Keep three figures separate: provider charges, subscription allowance used and estimated API-equivalent cost. Claude Code’s session dollar estimate in /usage is not a subscriber’s invoice. Reconcile API runs with the provider’s billing record, including retries, helper calls and restarted sessions. When allocating a subscription fee across tasks, state the allocation rather than calling each included session free.

Useful cost calculation: model charges and allocated subscription cost, plus the cost of review and repair time, divided by accepted tasks. For an illustrative example, saving £2 in API charges while adding ten minutes of review at £30 per hour adds £5 of labour. That is arithmetic for comparing workflows, not a measured result for either product.

Migrate instructions and integrations against the November versions

For OpenCode 2.4.1, native configuration uses a permissions array and names such as shell and subagent. Named MCP servers sit under mcp.servers. The official OpenCode V1-to-V2 migration guide confirms that supported V1 configuration is normalised in memory, so a wholesale rewrite is unnecessary. V1 plugins and integrations with the server API need separate migration.

An existing instruction file can suppress the one you intended

OpenCode prefers AGENTS.md over CLAUDE.md in the same directory, falling back to the latter when no AGENTS.md exists there. Files in different directories can contribute together. Check the root and relevant subdirectories for conflicting guidance.

Claude Code now reads AGENTS.md directly. By default, however, a CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the working directory or an ancestor changes that selection. A personal local file can therefore stop shared instructions loading through the fallback. Use /memory to inspect what loaded and the Project instructions setting to select both formats when appropriate.

Your search, your sources
Make DIY AI a preferred source

See more of our reporting in Google Top Stories, AI Overviews and AI Mode.

Add DIY AI on Google

A skill being discovered does not prove its hooks work

OpenCode discovers skills in its own locations and compatibility directories such as .claude/skills. Move the complete skill folder, including scripts and references, and check for duplicate skill IDs. Copying only SKILL.md can leave a workflow without the files it needs.

Claude-specific execution features, including forked subagents, dynamic shell context and hooks, require individual checks. Invoke each migrated skill on a disposable change and inspect what it actually runs. The shared file format does not guarantee identical invocation, tool grants or execution behaviour.

MCP connections include scope and authentication

Claude’s project .mcp.json uses mcpServers. OpenCode V2 uses mcp.servers, a command array containing the executable and arguments, and environment for environment variables. OpenCode project overrides replace a same-name server object, so leaving out fields can remove configuration you expected to inherit.

Inventory user and local connections too: copying the repository does not transfer every Claude MCP definition or credential. Authenticate the new client, verify connection status and run a harmless read before enabling writes. Our OpenCode MCP setup guide covers the implementation and troubleshooting; match any configuration example to your installed major version.

Test conversation recovery separately from file rollback

A recurring theme in developer discussions about both tools is the effort of rebuilding context after a long session, particularly when its summary no longer matches completed work on disk. Experiences differ, and those reports do not establish a defect in every current installation. They do explain why recovery belongs in the comparison.

At the import task’s checkpoint, save the session ID, current diff, completed checks and remaining requirements. Close and resume the session, then ask the Agent to inspect the repository before continuing. Record repeated edits, forgotten constraints and extra prompts. This tests a controlled restart. Compaction, process crashes and recovery of external services are separate conditions.

Claude Code offers claude --continue and claude --resume. OpenCode provides saved sessions and continuation by session ID. Restore the launch configuration as well: a resumed Claude session may need flags such as --mcp-config supplied again. A transcript cannot establish that a background process finished or that a command is safe to repeat.

OpenCode’s file snapshots require Git and cover the active directory, which can be narrower than the repository. They do not restore databases, processes or other external effects. Claude’s rewind tracks its file-tool edits; a file changed only through Bash remains outside that tracking. Keep a Git checkpoint and a short handoff listing completed work, decisions, failing checks and next steps when switching tools; do not assume their native session formats transfer between agents.

Switch after the refactor and recovery tasks pass.

Start with Claude Code when your preferred models, subscription and existing project configuration already sit with Anthropic. Choose OpenCode when provider choice, local inference or control over the surrounding workflow is valuable enough to justify maintaining that setup.

Keep the working configuration until its replacement completes all three tasks with acceptable changes and known costs. A convincing bug fix earns a further trial. A clean refactor and a successful continuation tell you much more about whether the tool will remain useful through an ordinary development day.

You Might Also Like:

best AI coding tools

Best AI Coding Tools 2026

By: Steven Jones On:
Updated on: August 12, 2026
Claude Code is the best AI coding tool overall in 2026 because it leads the DIY AI dataset for repository…
Claude Code & Claude Pro Pricing 2026

Claude Code Pricing 2026

By: Steven Jones On:
Updated on: October 17, 2026
Claude Code pricing starts at $20 per month with Claude Pro; Max 5x costs $100 per month, and Max 20x…
Steven Jones

Writer: Steven Jones

AI Tools Reviewer and Technical Analyst

Steven Jones is a technology analyst specialising in artificial intelligence, machine learning workflows, and emerging automation tools.

At DIY AI, he focuses on clear, practical guidance for people comparing AI tools in the real world. His work covers text generation, image generation, video tools, data platforms, developer-focused AI products, and the automation workflows that connect them.

Steven's reviews are built around hands-on testing, practical benchmarks, and transparent scoring rather than vendor claims. He looks closely at where each tool performs well, where it falls short, and what those trade-offs mean for creators, teams, and businesses trying to make sensible AI adoption decisions.

He has a particular interest in safety, reliability, output quality, performance metrics, and dataset quality. When he is not reviewing the latest AI model updates, he experiments with prompt engineering techniques and contributes to DIY AI ongoing work on fair, explainable scoring frameworks for AI tools.

Contact

Leave a Comment On: Opencode VS Claude Code

Your email address will not be published.