OpenCode: the open-source coding agent that isn't tied to one model
OpenCode is an open-source coding agent where you pick the model. What Plan and Build, LSP and AGENTS.md do, which subscriptions you can connect, and why a Claude subscription no longer works since 2026.

Most coding agents belong to a model maker. Claude Code runs on Claude, Codex on OpenAI's models. OpenCode belongs to no one: it is an open-source agent where you choose which model does the work, and you can switch per task. As a full-stack developer (PHP and Python), that is why it caught my attention. Here is what OpenCode does, which subscriptions you can and can't use with it, and how to get started.
As of September 2026. This article first appeared in January 2026 and has been updated. One important change: you can no longer use a Claude subscription in OpenCode (see below).
What is OpenCode?
OpenCode is an open-source AI coding agent under the MIT licence. Like Claude Code, it reads your codebase, drafts a plan, edits files and runs commands. The difference is the models: OpenCode works with more than 75 providers, from OpenAI and Anthropic to Google, xAI and DeepSeek. You use it in the terminal, as a desktop app (macOS, Windows, Linux) or as an extension in your IDE.
It is growing fast. When this article came out in January 2026, the project had just over 60,000 stars on GitHub. In September 2026 it has about 210,000, and the makers cite 16 million developers a month on their site. That last figure is the company's own claim, not an independent measurement.
Which models and subscriptions can you use?
The idea of plugging a subscription you already have into OpenCode still holds, but no longer for every subscription.
- ChatGPT Plus or Pro: works. You log in through the browser and use OpenAI's models within your plan.
- GitHub Copilot and GitLab Duo: also work without extra setup.
- Claude Pro or Max: no longer works. In January 2026 Anthropic blocked the use of subscription logins in third-party tools. Under Anthropic's terms, signing in with a Claude account is meant for Claude Code and Anthropic's own apps. OpenCode removed the plugins for it as of version 1.3.0. You can still use Claude models in OpenCode, but only with an API key, paying per use.
- API keys: from any supported provider. Through OpenRouter one key gives you access to models from many providers.
- OpenCode Zen: a paid selection of models that the OpenCode team has tested for use in a coding agent. Free models are included as well.
Losing Claude subscriptions changes the maths. If you mainly work with Claude and pay for a plan, Claude Code is probably cheaper: there you use the subscription, in OpenCode you pay per token. OpenCode makes sense if you already pay for ChatGPT or Copilot, or want a different model per task.
Plan and Build: think first, then build
OpenCode has two built-in agents. Plan may read and analyse but not change files: you get a proposal for how it would tackle the task. Build actually does the work. The Tab key switches between them.
That prevents surprises. Say you want to add an export feature to an existing Laravel application. In Plan you first see which controllers, jobs and views the agent intends to touch. Only when that looks right do you switch to Build.
LSP and AGENTS.md: getting to know your project
Two features make OpenCode stronger in existing codebases.
LSP integration. OpenCode can use language servers, the same technology your editor uses to know types, definitions and errors. The agent doesn't have to guess where a function is defined.
AGENTS.md. The /init command analyses your project and writes an AGENTS.md describing its structure and coding patterns. You add your own rules there too: which PHP version, how tests run, which folders are off limits. AGENTS.md is a shared convention; other agents read the file as well, Claude Code for example. So you write your project instructions once.
Installation and your first session
On macOS and Linux:
curl -fsSL https://opencode.ai/install | bash
Or via npm or Homebrew:
npm i -g opencode-ai@latest brew install anomalyco/tap/opencode
There are Windows packages too (Chocolatey, Scoop). Then:
- In the terminal, go to your project and run
opencode. - Type
/connect, choose a provider and log in or enter your API key. - Type
/initto have anAGENTS.mdgenerated, and check what's in it.
An example: letting it scaffold a project
Take this as a practice task: "Build an encrypted file manager with a FastAPI backend." Start in Plan. Let the agent propose the parts it needs: encryption and decryption logic, FastAPI routes and schemas, configuration and tests. Review that plan, especially the choice of encryption library and how keys are stored. Then let Build carry it out and run the tests.
How good the result is depends heavily on the model you pick. That's what OpenCode is handy for: run the same task with two models and compare.
Who is OpenCode for, and who not?
What makes OpenCode strong:
- fully open source, so you can read what the agent does;
- free choice among dozens of providers, with no vendor lock-in;
- good in existing codebases, thanks to LSP and
AGENTS.md; - an active community and fast development.
What to keep in mind:
- you need to be comfortable with the terminal and API keys;
- quality depends heavily on the model you choose, and working that out is up to you;
- good results require clear instructions and a tidy project structure.
If you work with a Claude subscription, use Claude Code. If you pay for ChatGPT or Copilot, or don't want to be tied to one model maker, try OpenCode on a project you know well. Start in Plan, and see whether its proposal beats what you would have come up with.


