Claude Code vs OpenCode in 2026: A Feature-by-Feature Comparison From the Inside

Both are the top of the terminal-AI-agent market. When does each win? A 60-row parity matrix and five hands-on tasks, run side-by-side on the same Windows workspace.

TL;DR

  • Claude Code wins on: bundled test-driven skills (/run, /verify), inter-agent SendMessage primitive, JetBrains + iOS + Web surfaces, mature Windows native install, and a AskUserQuestion MCQ pattern that few other agents ship.
  • OpenCode wins on: MIT-licensed open source (181k GitHub stars, direct fork model), 75+ model providers via BYOK, built-in LSP for ~32 languages with no per-language MCP wiring, JS/TS plugin ecosystem with npm access, and exhaustively configurable keybinds (~100 documented actions).
  • They tie on: MCP servers, project memory (both auto-load AGENTS.md/CLAUDE.md), subagents with parallel spawn, TUI-first UX, MDM/enterprise-managed config, and slash-command extensibility.
  • Neither is a wrong answer. The right pick is a function of your provider stack, your license constraints, and whether you want a batteries-included managed product or a hackable open toolchain.

Framing

By mid-2026, terminal-native AI coding agents have consolidated into two dominant patterns: Claude Code (Anthropic, proprietary CLI + Claude Agent SDK) and OpenCode (Anomaly/sst, MIT-licensed, model-agnostic). Cursor and Windsurf still ship, but they're IDE-first; Aider is losing mindshare; Codex has an OpenAI-specific slot. If you type claude or opencode in your terminal, you're at the top of the market.

This post compares them feature-by-feature with a 60-row parity matrix drawn from official docs (fetched 2026-07-02) plus five hands-on tasks run side-by-side on a corporate Windows 11 workspace with both CLIs installed (claude 2.1.196 and opencode 1.17.12).

No sponsorship, no affiliation. Both tools are legitimate; the goal is to make it easy to pick the right one for a given team.

Full parity matrix

