OpenCode

Anatomy of the Fastest-Growing Open Source AI Coding Agent

Deep Dive

github.com/anomalyco/opencode

The Numbers

Zero to 100K stars in 8 months

102K
GitHub Stars
732
Contributors
9,130
Commits
912
Releases
1M
Lines of Code
10M+
Total Downloads

First commit: March 21, 2025 — MIT License — TypeScript + Bun

The Origin Story

From Serverless Stack to AI Coding Agents

2017 Jay V & Frank Wang meet at University of Waterloo, launch Anomaly Innovations
2021 Take SST (Serverless Stack) through Y Combinator — $1M raised from PayPal, LinkedIn, YouTube founders
2025 Q1 SST turns profitable with 25K GitHub stars. Dax Raad (early SST user, joined 2021) becomes co-founder
Jun 19, 2025 OpenCode launches — Jay, Frank, Dax & Adam Elmore ship the open-source AI coding agent
Jan 2026 Hits 100K stars, 650K MAU, adopted by Cloudflare — 300K+ downloads/day

The Thesis

"There will be an explosion of AI coding models. Developers will demand open-source alternatives to locked-in tools."

— Jay V, CEO of Anomaly

The Gap They Saw

Claude Code locked to Anthropic. Cursor locked to its IDE. No open-source terminal agent that could work with any model, any provider.

The Explosion

Total Downloads Over Time

58K
Jun
261K
Jul
475K
Aug
764K
Sep
1.19M
Oct
1.78M
Nov
2.77M
Dec
10.2M
Jan 26

Jan 6, 2026: 247K downloads in a single day. By Jan 29: 386K/day. The hockey stick went vertical.

System Architecture

Client-Server with Provider-Agnostic Core

ClientsTUI (SolidJS) / Desktop (Tauri) / Web (Astro) / IDE Extensions
ServerHono HTTP + WebSocket API on port 4096
Agent EngineVercel AI SDK — build, plan, general agents
Providers + Tools75+ models / 46+ tools / LSP + MCP protocols
Storage + InfraFile-based sessions / SST on Cloudflare + PlanetScale

Key insight: the server is the brain. Clients are thin — TUI, desktop, and web all talk to the same API.

Monorepo: 18 Packages

One repo, many surfaces

PackageRole
opencodeCore CLI + server + agent
appShared web UI (SolidJS)
desktopNative app (Tauri v2)
webLanding page (Astro 5)
uiComponent library
sdkAuto-generated API client
pluginPublic extension API
PackageRole
console/*User accounts + billing
functionWebhooks + GitHub App
identityAuth (OAuth2)
slackSlack bot integration
enterpriseEnterprise features
extensionsVS Code / IDE plugins
containersDocker configs

Build orchestration: Turbo — Infrastructure: SST — Runtime: Bun 1.3+

The Core Engine

Agent Loop: Stream → Tool → Permission → Repeat

// Simplified agent loop
while (response.hasToolCalls) {
  for (const call of response.toolCalls) {
    // Check permissions
    const ok = await permission.ask(call)
    if (!ok) throw PermissionDenied

    // Execute tool
    const result = await tool.run(call)
    history.push(result)
  }
  // Stream next LLM response
  response = await provider.stream(history)
}

Three Agent Types

  • build — Full access, default agent for development
  • plan — Read-only, analysis and exploration
  • general — Sub-agent for complex multi-step tasks

Switch agents with Tab. Each has its own permission ruleset, model, and temperature.

Provider System

75+ models, 20+ providers, zero lock-in

Bundled Providers

Anthropic (Claude) OpenAI (GPT-5+) Google (Gemini) Azure OpenAI Mistral Groq Amazon Bedrock DeepInfra XAI (Grok) Cohere OpenRouter GitHub Copilot TogetherAI Cerebras GitLab AI Local models

OpenCode Zen

Curated provider with hand-tested deployments per model. Volume discounts flow back to users.

Powered by Vercel AI SDK — unified interface for all providers with streaming, tool use, and caching.

Use a cheap model for planning, then switch to an expensive model for execution.

Tool System: 46+ Tools

Zod-validated, permission-gated, LSP-integrated

CategoryTools
File Opsread, write, edit, patch, glob, grep, ls
Executionbash, pty, task (sub-agents)
Searchwebsearch, codesearch, sourcegraph
Analysislsp, diagnostics
CustomUser-defined .ts/.js in project
ExternalMCP servers (stdio + SSE)

Safety Layers

  • Read-before-write enforcement
  • Modification time verification
  • Uniqueness checks for edits
  • Diff preview before approval
  • LSP diagnostics after every write
Tool.define("edit", {
  parameters: z.object({
    path: z.string(),
    old_string: z.string(),
    new_string: z.string()
  }),
  execute(args, ctx) { /* ... */ }
})

TUI: Built for Terminal Power Users

