>_ dark-factoryGuides

OpenCode vs Claude Code for Building Agent Systems

The short version: OpenCode is the open-source route with model freedom; Claude Code is the managed route, with hosted automation and memory the agent writes itself; and OpenCode cannot use a Claude Pro or Max subscription. Now the context. Search this comparison and every result on the first page is a vendor blog. Each has a product to sell, and each recommendation bends toward it. We sit somewhere different: we teach both tools. Our Level 1 course uses Claude Code as the primary harness and OpenCode as the open-source route, students finish the build on either, and the course files work on both. So we have no side to argue. This is the comparison we give our own students, with every claim traced to the tools' official docs as of September 2026.

What each one is

OpenCode is an open-source AI coding agent. Open source means the code behind the tool is public: anyone can read it, change it, and run their own copy. It ships under the MIT license, a license that lets anyone use, modify, and redistribute that code, commercial use included. It is maintained by Anomaly, the team formerly known as SST, and its GitHub repository sits at about 203,000 stars, GitHub's bookmark count and a rough signal of developer attention. It runs as a terminal interface (a text-only window where you type instead of click), a desktop app, or an extension inside VS Code and its forks like Cursor and Windsurf, and it can open a web view served entirely from your own machine. The tool itself is free; you pay for the models it drives, and you have unusual freedom in how. It connects to more than 75 model providers with your own API key (a personal access code from a model provider, billed by the token, the small chunks of text a model reads and writes), runs local models through Ollama, LM Studio, or llama.cpp, and signs in with certain existing subscriptions, covered below. Two optional paid services exist from the OpenCode team: Zen, a pay-as-you-go model gateway that includes some free models, and Go, a $10 per month subscription for a set of more than 25 curated open-source coding models, with usage limits.

Claude Code is Anthropic's agent, and it runs Claude models only. It ships as a terminal program, a desktop app for Mac and Windows (Linux in beta), a hosted web version, plugins for VS Code and JetBrains editors, and a companion in the Claude mobile app. Its working parts will sound familiar after the OpenCode list, because the two feature sets run remarkably parallel: instruction files, reusable skills, subagents (smaller agents the main agent hands tasks to), hooks (scripts that fire on their own when something happens, like a file being saved), and MCP connections (Model Context Protocol, a standard for plugging outside tools like Drive or Slack into an agent). Two things stand apart. First, memory: on top of instruction files you write, Claude Code keeps notes it writes itself, per project, loaded automatically each session. Second, managed automation: cloud Routines run on Anthropic's side, on a schedule, with your computer off, and an Agent SDK (a software kit for building your own agents on the same machinery) covers whatever you want to build beyond that. There is no free tier. It comes with paid Claude plans from $17 a month on annual billing ($200 billed up front; $20 a month if billed monthly), or you can pay per token through the API instead.

The fact most comparisons get wrong

You cannot use a Claude Pro or Max subscription inside OpenCode. OpenCode's own docs are straight about it: plugins that enabled Claude subscription sign-in used to ship with the tool, Anthropic explicitly prohibits that use, and the plugins were removed as of version 1.3.0. If you want Claude models inside OpenCode, you pay per token with an Anthropic API key.

What OpenCode can sign in with: GitHub Copilot, ChatGPT Plus or Pro, and GitLab Duo. If you already pay for one of those, OpenCode lets you drive it from your own machine at no extra tool cost. But the plan many people arrive with, buy one Claude subscription and use it from whichever tool they like, is not on the table. Claude subscription pricing only pays off inside Claude Code.

The comparison that matters

