OpenCode: The Agent That Doesn't Take the Loop From You
A year ago the question was whether a model could write the code. That answer is boring now — it can. The question today is quieter and more important: who holds the loop. Who decides when the agent reads, when it writes, when it stops, where your files go, and what happens if a vendor changes its terms tomorrow.
OpenCode is one of the few answers where the loop stays with you. An open source coding agent that runs in the terminal, with a desktop app and an editor extension. The code is public, and the architecture is client/server: the server talks to the model, executes tools and stores sessions in a local database, while the TUI is just one possible client. That sounds like a detail. It isn't — it's the difference between a product you use and a system you can adjust.
The other thing that interests me more than any leaderboard: OpenCode isn't tied to one provider. Drop in a key from whoever you like — or drop in none and point it at a local model through Ollama. This is exactly where it meets things I've written about before: local models in .NET and the small ideas that don't want the cloud. For a company whose code contractually cannot leave the network, this isn't convenience — it's the precondition for having a conversation at all.
Permissions are psychology, not security
The most interesting part of OpenCode, for me, isn't engineering. The agent has two primary modes you switch between with Tab: build, with full access, and plan, which reads, analyses and proposes but touches nothing without asking. Every action can be set to allow, ask or deny.
On paper that's a security mechanism. In practice it's something else. Every time the agent stops and asks, I get one second in which I have to decide consciously. That second is precisely the space I wrote about in Be Proactive — between stimulus and response. Without it, you slide very quickly into pressing Enter on autopilot, and twenty minutes later you're staring at a diff you don't understand.
The friction here is design, not obstruction. The same principle I apply in reverse in SamsaraForge — make the good action easy and the bad one hard — works here to keep the human inside the loop. Autonomy is attractive right up until it costs you half a day to untangle what the agent did while you were getting coffee.
Context that travels with the project
OpenCode reads AGENTS.md from the project root — the same file I wrote about in onboarding an AI agent. That's a small but real win for teams: project context lives in the repo, goes into git, gets reviewed like code, and doesn't depend on which agent any individual happens to prefer. MCP servers attach the same way — through configuration, not through somebody's plugin store.
The honest part
Open doesn't mean free. You still pay for tokens unless you're on a local model — and a local model will be noticeably weaker than the best one available. Open doesn't mean smarter either: the quality of the result comes mostly from the model underneath, and the agent is the shell that gives it eyes, hands and limits. And like any agent, it can chase the wrong lead, burn tokens, and confidently write something that doesn't work.
What you get is different: the ability to swap the model without swapping your workflow; the ability to read exactly what the agent does before you point it at production code; and the ability to run it on a machine with no internet at all.
If you want to try it tonight
curl -fsSL https://opencode.ai/install | bash
opencode auth login
cd your-repo
opencode
Run /init first so it writes an AGENTS.md for the project. Then stay in plan mode for the first few tasks — make it explain the code to you before you let it change the code. And pick a real but small task: a rename across a few files, a missing test, an endpoint that needs adding. Toy problems tell you nothing about a tool; a real repository tells you everything.
The interesting question is no longer how autonomous an agent can be, but how much of the loop I want to keep for myself. A tool that leaves me that choice is worth more than one that makes it for me.


Comments (0)