AI & DevelopmentOpen SourceDeveloper Tools

OpenCode: The Open-Source AI Coding Agent at 160K Stars

OpenCode terminal interface showing model-agnostic AI coding agent with multiple LLM provider connections
OpenCode: The open-source AI coding agent connecting to 75+ LLM providers

Anthropic blocked it in January. OpenAI officially partnered with it in April. 7.5 million developers adopted it anyway. OpenCode just crossed 160,000 GitHub stars — making it the most-starred open-source AI coding agent ever built — and the story of how it got there says more about where AI tooling is headed than any product announcement this year.

What Happened in January

On January 9, 2026, Anthropic quietly deployed server-side blocks that cut off OpenCode from accessing Claude through consumer OAuth tokens. The error was blunt: “This credential is only authorized for use with Claude Code and cannot be used for other API requests.”

OpenCode had been using the same OAuth authentication flow as Claude Code to give its users access to Claude Pro and Max subscriptions. Anthropic’s position was straightforward: that’s unauthorized use of their authentication infrastructure, and it costs them API revenue. On February 19, the Terms of Service were updated to make it explicit — OAuth tokens from Free, Pro, and Max plans cannot be used with third-party tools.

The community reaction was fierce. DHH weighed in. Hacker News threads drew hundreds of comments, and the dominant read was that Anthropic had turned developer goodwill into a lock-in play. By March, OpenCode had stripped all Anthropic references from its codebase — and accelerated past 126,000 stars in the process.

You can argue Anthropic was legally correct. The strategic read is less flattering: they handed a scrappy open-source project a martyrdom narrative and validated the exact concern driving developers toward model-agnostic tooling in the first place.

What OpenCode Actually Is

OpenCode is a terminal-native AI coding agent built by the Anomaly team — the same group behind SST. It’s MIT-licensed, runs entirely on your machine, and stores conversations in a local SQLite database that never leaves your system.

The core pitch is model agnosticism. OpenCode connects to 75+ LLM providers: OpenAI, Google Gemini, DeepSeek, Qwen, xAI, Groq, Mistral, and any OpenAI-compatible endpoint including local models via Ollama, vLLM, or LM Studio. You can switch providers mid-session without losing context — a feature that matters at 2 AM when you’ve hit a rate limit.

Under the hood it’s a proper agent harness: a tool loop, Language Server Protocol integration that feeds real compiler diagnostics back to the model after every edit, and a multi-agent system with distinct roles. The Build agent handles full development work with all tools enabled. The Plan agent analyzes and plans without touching your files. Three subagents — General, Explore, and Scout — handle specialized tasks that primary agents delegate out.

Version 1.17.11 added session snapshots and revert controls, so you can roll any session back to an earlier message including file changes. That feature changes how you approach exploratory refactors. OpenCode also supports Model Context Protocol servers — the same MCP ecosystem Apple recently opened up with Safari’s MCP server.

Getting Started with OpenCode

Installation takes about 90 seconds:

# Via npm
npm install -g opencode-ai

# Via Homebrew (macOS/Linux)
brew install anomalyco/tap/opencode

# Run it
opencode

On first launch, OpenCode prompts you to configure a provider. Set your API keys as environment variables or drop a .opencode.json in your home directory or project root:

{
  "providers": {
    "openai": { "apiKey": "${OPENAI_API_KEY}" },
    "google": { "apiKey": "${GEMINI_API_KEY}" }
  }
}

Run /init to let OpenCode analyze your project and generate an AGENTS.md context file. If you have a GitHub Copilot subscription, /connect walks you through an OAuth device flow — all subscription tiers are supported. For near-zero API costs, pair OpenCode with DeepSeek V4 or Gemini 2.5 Flash. For heavier work, GPT-4.1 or Gemini 2.5 Pro are the recommended defaults now that Claude is off the table.

OpenCode vs Claude Code vs Cursor

OpenCode sits in a different part of the market than Cursor or Claude Code. LogRocket’s June 2026 AI dev tool rankings found that 70% of developers now use two to four AI coding tools simultaneously — the question isn’t which one to pick, it’s which one to reach for in a given context.

The rough breakdown: Claude Code for complex multi-file reasoning and architecture work; Cursor when you want visual diffs and IDE-native friction reduction — and Cursor now has an iOS app if you need that; OpenCode when you need model flexibility, local-first privacy, or you’re in an environment where vendor lock-in isn’t acceptable. Regulated industries, air-gapped deployments, and teams rotating between model providers based on cost — OpenCode is the clear fit for all of them.

The honest trade-off: OpenCode is less polished than Cursor. There’s no visual diff interface, and configuration takes more upfront investment. If you want something you can hand to a junior developer on day one, Cursor wins. If you want something you can fully own and customize, OpenCode is the better foundation. Worth noting: AI coding agents carry real supply chain risks regardless of which tool you pick — model agnosticism doesn’t solve that problem.

The OpenAI Partnership

In April, OpenAI officially partnered with OpenCode to let Codex and ChatGPT subscribers use their subscriptions directly inside the tool — alongside OpenHands and RooCode. The positioning was deliberate. The New Stack called it the “Claude Code split”: OpenAI stepping into the vacuum Anthropic created by locking down its OAuth tokens.

For OpenCode users, the partnership means credible GPT-based access at subscription rates rather than pay-per-token API costs. It also signals that the AI coding agent market is fragmenting — no single vendor is winning, and the tools betting on ecosystem openness are gaining ground.

The Bottom Line

OpenCode is not trying to replace Claude Code or Cursor. It fills the gap those tools deliberately leave: open, auditable, model-agnostic, and locally controlled. The Anthropic incident clarified the stakes. Closed-source tools with proprietary auth flows are a single policy decision away from breaking your workflow.

OpenCode’s 160,000 stars are developers voting on how much that risk matters. If you haven’t tried it, the barrier is low: npm install -g opencode-ai and an API key you already have. The more interesting question is why you’d build a development workflow that doesn’t include it.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *