DevPik Logo
open sourceai agentscoding agentclaude codedeveloper toolsterminal

OpenCode: The Open-Source AI Coding Agent With 216,000 GitHub Stars

AI coding agents are getting expensive. OpenCode is the open-source answer: a terminal-based coding agent with 216,000 GitHub stars that ships with free models, plugs into 75+ providers, and even lets you log in with the ChatGPT or GitHub Copilot subscription you already pay for. It runs in your terminal, as a desktop app, or inside your editor, and its makers say it never stores your code. Here is what it does, how the two built-in agents work, and whether it can replace Claude Code.

ByMuhammad Tayyab8 min read
All open source picks
anomalyco/opencode
The official repository — this write-up is not affiliated with the project.
216.0kTypeScriptMIT

The Free Coding Agent 216,000 Developers Starred

OpenCode calls itself "the open source AI coding agent," and the numbers back up the ambition. The repo at anomalyco/opencode has over 216,000 GitHub stars, nearly 29,000 forks, and an MIT license, which means you can use it, fork it, and build on it without paying anyone anything. Its makers claim 16 million developers use it every month.

The pitch is simple: everything the paid coding agents do, in an interface you already live in. It edits files, runs shell commands, searches your codebase, and reasons through multi-step tasks. But unlike the closed alternatives, you pick the model, you pick the surface (terminal, desktop app, or editor), and you can see exactly what it is doing because the whole thing is open source.

If you have been paying for an AI coding subscription and wondering whether the free tier of the open-source world has caught up, this is the repo everyone points to first.

Two Built-In Agents, Switched With One Key

OpenCode ships with two agents and you flip between them with the Tab key.

build is the default. It has full access: read, write, edit files, run bash commands, the works. This is the agent you leave running when you want work done.

plan is the read-only counterpart. It cannot edit files, and it asks permission before running bash commands. The README positions it for exploring unfamiliar codebases or thinking through a change before committing to it, which is a genuinely useful split. Most agents make you write a careful prompt to get read-only behavior; here it is a keystroke.

There is also a general subagent that handles complex searches and multi-step tasks internally. You can invoke it yourself with @general in a message when you want the agent to fan out on something hairy while you keep working.

Bring Your Own Model, or Use Theirs Free

This is where OpenCode gets interesting for anyone watching their API bill. It supports 75+ model providers, so you can plug in Claude, GPT, Gemini, or a local model running on your own machine.

If you do not want to configure anything, OpenCode includes free models out of the box. And here is the move that will make the paid tools nervous: if you already pay for ChatGPT or GitHub Copilot, you can just log in with that subscription and use it inside OpenCode. No second subscription, no per-token meter running in the background.

The privacy story is part of the pitch too. The project states plainly that it never stores your code. Your code goes to whichever model provider you chose, which is unavoidable for any AI agent, but OpenCode itself is not keeping a copy. For an MIT-licensed tool you run locally, that is about as good as the trust story gets.

Terminal, Desktop App, or Your Editor

OpenCode started as a terminal tool, and the terminal UI is still its home: a full-screen TUI with the agent, your files, and command history in one place. But it has grown past that.

There is now a desktop app in beta, with downloads for macOS (Apple Silicon and Intel), Windows, and Linux (.deb, .rpm, or AppImage), installable via the releases page or opencode.ai/download. If you live in an editor, OpenCode works there too, so you do not have to context-switch to a separate window to get agent help.

The breadth matters because developers are split on where they want AI. Some want it in the terminal next to their git commands. Some want a standalone app. Some never want to leave VS Code. OpenCode refusing to pick a side is a feature, not indecision.

Installing It Takes One Command

The fastest path is the install script:

bash
curl -fsSL https://opencode.ai/install | bash

Package manager people have options: npm (npm i -g @opencode/cli@latest, also works with bun, pnpm, or yarn), Homebrew on macOS and Linux (brew install anomalyco/tap/opencode is the recommended tap because it stays current), Scoop and Chocolatey on Windows, pacman and AUR on Arch, mise on any OS, and even nix. The README notes you should remove versions older than 0.1.x before installing, which tells you the project moved fast and broke a few things along the way.

The docs live at opencode.ai/docs, and there is an active Discord plus an X account if you want to see what the community is building. The README is translated into 20+ languages, which is a decent proxy for how global the user base has gotten.

Should It Replace Claude Code?

Switch if you are paying for a coding agent and the bill bothers you, you want to choose your model per task (or per budget), you like working in the terminal and want the agent where your shell already is, or you care about running open-source tooling you can audit.

Stay where you are if you are deep in Claude Code's ecosystem and happy with it, you rely on a specific Claude Code plugin or workflow that has no OpenCode equivalent, or you would rather pay for one polished integration than assemble your own from 75 providers.

The honest answer is that OpenCode's biggest advantage is not any single feature, it is optionality. The paid agents lock the model, the surface, and the price together. OpenCode unbundles all three: free models to start, your existing subscriptions if you have them, any of 75+ providers if you do not, in a terminal, a desktop app, or your editor. At 216,000 stars and MIT licensed, it is the safest free bet in the AI coding agent space.

Frequently Asked Questions

What is OpenCode?

OpenCode (anomalyco/opencode) is an open-source AI coding agent with 216,000+ GitHub stars. It edits files, runs commands, and reasons through coding tasks from your terminal, a desktop app, or your editor. It is MIT licensed and free to use.

Is OpenCode really free?

Yes. OpenCode is MIT licensed and free. It ships with free models included, supports 75+ providers you can plug in yourself, and even lets you log in with an existing ChatGPT or GitHub Copilot subscription instead of paying for a second service.

How is OpenCode different from Claude Code?

Both are agentic coding assistants, but OpenCode is open source (MIT) while Claude Code is closed. OpenCode lets you choose from 75+ model providers or free built-in models, runs in the terminal, desktop app, or editor, and never stores your code. Claude Code is tied to Anthropic's models and subscription.

What are the build and plan agents in OpenCode?

OpenCode includes two built-in agents you switch between with the Tab key. The build agent is the default with full access to edit files and run commands. The plan agent is read-only: it cannot edit files and asks permission before running bash commands, making it ideal for exploring codebases or planning changes safely.

Which models does OpenCode support?

OpenCode supports 75+ model providers including Claude, GPT, and Gemini, plus local models. It also includes free models out of the box, and you can authenticate with an existing ChatGPT or GitHub Copilot subscription.

Does OpenCode store my code?

No. The project states it never stores your code. Your code is sent to whichever model provider you choose (necessary for any AI agent), but OpenCode itself does not retain a copy.

How do I install OpenCode?

The quickest way is curl -fsSL https://opencode.ai/install | bash. You can also install via npm (npm i -g @opencode/cli@latest), Homebrew (brew install anomalyco/tap/opencode), Scoop or Chocolatey on Windows, pacman/AUR on Arch, mise, or nix. A beta desktop app is available for macOS, Windows, and Linux.

Can I use OpenCode in my editor or as a desktop app?

Yes. Beyond the terminal UI, OpenCode offers a desktop app in beta (macOS, Windows, Linux via .deb, .rpm, or AppImage) downloadable from the releases page or opencode.ai/download, and it also works inside your code editor.

Related DevPik tools

Muhammad Tayyab

Written by

Muhammad Tayyab

CEO & Founder at Mergemain

Muhammad Tayyab builds free, privacy-first developer tools at DevPik. He writes about AI trends, developer tools, and web technologies.

More open source picks