SolidJS + OpentUI = reactive terminal UI

  • SolidJS signals for reactive state (not React)
  • OpentUI — their own terminal UI library
  • Context providers: routing, SDK, theme, keybindings, sync
  • 11 dialog types: permissions, sessions, command palette, model picker...
  • Prompt history with frecency ranking

Desktop wraps the same UI via Tauri v2 with 12 native plugins (clipboard, notifications, auto-update, etc.)

// TUI entry point (simplified)
const App = () => (
  <RouteProvider>
    <SDKProvider>
      <ThemeProvider>
        <KeybindProvider>
          <DialogProvider>
            <SessionView />
          </DialogProvider>
        </KeybindProvider>
      </ThemeProvider>
    </SDKProvider>
  </RouteProvider>
)

Development Velocity

Commits per month — acceleration is the story

152
Apr
301
May
654
Jun
650
Jul
614
Aug
518
Sep
709
Oct
1,049
Nov
1,877
Dec
2,083
Jan

912 releases in 10 months = ~3 releases/day

Peak: 176 releases in June alone

Most active: Tuesday (1,748 commits)

Peak hour: 12:00 PM (lunchtime shipping)

AI-Powered Development

They eat their own dogfood

Co-Authored-By Breakdown

GitHub Action
981 commits
rekram1-node
217
opencode-agent
100
OpenCode
82
Claude
19

AGENTS.md

They maintain a dedicated style guide for AI agents working on the codebase:

  • Single-word variable names
  • No try/catch, use .catch()
  • No else, use early returns
  • No destructuring — use dot notation
  • Prefer const + ternaries over let
  • Use Bun.file() APIs

Code Review & Community

High trust, low ceremony, strict quality gates

PR Patterns (last 100 merged)

Merged without formal review (84%)
Had code reviews (16%)

Core team ships fast with high trust. Community PRs get reviews.

Trust & Vouch System

  • vouch @user — mark as trusted
  • denounce @user — auto-close issues/PRs
  • No AI-generated walls of text in PRs
  • Issue-first policy (no PRs without issues)
  • Conventional commits required

Denouncement is reserved for repeated low-quality AI spam, not disagreements.

Permission & Security Model

Granular control over every agent action

// Permission ruleset
{
  "read": { "*": "allow",
             "*.env": "ask" },
  "write": { "*": "ask" },
  "bash": { "*": "allow",
             "rm -rf": "deny" },
  "external_directory": "ask",
  "doom_loop": "ask"
}

Three modes: per-action, session-wide, auto-approve (CI/CD)

Privacy-First Architecture

  • No code stored — zero telemetry by default
  • Sessions stored locally as JSONL
  • .env files always require explicit approval
  • External directories gated separately
  • Doom loop detection prevents infinite agents

Cloudflare adopted OpenCode for internal use precisely because of this architecture.

Session Management

Compaction, forking, sharing, undo

Session Lifecycle

  • Create — new conversation, optional parent for threading
  • Compact — summarize old messages, shrink context window
  • Fork — branch a session for exploration
  • Share — encrypted URL for read-only replay
  • Revert — undo to any message with file snapshots

Message Format

type MessageV2 =
  | Human    // user input + attachments
  | Assistant // multi-part response
    { content: Part[]
      // Text, ToolCall, Error, Meta
      thoughts?: string
      moderation?: Status }
  | System   // system prompts

Stored as JSON at ~/.opencode/message/{sid}/{mid}.json

OpenCode vs Claude Code

Daniel Miessler: "Claude Code's secret sauce isn't so secret"

OpenCodeClaude Code
Models75+ models, 20+ providersClaude only
Lock-inNone — MIT licensedAnthropic ecosystem
UI SurfacesTUI + Desktop + Web + IDECLI only
ArchitectureClient-server (remote-able)Monolithic CLI
PrivacyZero telemetry, local storageAnthropic cloud
StrengthThoroughness, provider flexibilityPolish, orchestration quality

Both tools now deliver comparable results on complex development workflows. The market is expanding beyond a single dominant solution.

Dax Raad's Philosophy

What the creator thinks you're getting wrong about AI

"Feeling productive and being productive are fundamentally different things."

Lessons for Teams

How to ship like the OpenCode team

Velocity Tactics

  • Ship daily — 912 releases in 10 months
  • Trust core team — 84% PRs merge without review
  • Automate everything — 981 GitHub Action commits
  • Dogfood aggressively — use your own agent to build your agent
  • AGENTS.md — give AI contributors explicit style rules

Quality Gates

  • Issue-first — no PR without a linked issue
  • Conventional commits — structured history
  • Denounce spam — Vouch system blocks bad actors
  • No AI walls of text — respect reviewer time
  • Feature gates — UI/core changes need design review

The formula: High trust for the core team + strict gates for the community + AI agents as first-class contributors.

The Agent is
Open Source

OpenCode shipped the future of coding agents — in the open, at breakneck speed.

agent37.club

github.com/anomalyco/opencode  •  opencode.ai