Published: Last updated:

OpenCode

OpenCode: an AI coding agent under the team's own control

OpenCode is an open-source AI coding agent for the command line: a model-agnostic tool under the MIT licence that writes, reviews and refactors code with language models, with the team's own keys and under their own control.

The jump from AI in a browser chat to an agent in the terminal changes work on code: instead of copying answers, the tool acts directly on the project, reads files, proposes changes and carries them out once approved. OpenCode fills that spot openly and without binding to a single model provider. This page sets out what OpenCode is, where its control advantage lies, and where its limits run.

Terminal agent for development

OpenCode is built by Anomaly and is open source under the MIT licence. It brings an AI coding agent straight into the terminal, complemented by a desktop app and extensions for the common development environments. Instead of being tied to one provider, it reaches a broad range of models through the Models.dev service, from cloud APIs such as Claude, GPT and Gemini to locally run models. Two built-in agents separate the roles cleanly: a build agent with write access that changes code, and a plan agent that only reads and analyses. Through language-server support (LSP) the agent understands the project not just as text but as code with structure.

Code and Keys Stay with the User

The real difference from a hosted assistant is control. Because OpenCode is model-agnostic, the sensitive part of the work can be steered onto a locally run model, while uncritical tasks may still go to a capable cloud API. The keys to the providers stay with the user, and the tool itself does not store the code and the context on foreign servers. That makes an AI coding workflow possible that stays on sovereign infrastructure instead of handing every file to a single provider. Which models and tools such an agent may use at all is a question of AI governance, not of the tool.

Use cases

Three patterns recur. First, automating code reviews: the plan agent checks changes against defined criteria without intervening itself. Second, targeted refactoring: the build agent runs recurring refactors or bulk updates across several files, with approval before each step. Third, documentation: change logs and technical descriptions derived from the code. In all cases OpenCode is the agent loop as a concrete tool on code, a sibling of Claude Code and Cursor IDE.

Limits

OpenCode is an agent, not a self-runner. What holds for AI agents in general holds here: as autonomy grows, so does the blast radius of a mistake. A tool with write access in the wrong loop is a real risk, which is why approval before consequential steps and a considered permission model are ground rules. Quality also depends on the chosen model and the upkeep of the configuration; a locally run model closes the data outflow but may cost peak performance. The ongoing work on code is best thought of as part of AI development and a good developer experience, not a replacement for them.

References

  • Anomaly OpenCode documentation. Official documentation on installation, the agents (build and plan), model connection and IDE integration. (2026). opencode.ai/docs
  • Anomaly OpenCode on GitHub. Open-source code base under the MIT licence, the open-source AI coding agent for the terminal. (2026). github.com/anomalyco/opencode
  • OSI The MIT licence. The full text of the permissive licence OpenCode is released under. (2006). opensource.org/license/mit

Related topics

Ask AI

These links open external AI services, the conversation and its content are sent to their providers.