Skip to main content
9 – 17 UHR +49 8031 3508270 LUITPOLDSTR. 9, 83022 ROSENHEIM
DE / EN
Coding agent Anomaly United States Terminal, VS Code, Desktop

OpenCode

OpenCode is Anomaly's open-source AI harness for the terminal: a coding agent with free model choice across 75+ providers, MCP tools and custom endpoints.

Licence MIT
First release May 2025
Interfaces Terminal (CLI), VS Code, Desktop app (beta), Web/server
Platforms macOS, Linux, Windows
Instruction file AGENTS.md

The seven building blocks in OpenCode

How OpenCode implements the building blocks of an AI harness

  1. 1

    Agent loop

    The agent loop runs interactively in the terminal, headless via 'opencode run', or persistently via 'opencode serve'; tool requests are evaluated, executed, and the result is written back into the context.

  2. 2

    Tools and execution environment

    Built-in tools for file access, search, bash and web fetch can be extended with MCP servers configured in 'opencode.json' as type 'local' or 'remote'.

  3. 3

    Context management

    Project rules live in 'AGENTS.md' (falling back to 'CLAUDE.md'); the 'instructions' field in 'opencode.json' can add further files and glob patterns.

  4. 4

    State and memory

    Sessions can be resumed or branched with '--continue', '--session' or '--fork'; server mode keeps state accessible through an OpenAPI interface.

  5. 5

    Permissions

    Rights are set per action ('bash', 'edit', 'webfetch' and others) to 'allow', 'ask' or 'deny', with pattern-based rules where, per the documentation, the last matching rule wins.

  6. 6

    Verification and feedback

    Changes can be rolled back step by step with '/undo' and '/redo'; a separate, restricted plan agent supports analysis before changes are made.

  7. 7

    Orchestration

    Three built-in subagents - 'general' (multi-step tasks with tool access), 'explore' (read-only codebase search) and 'scout' (read-only research on external docs/dependencies) - complement the primary agents; custom subagents defined as markdown files in '.opencode/agents/' or '~/.config/opencode/agents/' can be invoked via '@' mentions.

Models and model access

Which models the harness uses and how they are obtained

Models and model access
Models No fixed default model - freely selectable per session and agent
Access routes Anthropic, OpenAI, Google, Amazon Bedrock, Ollama, LM Studio, OpenCode Zen, custom OpenAI-compatible endpoints
Free choice of model Yes
Custom endpoint / LLM gateway Yes
Custom OpenAI-compatible providers are added in 'opencode.json' via 'provider.<id>.options.baseURL' with 'npm: "@ai-sdk/openai-compatible"', documented for example for Ollama, LM Studio or llama.cpp.
Features
MCP servers Sub-agents Skills Plugins / extensions Headless / CI SDK IDE integration Checkpoints Resume sessions
Running it with herdr
Supported by herdr Yes
State detection Lifecycle plugin when installed, otherwise screen manifest
Integration State and session
Per herdr's documentation, the integration prefers an installed lifecycle plugin and thereby reports both state and session.
More about herdr →

Enterprise use

Data processing, controls and pricing model according to the vendor

Data processing

Per the documentation, OpenCode itself does not store any code or context data; requests run locally or go directly to the chosen model provider - the optional '/share' feature is the one exception.

Identity and access

Central configuration lets organizations plug in their SSO provider to obtain credentials for an internal AI gateway from their existing identity management system.

Admin policies

Per the documentation, organizations can centrally disable other model providers so that all requests go through approved infrastructure.

Sharing controls

The '/share' feature can be disabled project-wide via '"share": "disabled"' in 'opencode.json'; per the vendor, enterprise customers additionally get SSO-restricted access or self-hosting.

Pricing model

Per the vendor, Enterprise is billed on a per-seat basis; organizations with their own LLM gateway are not charged additional token costs through OpenCode.

Strengths
  • Very broad provider choice via the AI SDK/Models.dev integration (documented as 75+ providers)
  • Open-source code under the MIT licence, so it can be inspected and modified
  • Custom OpenAI-compatible endpoints configurable directly in 'opencode.json'
  • Server mode with an OpenAPI specification and generated SDK for custom integrations
  • Broad compatibility with Claude Code files ('CLAUDE.md', skills) eases migration
Limitations
  • No standalone hooks system documented - comparable events run through the plugin mechanism
  • No documented sandbox mechanism - permissions are governed by approval workflows rather than process isolation
  • Shared sessions via '/share' remain publicly accessible, per the documentation, until actively unshared

Use cases

Typical tasks for this harness

Terminal-based development with free model choice per task
CI/CD automation via 'opencode run' and 'opencode serve'
Migrating Claude Code projects thanks to 'AGENTS.md'/'CLAUDE.md' compatibility
Connecting self-hosted or local models via Ollama, LM Studio or llama.cpp
Building custom tools through plugins and MCP servers

OpenCode is Anomaly’s (formerly SST) open-source AI harness for the command line: a coding agent that makes language models operational through MCP tools, context management and a fine-grained permission system - freely combinable with more than 75 model providers. As of 20 September 2026.

What is OpenCode?

