OpenCode
The most popular open-source coding agent. It works like Claude Code, in the terminal, a desktop app or the browser, but with almost any AI model you like.
The verdict
Only if you need it
The most complete open-source alternative to Claude Code, and the one to pick if you want cheaper or open models, or to use your ChatGPT or Copilot plan. It can't use a Claude subscription, its security record this year is poor, and version 2 is still settling, so if Claude Code already works for you, stay put.
Best forPeople who want model choice and lower costs, avoid being locked to one AI company, or already pay for ChatGPT or GitHub Copilot.
- Stars
- 220k
- Licence
- MIT
- Language
- TypeScript
- Last release
- 22 Oct 2026
- Created
- 30 Apr 2025
- Open issues
- 2430
As of 23 Oct 2026. Numbers move fast on trending repos.
npm i -g @opencode/cli@latestThat installs version 2, which the README now uses by default. Then run opencode in your project and type /connect to add a model. The README also offers a one-line install script (curl -fsSL https://opencode.ai/v2/install | bash) and Homebrew (brew install anomalyco/tap/opencode-v2). A desktop app for macOS, Windows and Linux, still in beta, is at opencode.ai/download. Version 1 is still published as opencode-ai on npm.
What it is
OpenCode is a free, open-source coding agent: a program that lets an AI model read your project, run commands and edit code, the same job Claude Code does. The difference is that it isn't tied to one AI company. You can plug in Claude, GPT, Gemini, DeepSeek, Kimi, GLM, a model running on your own computer, and many more.
It started under the SST team's GitHub account and is now run by their company, Anomaly. It's one of the most-starred projects in AI coding. You can use it in the terminal, as a desktop app, in your browser or in VS Code. Version 2 came out in September 2026 and was formally announced in October. It runs a background server that keeps sessions going, and the terminal and apps are just windows onto it.
It comes with two main modes you switch between with Tab: build, which can change anything, and plan, which only reads and asks before running commands. It also has helper agents for bigger searches.
What actually happens when you use it
- Install and open it in your project folder.
- Connect a model with
/connect. You can sign in with ChatGPT Plus or Pro, GitHub Copilot or GitLab Duo, paste an API key from Anthropic, OpenAI or others, point it at a local model, or use OpenCode's own paid services: Zen, a pay-as-you-go menu of tested models, and Go, a monthly plan for open models. - Plan or build. Ask for a change in plan mode to see the approach, then switch to build mode to let it work.
- It works like other agents. It reads files, runs commands and edits code, asking permission for risky actions depending on your settings.
- Leave it running. In version 2, sessions live on the background server, so closing the window doesn't stop the work, and you can reconnect from the desktop app or another machine.
What people like
- Use the plan you already pay for. ChatGPT, GitHub Copilot and GitLab Duo subscriptions work with zero setup, as do local models through Ollama or LM Studio.
- It wastes less of the model's memory. A July test found OpenCode sends about 7,000 tokens of setup before your prompt, against about 33,000 for Claude Code. It was one machine and small samples, and both tools change often.
- Not just a terminal. One user picks it because it's the only open-source agent they've found that works well outside a terminal. Another likes that apps can connect to sessions running on another machine.
- Version 2 fixed real annoyances. Users point to background helper agents with their own model choice, and to plugins and skills that reload automatically.
- Cheap or free ways in. One newcomer was impressed that the free models are decent, making agentic coding accessible to students and hobbyists. The Go plan starts at $10 a month.
What people run into
- No Claude subscription. In January, Anthropic blocked OpenCode from using Claude Pro and Max plans. In March its lawyers asked OpenCode to drop the plugin that made it possible. The docs now say plainly: "Anthropic explicitly prohibits this." To use Claude, you pay per token with an API key.
- A poor security record this year. In January, any website could make OpenCode's local server run commands on your computer, along with a critical web UI flaw. A third high-severity issue was fixed in August and disclosed in September. On October 17, OpenCode said its hosted Console was breached and that AI provider keys saved there may have been exposed. That affected 1.4% of Console users, not people who only run the app locally, though commenters reported surprise bills from stolen keys.
- Weak guardrails. There's no built-in sandbox, and the request for one has been open since August 2025. A detailed review found its command blocking easy to get around. For months it also sent your prompts through OpenCode's servers to name sessions, even with a local model. A commenter says that has since been removed.
- Version 2 is still settling. One user found that their sandbox wrapper silently stopped working after upgrading. Another called it a big disappointment so far, and some plugins haven't caught up.
- Bug reports pile up. There are about 2,400 open issues. One regular user describes the tracker as a graveyard unless you're on the core team.
Before you install
- Compared with Claude Code: cost. OpenCode itself is free, but you pay for the model. If you're on a Claude Pro or Max plan, moving to OpenCode with Claude means paying per token on top. It saves money mainly when you switch to cheaper models, use a ChatGPT or Copilot plan you already have, or pay for OpenCode Go ($10 or $40 a month).
- Compared with Claude Code: models and privacy. You can use almost any model, including local ones, and you can read the code. But check where your data goes. Some of OpenCode's free models log or train on your data during the free period, so keep private code away from those.
- Keep your keys on your own machine. The October breach hit keys pasted into OpenCode's hosted Console. If you used it, rotate those keys now.
- Stay up to date. All three security fixes this year needed an update. Run
opencode upgradeor reinstall regularly. - Add your own walls. Run it in a container or virtual machine if you let it work unattended. NVIDIA's OpenShell sandbox uses OpenCode as its first example.
- Compared with Claude Code: maturity. It ships constantly and has a huge community, but the move from version 1 to 2 is recent and messy. Claude Code is more polished for people who don't want to tinker.
The short version
OpenCode is the real open-source alternative to Claude Code, with a strong design, apps beyond the terminal and the freedom to use nearly any model. That freedom is the reason to choose it, especially if Claude is too expensive for you or you already pay for ChatGPT or Copilot. The trade-offs are real: no Claude subscription, a string of security problems in 2026, a crowded bug tracker and a fresh version 2. If you're a vibe coder happy on a Claude plan, stay with Claude Code. If cost or choice matters more, OpenCode is the one to try, with your keys kept local and the app kept updated.
Sources
GitHub
- The repo and README
- Issue #18267: Anthropic's lawyers and the Claude login plugin
- Advisory: unauthenticated HTTP server allowed command execution (January 2026)
- Advisory: critical XSS in the web UI (January 2026)
- Advisory: cross-site upgrade request could install packages (September 2026)
- Issue #10416: session titles generated outside your network
- Issue #2242: is there a way to sandbox the agent?
Hacker News
Docs
The week’s repos, every Friday.
From the same drop
obra/superpowers
Superpowers
A set of skills that makes your coding agent brainstorm, plan, write tests and review its own work before it calls anything done.
★ 304kBreakdown →
deepseek-ai/deepseek-harness
DeepSeek Harness
DeepSeek's own open-source coding agent, run from a web page or desktop app, built so that almost every feature is a plugin you can swap.
★ 259kBreakdown →
github/spec-kit
Spec Kit
GitHub's toolkit for writing down what you want built, as a spec, a plan and a task list, before your coding agent writes any code.
★ 143kBreakdown →