Three Built-In Subagents
OpenCode ships with three purpose-built subagents available on every installation. Understanding what each does changes how you structure work in practice.
General: Full tool access — reads, writes, runs commands, hits APIs. Used for the main coding loop, multi-step tasks with side effects, and anything requiring persistent state across multiple tool calls. This is what runs when you type a task with no specific prefix.
Explore: Read-only, no writes, no command execution. Designed for codebase navigation — symbol lookup, dependency tracing, call graph analysis, understanding an unfamiliar service. The constraint is the feature: read-only access means you can run it safely on production codebases, shared repos, or regulated environments where accidental writes are unacceptable. It also runs at lower cost since it doesn’t need the full toolset.
Scout: Read-only access to external dependencies and documentation. When you’re working with a library you just added or an SDK with thin docs, Scout can browse documentation sites, parse README files, and pull from GitHub issues without touching your codebase. Added in the 0.14 release (late May 2026), it addresses a real gap: how do you give an agent research capability without also giving it write permissions to live infrastructure? Scout answers that with a hard permission boundary.
Beyond these three, OpenCode accepts custom subagent definitions in JSON or markdown — same pattern as Claude Code’s CLAUDE.md context injection system, but targeting the agent harness itself rather than just prompt context. You can define a “SecurityReviewer” subagent that runs read-only on your auth service with a specific system prompt, or a “TestWriter” that routes to a cheaper model for mechanical test generation while the main loop uses a frontier model for architecture decisions.
Background Subagents: The Async Case
Background subagents are the June 2026 feature drawing the most developer attention. They let you dispatch long-running tasks — large refactors, multi-file test generation, codebase-wide searches — without blocking your active terminal session. The background agent runs in the persistent server process, posts updates to an event log, and surfaces completion when it’s done. No second terminal pane to monitor. No separate process to babysit.
The workflow looks like this: opencode bg “run tests for src/api/** and write coverage report to docs/coverage.md” queues the task, and you continue editing. The event log is accessible via opencode log at any point. Completion triggers a desktop notification.
This matters for the benchmark numbers. In the 38-task test that produced the 74% overall completion rate, OpenCode ran 23% of its tasks as background subagents. Those tasks took longer in wall-clock time, which is part of why the 16-minute average execution time was higher than Claude Code’s 9 minutes. But those tasks were running in parallel with other work — the 16-minute number in isolation overstates the actual productivity cost.
The Actual Cost Model
OpenCode is MIT-licensed and free. The cost is the model API you choose to connect to it.
For teams running open-weight models on cloud GPUs: effectively zero for the tool itself. DeepSeek V4 Pro at $0.07 per million input tokens vs Claude Sonnet 4.6 at $3.00 per million is a 42x cost difference. A four-person development team running typical coding agent workloads — roughly 15–20 million input tokens per seat per month — pays ~$45/month total on DeepSeek vs ~$240/month on Sonnet API keys. Claude Code Pro at $100/seat/month runs to $400 for the same team.
OpenCode’s Go tier at $10/month adds access to managed open-weight model endpoints (eliminating the need to run your own GPU), priority support, and enterprise SSO. It does not add exclusive model access — if you want Claude Sonnet at full speed, you use your own Anthropic API key regardless of tier. The Go tier is positioned at teams who want the cost efficiency of open-weight models without the infrastructure overhead of self-hosting.
For solo developers at typical usage levels, Claude Code’s flat $100/month subscription frequently undercuts per-token API costs when you’re hitting the model hard. The cost case for OpenCode is strongest for teams, for users who want open-weight model quality (which has narrowed substantially vs frontier models in 2026), and for air-gapped deployments where API calls to Anthropic or OpenAI are architecturally excluded.
Benchmark Reality Check
The 38-task production test used a real TypeScript monorepo, not SWE-bench or Terminal-Bench eval sets. Tasks: 12 complex refactors, 10 debugging sessions, 9 test generation runs, 7 documentation tasks.
| Task type |
Claude Code |
OpenCode |
Winner |
| Complex refactors |
83% |
67% |
Claude Code (+16pp) |
| Debugging sessions |
80% |
90% |
OpenCode (+10pp) |
| Test generation |
78% (73 tests written) |
78% (94 tests written) |
Tie (OpenCode more thorough) |
| Documentation |
71% |
86% |
OpenCode (+15pp) |
| Overall |
82% |
74% |
Claude Code (+8pp) |
The debugging edge is explained directly by LSP. The documentation edge is less obvious — both tools wrote from the same codebase. The difference appears to be OpenCode’s thoroughness optimization: it ran the full existing test suite (200+ tests) before writing documentation claims about behavior, while Claude Code verified only the specific functions being documented. Both approaches are valid; OpenCode’s just produces fewer documentation inaccuracies on codebases where behavior diverges from expectations.
A separate AlterSquare 50-task production test found Claude Code introduced more technical debt in its solutions — specifically more subset testing (verifying only the changed code, not the full regression surface) and more architectural shortcuts under time pressure. OpenCode’s slower average completion time was correlated with fewer follow-up fix tasks in the two weeks after the initial run. That doesn’t show up as “OpenCode won” in completion rate. It shows up in sprint velocity two weeks later.
The Full Stack Decision Table
| Tool |
Price |
Model lock-in |
LSP in loop |
Background agents |
Strongest at |
| OpenCode |
Free / $10/mo Go |
None (75+ providers) |
Yes, auto-configured |
Yes (v0.14+) |
Debugging, docs, air-gapped, cost-sensitive teams |
| Claude Code |
$100/mo Pro |
Anthropic only |
Partial (not default loop) |
No |
Complex refactors, speed, GitHub ecosystem |
| Codex CLI (OpenAI) |
Pay-per-token |
OpenAI only |
No |
No |
Terminal-Bench 2.1 score (83.4%), OpenAI integrations |
| Cursor |
$20/mo Business |
Multi-model, IDE-locked |
Via IDE |
Beta |
IDE users, inline autocomplete speed, enterprise SSO |
When Not to Switch
The 7-minute average execution time gap (9 vs 16 minutes on identical refactoring tasks) adds up on teams measuring sprint velocity. If your definition of done is “passed CI and merged in the same session,” Claude Code’s speed advantage is real and consistent.
Claude Code also owns 10%+ of all public GitHub commits, peaked at 326,000 commits per day in March 2026, and has deep integrations with GitHub Actions, Copilot, and Anthropic’s managed agents platform. If you’ve built custom workflows on Claude Code’s skills architecture — hooks, MCP integrations, CLAUDE.md-driven subagents — the switching cost is non-trivial. OpenCode’s custom subagent definitions in JSON/markdown are functionally equivalent for many use cases, but migrating an existing toolkit takes real time.
For teams that have never been on Claude Code and are evaluating from scratch in June 2026: OpenCode’s model-agnostic design means you can start with the Anthropic API and switch to DeepSeek V4 when cost pressure hits. You don’t have to commit the architecture to a single vendor at setup time. That optionality has a real value that doesn’t appear in any benchmark table.
Three Concrete Steps
Run OpenCode alongside your current tool for two weeks on debugging and documentation tasks specifically. Those are the task types where the LSP loop and thoroughness advantage are most measurable, and they’re tasks most engineering teams do daily without treating them as evaluation surfaces.
If you have four or more developers at $100/seat/month on Claude Code, run the API cost math with a DeepSeek V4 endpoint. At $0.07 per million input tokens vs $3.00, the breakeven on a managed GPU instance is around 2,500 coding sessions per month. Most active four-person teams clear that threshold.
OpenCode’s 172K stars (as of June 19, 2026) vs Claude Code’s 326K daily GitHub commits is evidence these tools aren’t mutually exclusive. A growing pattern in production teams is running Claude Code for complex architectural work and OpenCode for debugging, test generation, and documentation — same codebase, model routing by task type rather than tool loyalty. That’s exactly what OpenCode’s multi-provider architecture was built for.
Comments · 0
Beta: comments are stored locally on your device and not visible to other readers.
No comments yet. Be the first to share your thoughts.