OpenCode grew out of SST (Serverless Stack); the sst GitHub organization’s own profile now points to its move to anomalyco, and the active repository lives at github.com/anomalyco/opencode, licensed under MIT per its LICENSE file. Per GitHub releases, the first versions shipped in May 2025. OpenCode runs as a terminal application (TUI), as a beta desktop app for macOS, Windows and Linux, and through a VS Code integration that installs automatically the first time it is launched from the terminal. It is installed via, among other options, npm i -g opencode-ai@latest, brew install anomalyco/tap/opencode, or the official install script, and started by running opencode inside a project directory.

OpenCode as an AI harness

The agent loop evaluates the model’s tool requests, executes them, and writes results back into the context - interactively in the terminal, headless via opencode run, or persistently via opencode serve with an OpenAPI interface. Tools are extended through MCP servers configured in opencode.json as type: "local" (a start command) or type: "remote" (a URL plus headers). Project rules live in AGENTS.md, falling back to CLAUDE.md for Claude Code migrations. Two built-in primary agents - build (full access) and plan (asks by default before file edits and bash commands) - are switched with the Tab key. Three built-in subagents handle sub-tasks: general (multi-step research and tasks with tool access), explore (read-only codebase search) and scout (read-only research on external docs and dependencies); custom subagents are defined as markdown files with YAML frontmatter in .opencode/agents/. Permissions are set per action (bash, edit, webfetch and others) to allow, ask or deny.

Models and model access

Per its documentation, OpenCode connects to more than 75 providers, drawing on the AI SDK and Models.dev - from Claude to GPT to Gemini, plus local models via Ollama, LM Studio or llama.cpp. With OpenCode Zen, the vendor also runs its own model marketplace curated for coding agents. Custom OpenAI-compatible endpoints are explicitly supported: in opencode.json you add a provider with "npm": "@ai-sdk/openai-compatible" and "options": {"baseURL": "..."}. That means OpenCode can be run through the AI Gateway, provided the gateway is registered as an OpenAI-compatible endpoint.

Enterprise use: data protection and governance

Per the documentation, OpenCode itself does not store code or context data; requests go locally or directly to the chosen model provider - the one exception being the optional /share feature, which creates public links and can be turned off via "share": "disabled". Organizations can plug their SSO into central configuration, and can also disable other model providers so that all requests route through approved infrastructure. Regardless of the harness used, source code and prompts go to whichever model provider is chosen, and that flow belongs in the record of processing activities beforehand.

Orchestrating OpenCode with herdr

Per herdr’s documentation, herdr supports OpenCode through a lifecycle plugin when installed, falling back to a screen manifest otherwise; the integration reports both state and session. Details and the full list of supported harnesses are on the herdr page.

Where it fits: developer harness and enterprise harness

OpenCode is a harness for developers working in the terminal - for business users who work without a command line, CompanyGPT is the matching harness, with MCP tools, enterprise knowledge, and roles sourced from Entra ID or Keycloak. The AI Gateway provides the shared cost and governance layer across both worlds. Our overview of all AI harnesses covers further coding agents and orchestrators. We help organizations integrate OpenCode and other coding harnesses cleanly into existing identity, cost and compliance structures.

From developer harness to enterprise harness

Coding harnesses are tools for developers. Business users, cost control and governance need two more layers.

CompanyGPT – the harness for business users

CompanyGPT gives any language model tools via MCP servers, integrations and n8n, company knowledge via companyRAG, roles from Entra ID or Keycloak, and audit logs – operated in your Azure environment or sovereignly on STACKIT.

Discover CompanyGPT
AI Gateway – cost and governance for every agent

The AI Gateway bundles the model access of your tools and coding agents behind an OpenAI-compatible API: authentication via Entra ID, budgets and cost centres per team, user and agent, guardrails and complete logging.

View the AI Gateway

Frequently Asked Questions

What is OpenCode?

OpenCode is an open-source AI harness for the command line, built by Anomaly (formerly SST), that turns a language model into a coding agent by adding tools, context management and permissions. The code is published on GitHub under the MIT licence.

Is OpenCode open source?

Yes. The 'anomalyco/opencode' repository is licensed under MIT, which also permits commercial use, modification and redistribution.

Which models does OpenCode support?

OpenCode is model-agnostic and, per its documentation, connects to more than 75 providers, including Claude, GPT and Gemini models as well as local models via Ollama or LM Studio. The vendor also runs OpenCode Zen, its own model marketplace.

Can I connect a custom OpenAI-compatible endpoint?

Yes. In 'opencode.json' you can register any OpenAI-compatible service as a custom provider under 'provider.<id>.options.baseURL' with 'npm: "@ai-sdk/openai-compatible"'.

Can OpenCode be used in a GDPR-compliant way?

Per the documentation, OpenCode itself does not store code or context data; requests go directly to the chosen model provider. Whether that is GDPR-compliant depends on the provider chosen and the data processing agreement in place - for sensitive projects the '/share' feature should be disabled.

Does OpenCode work with herdr?

Yes. Per herdr's documentation, the integration uses a lifecycle plugin when installed, otherwise the screen manifest, and reports both state and session to herdr.

Introduce coding agents safely in your company

We support selection, model access in the EU, permission design and cost control.