#FeatureClaude Code (v2.1.x, Anthropic)OpenCode (v1.17.x, Anomaly/sst)
1Hook events (count)30+ including SessionStart, SessionEnd, UserPromptSubmit, UserPromptExpansion, PreToolUse, PostToolUse, PostToolUseFailure, PostToolBatch, PermissionRequest, PermissionDenied, Notification, MessageDisplay, SubagentStart, SubagentStop, TaskCreated, TaskCompleted, Stop, StopFailure, TeammateIdle, InstructionsLoaded, ConfigChange, CwdChanged, FileChanged, WorktreeCreate, WorktreeRemove, PreCompact, PostCompact, Elicitation, ElicitationResult, SessionEnd25+ including session.created/idle/ended/compacted, message.part.updated, tool.execute.before/after, permission.asked/replied, file.edited, command.executed, lsp.client.diagnostics, server.connected, todo.updated, tui.prompt.append
2Hook handler typesShell command, HTTP endpoint, MCP tool, prompt, agentJavaScript/TypeScript async functions inside a plugin module
3Hook filteringmatcher + optional if conditional (e.g. Bash(rm *)) avoids process spawn on non-matchJS conditionals inside plugin body
4Hook config locationsettings.json (managed / user / project / local)JS/TS files in .opencode/plugins/ or ~/.config/opencode/plugins/, or npm packages in opencode.json plugin: [...]
5Hook decisionsExit code 2 = block; stdout JSON {permissionDecision, additionalContext}; Stop/SubagentStop can inject contextPlugin function mutates output.args in place
6MCP serversNative. .mcp.json (project) + ~/.claude.json (user) + managed policyNative. opencode.json mcp key
7MCP transportsstdio, HTTP (streamable-http), SSELocal (stdio) + Remote (HTTP with headers/OAuth via RFC 7591 DCR); auto-401 handling
8MCP per-tool permissionsYes — permissions.allow/deny pattern mcp__server__toolYes — per-tool permission block
9MCP tool search (deferred loading)Yes — ENABLE_TOOL_SEARCH=auto keeps schemas out of prefix cacheNot documented
10Skills — format.claude/skills/<name>/SKILL.md + supporting files; frontmatter controls invocationMarkdown in .opencode/commands/ with YAML frontmatter (description, agent, model); supports $ARGUMENTS, !bash, @file
11Skills — cross-toolAgent Skills open standardReads ~/.claude/skills/ for CC compatibility
12Bundled skills/code-review, /batch, /debug, /loop, /claude-api, /run, /verify, /run-skill-generatorNone official
13Skill auto-invokeYes — Claude decides based on descriptionExplicit invocation only
14SubagentsExplore, Plan, general-purpose, claude, user-definedbuild, plan (primary); general, explore, scout (subagent); user-defined
15Parallel subagent spawnYes — multiple Agent calls in one turnYes — general designed for it
16Background subagentsYes — run_in_background: true on Agent + BashHeadless opencode serve + SSE; no per-call flag
17Subagent isolationisolation: "worktree" (git worktree) or "remote" (cloud)Child sessions; no worktree flag
18Model override per subagentYesYes
19Inter-agent messagingSendMessage — named teammates, structured protocol messagesNone equivalent; session fork instead
20Project memoryCLAUDE.md (auto-load, @import); .claude/rules/*.md (path-scoped)AGENTS.md (auto-load, walks up tree); .claude/CLAUDE.md fallback
21Auto memoryYes — Claude writes learnings automaticallyNot documented
22User-global memory~/.claude/CLAUDE.md~/.config/opencode/AGENTS.md
23Org memoryManaged policy (plist, registry, managed-settings.json)Managed dirs + macOS MDM .mobileconfig (highest priority)
24Plugins / marketplace/plugin install, /plugin marketplace add; Anthropic official marketplacenpm-installable + local; community "ecosystem" catalog
25Provider supportAnthropic API + AWS Bedrock (BYOC) + Google Vertex AI (BYOC)75+ providers via AI SDK + Models.dev; OpenCode Zen curated hub; local via lmstudio/, ollama
26Model selection/model opus|sonnet|haiku/models picker; /connect OAuth; per-agent frontmatter; --variant
27Effort / reasoning levels/effort low|medium|high|xhigh; alwaysThinkingEnabledVariants (high, max, low, xhigh, custom)
28Permissionspermissions.allow/deny with wildcardsPer-category (read, edit, bash, glob, grep, task, skill, lsp, question, webfetch, websearch, external_directory, doom_loop) with allow/ask/deny
29Permission precedenceMerge across scopesLast-matching-rule-wins
30Config formatJSON, no commentsJSONC supported; 8-level precedence including remote (.well-known/opencode)
31Terminal / TUIPrimary; plan mode, diff viewer, thinking summariesPrimary; Tab-toggle Plan/Build, --mini mode, diff-wrap toggle
32VS Code extensionYes — officialYes — official (sdks/vscode/)
33JetBrains pluginYes (IntelliJ, PyCharm, WebStorm)Not documented
34Zed integrationNot documentedYes (.zed/)
35Desktop appYes — macOS + Windows x64/ARM64; scheduled tasks, side-by-side sessionsBeta — macOS/Windows/Linux (dmg/exe/deb/rpm/AppImage)
36Web / mobileclaude.ai/code + Claude iOS app + Remote ControlNot documented
37Headless / server-p non-interactive, --init-only for CIopencode serve on port 4096, OpenAPI 3.1, SSE, mDNS
38Slash commands (built-in)/model, /effort, /fast, /skill, /clear, /compact, /memory, /help, /config, /plugin, /rewind, /mcp/init, /undo, /redo, /share, /help, /connect, /models, /compact, /clear
39Custom slash commandsYes (as skills)Yes (markdown with frontmatter)
40@import in memory filesYesNot for imports; @file for TUI fuzzy search
41Background tasksrun_in_background: true; notification on completion; --continue resumesHeadless serve + SSE; session fork API
42Cost modelSubscription (Pro/Max) OR API pay-as-you-go OR Bedrock/Vertex BYOCFree, open source, BYOK on any provider; optional OpenCode Zen aggregator
43Open-source statusCLI proprietary; Claude Agent SDK open source (Node + Python)Fully MIT — 181k stars, 22.4k forks, 14,719 commits (fetched 2026-07-02)
44Interactive promptsAskUserQuestion MCQ tool (4-option cap, ranked recommendation)Permission ask prompts only; no multi-choice widget
45Edit toolsRead, Write, Edit (exact-string), NotebookEdit, Glob, Grep (ripgrep)read, edit, write, patch, glob, grep; each permission-keyed
46Diff viewer / undo/rewind (automatic snapshots); inline in TUI + VS Code/undo, /redo (git-based); session.diff event; diff-wrap toggle
47Team featuresManaged policy; GitHub Actions, Code Review, GitLab CI/CD integrationsRemote config via .well-known/opencode; managed dirs; MDM
48Verbosity / transcriptsshowThinkingSummaries; /config verbose=truesession_export, session_timeline, session.share, POST /session/:id/fork
49ConcurrencyDesktop side-by-side; agent teams via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1Multi-session with child navigation; server monitors all sessions
50StreamingToken + tool-call interleavingSSE at /global/event; message.part.updated streams
51Refactor / LSPVia MCP (e.g. Serena)Built-in LSP for ~32 languages; auto-download; off by default
52Test-driven workflow/verify + /run + /run-skill-generator bundled (v2.1.145+)Custom commands with !bash injection; no dedicated primitive
53File handlingRead, Write, Edit, NotebookEdit, Glob, Grepread, edit, write, patch, glob, grep; @filename fuzzy search
54External CLIBash / PowerShell tool; wildcard permissionsbash tool; plugin $ = Bun shell API
55NotificationsNotification hook + claude-notifications-go plugin; iOS pushHook-based via session.idle (community example: osascript)
56Session lifecycle/clear, /compact, --continue, /rewindsession_new/list/fork/rename/delete/interrupt/compact/share + child navigation
57Language supportAll (LSP-agnostic; base model + MCP)32 first-class LSP; general fallback for rest
58KeybindingsStandard TUI; not deeply configurableFully configurable via ~/.config/opencode/tui.json; ~100 documented actions
59Windows supportNative installer, WinGet, ChocolateyWSL recommended; native via Choco/Scoop/npm/Docker
60GitHub activityanthropics/claude-code closed sourceanomalyco/opencode (was sst/opencode) — 181k stars, 22.4k forks, 14,719 commits, 23 language READMEs

Hands-on: five tasks on the same workspace

Tested 2026-07-02 on a Windows 11 workspace with claude 2.1.196 and opencode 1.17.12 installed side-by-side. The workspace has ~40 MCP servers, a rich AGENTS.md/CLAUDE.md, and hooks for token compression and knowledge lookup.

Task 1 — Read AGENTS.md, summarize the top constraints

  • Claude Code: Zero-work — AGENTS.md auto-imports on every session per this workspace's config. Answer available before I finished typing the question.
  • OpenCode: cd C:/D/oriz && opencode run --auto "..." cold-started, read the file, returned a correct 3-bullet answer in ~25 seconds on opencode/big-pickle (a free OpenCode Zen model). Surprise win: no per-agent config needed — same AGENTS.md picked up automatically.

Task 2 — Grep for a symbol and rename

Both handle text-level rename identically (Grep + Edit with replace_all, or grep + edit). For symbol-level: Claude Code reaches for the Serena MCP server; OpenCode ships built-in LSP for 32 languages, no MCP needed. OpenCode's LSP is off by default, which its own docs justify as a memory trade-off; enable per-language.

Task 3 — Spawn a subagent to research

Both offer parallel subagents. Claude Code has a named researcher subagent pinned to Haiku for cost, invoked via the Agent tool. OpenCode has general, explore, scout — invoke inside a session via @mention. Friction observed: opencode run --agent explore ... failed with "agent 'explore' is a subagent, not a primary agent" — subagents can only be spawned from inside a primary session, not from the shell wrapper.

Task 4 — Fire a hook on user-prompt-submit

  • Claude Code: Add a JSON block to settings.json under hooks.UserPromptSubmit. Filter with matcher + if. Well-worn — this workspace uses it for three separate hooks.
  • OpenCode: Write a TypeScript plugin in .opencode/plugins/, export an async function returning a hooks object with the event name (session.updated, message.part.updated, etc.). Higher setup cost (need Bun, plugin types), but access to the full npm ecosystem via bun install.

Task 5 — Use an MCP server tool

  • Claude Code: .mcp.json at workspace root; 40+ servers wired for this project. mcp__toolbox__search_toolbox for discovery. ENABLE_TOOL_SEARCH=auto keeps schemas out of the cache prefix — meaningful cache-hit-rate win.
  • OpenCode: opencode mcp CLI + mcp block in opencode.json. Supports local (stdio) + remote (HTTP with headers or OAuth via RFC 7591 Dynamic Client Registration); auto-handles 401s on remote. No deferred-loading feature documented.

Recommendation matrix

If you…Pick
Have a Claude subscription and want a smooth managed experienceClaude Code
Want to route to OpenAI, Google, DeepSeek, or local OllamaOpenCode
Need JetBrains, Web, or iOS surfacesClaude Code
Want first-class LSP for many languages with no per-language MCP wiringOpenCode
Want bundled /verify + /run test-driven loopsClaude Code
Prefer JS/TS plugins with npm ecosystem over JSON hooksOpenCode
Need MDM/enterprise-managed policiesEither — both support it
Are on Windows without WSLClaude Code (native installer + WinGet)
Want an MIT-licensed open-source tool you can forkOpenCode
Want deep parallel-subagent orchestration with named messagingClaude Code
Want to mix free + paid models per taskOpenCode (Zen + BYOK)

Conclusion

The parity between these two products in mid-2026 is closer than the discourse suggests. Both auto-load AGENTS.md/CLAUDE.md. Both ship native MCP support with per-tool permissions. Both have 25-30+ hook events, parallel subagents, headless server modes, and mature TUIs. The differentiators cluster into three groups:

  1. Managed vs open — Claude Code is a proprietary, subscription/API product with polish, marketing, and Anthropic's model in the driver's seat. OpenCode is MIT-licensed, provider-agnostic, and moves in the open. Both are legitimate design choices with different failure modes (SaaS lock-in vs BYOK complexity).

  2. Batteries-included vs assembly-required — Claude Code bundles skills (/verify, /run, /rewind), the AskUserQuestion MCQ pattern, and an inter-agent SendMessage primitive. OpenCode ships fewer bundled skills but a more powerful plugin runtime (JS/TS with npm access) and built-in LSP for 32 languages.

  3. Surface breadth — Claude Code covers CLI, VS Code, JetBrains, desktop, web, and mobile. OpenCode covers CLI, VS Code, Zed, and desktop-beta, plus a first-class headless server that lets you build your own surfaces.

If you already work inside the Anthropic ecosystem, Claude Code is the path of least resistance. If your team uses multiple providers, wants to self-host, or needs to embed an agent in a custom surface, OpenCode is unusually strong. Most teams will benefit from having both installed — they don't conflict, they read each other's memory files, and the friction of switching is close to zero.

References

  1. Claude Code — Hooks reference (fetched 2026-07-02)
  2. Claude Code — Overview (fetched 2026-07-02)
  3. Claude Code — Skills (fetched 2026-07-02)
  4. Claude Code — MCP (fetched 2026-07-02)
  5. Claude Code — Subagents (fetched 2026-07-02)
  6. Claude Code — Settings (fetched 2026-07-02)
  7. Claude Code — Memory (fetched 2026-07-02)
  8. Claude Code — Plugins (fetched 2026-07-02)
  9. OpenCode — Intro (fetched 2026-07-02)
  10. OpenCode — Plugins (fetched 2026-07-02)
  11. OpenCode — Agents (fetched 2026-07-02)
  12. sst/opencode GitHub repository (fetched 2026-07-02)
  13. Firecrawl — Claude Code vs OpenCode (2026-06-01)
  14. Thomas Wiegold — I Switched From Claude Code to OpenCode (2026-02-17)
  15. Danilchenko — OpenCode vs Claude Code vs Cursor (2026-06-09)
  16. Turbodocx — Cursor vs Claude Code vs OpenCode 2026 (2026-05-10)
  17. Medium (unicodeveloper) — Claude Code vs Codex vs OpenCode (2026-05-22)

Read it faster

Comments

Comments are powered by giscus. Set PUBLIC_GISCUS_REPO_ID and PUBLIC_GISCUS_CATEGORY_ID in your environment to enable them.