CategoryOpenCodeClaude Code
Source modelOpen source, MIT license, maintained by AnomalyProprietary, built by Anthropic
Models75+ providers by API key, local models (Ollama, LM Studio, llama.cpp), Copilot / ChatGPT Plus / GitLab Duo sign-in; Claude by API key onlyClaude models only
Cost shapeFree tool; pay per model use, or Go at $10 a month for open modelsNo free tier; paid Claude plans from $17 a month on annual billing, or API pay per token
What agents rememberInstruction files you write, project-level and globalInstruction files plus notes the agent writes itself, per project
Reads the other's filesYes: CLAUDE.md and .claude/skills, directlyPartly: AGENTS.md via a one-line import
Work while you are awaySelf-hosted: scripts, CI, a headless server you runManaged: cloud Routines, local scheduled tasks, Agent SDK
SurfacesTerminal, desktop app, VS Code family, self-hosted webTerminal, desktop app, VS Code and JetBrains, hosted web, mobile

Where OpenCode is the right answer

Pick OpenCode when ownership is the point. The whole tool is inspectable and yours to run, and its homepage states that OpenCode "does not store any of your code or context data." It is the natural choice if you want local models on hardware you control, if your model access already comes through Copilot, ChatGPT Plus, or GitLab Duo, or if you want to pick a different model for each job and pay only for what you use. It is also the tool that matches this site's stated values most literally: we teach people to own their systems, and open source is ownership written into the license.

Its unattended story fits the same shape. You can run it non-interactively with opencode run for scripted jobs, wire it into CI (continuous integration, the automated checks that run whenever code is pushed) through GitHub Actions or GitLab, where mentioning /oc in an issue triggers it inside your own runners (the machines GitHub or GitLab spins up to do the work), and stand up opencode serve, a headless server (one with no visible interface) exposing a REST API, a standard way for other programs to talk to a running service over the network. Those are real primitives. They are also all yours to host: its docs describe no scheduler and no hosted execution, so the timing and the machine are yours to provide.

Where Claude Code is the right answer

Pick Claude Code when you want the managed path. The clearest example is that same unattended story: the two differ in kind, not degree. Where OpenCode hands you self-hosted parts, Claude Code hands the job to Anthropic. Routines run in Anthropic's cloud on a schedule with your laptop closed, scheduled tasks run locally from the desktop app, and the Agent SDK covers custom builds. Memory is the second real gap: OpenCode's docs describe instruction files only, a project AGENTS.md plus a global one, and no automatic memory the agent writes itself, while Claude Code maintains its own per-project notes without being asked. Add the longer surface list, hosted web and mobile included, and the pitch is coherent: one subscription, one agent, every screen, with Anthropic running the infrastructure you would otherwise run yourself.

You are not choosing a prison

Here is the part vendor comparisons rarely dwell on, because it undercuts the pressure to choose: these tools read each other's files. OpenCode documents it directly. A project with no AGENTS.md falls back to CLAUDE.md, no global AGENTS.md falls back to the global CLAUDE.md, and skills in the Claude Code format, .claude/skills folders with a SKILL.md inside, load as-is. Claude Code reciprocates partway: it reads AGENTS.md through a one-line import, and its /import command migrates other agents' configuration. Both support skills, subagents, MCP, hooks or plugins, and a non-interactive mode. So the architecture you learn on one transfers to the other, which is exactly why our course is written against a tool selector instead of a single harness. The system is the thing you own. The harness is a decision you can revisit.

The honest recommendation

If you already pay for a Claude plan, or you want automation that runs with your machine off and an agent that keeps its own memory, Claude Code earns its subscription. If you want open source, local models, or model freedom, or your model access already comes through Copilot or ChatGPT Plus, OpenCode is free to adopt and your existing subscription may cover the models. Both are serious tools, both have an app route that never touches a terminal, and neither locks you in. If you have never used a tool like this, our guide for non-developers covers what working with an agent actually feels like, and if your real question is about editors, Claude Code vs Cursor is the better read. In Level 1, both harnesses build the same system: agents, memory, and orchestration on hardware you control.

New to agents entirely? Start with the free primer. Ready to build with either tool? Level 1 is $79, one-time, and teaches both harnesses. Not sure it fits: the compare page covers what Dark Factory is not.