OpenCode
OpenCode is an open source AI coding agent for your terminal — a model-agnostic Claude Code and Cursor alternative that reads your repo, edits code across files, and runs commands with any LLM you choose.
What is OpenCode?
OpenCode is an open source AI coding agent that runs in your terminal, built by the team behind SST. Given a task, it reads your repository, edits code across files, runs commands and tests, and works with the LLM you choose — Claude, GPT, Gemini, a local model, or any of 75+ providers. It is not tied to any single AI vendor.
What is OpenCode best for?
Developers who want a terminal-first coding agent but don’t want to be locked to one model or subscription. It suits anyone bringing their own API key, reusing an existing GitHub Copilot or ChatGPT plan, or running a local model for sensitive code — all inside the same workflow.
What can OpenCode do?
- Work as an autonomous agent: read the repo, edit code across files, run commands and tests
- Connect to 75+ LLM providers through Models.dev, including local models
- Reuse existing subscriptions like GitHub Copilot or ChatGPT Plus/Pro instead of a separate key
- Switch between a full-access “build” agent and a read-only “plan” agent, plus a “general” subagent for searches
- Load project context automatically via Language Server Protocol (LSP) integration
- Run multiple concurrent sessions on one project, with shareable session links
- Use it from the terminal (TUI), a desktop app for macOS/Windows/Linux, or an IDE extension
Where does OpenCode fall short?
- Its client-server architecture adds overhead: in head-to-head tests OpenCode ran noticeably slower end to end than a tightly integrated agent like Claude Code, trading some speed for flexibility.
- Model-agnostic means results depend heavily on the model you pick — pair it with a weak or cheap model and the agent’s quality drops, so you still need a capable LLM to get strong output.
- The polish of a single-vendor product (curated model defaults, tuned prompts) is something you assemble yourself here, which is more configuration up front.
Is OpenCode free?
Yes — OpenCode is free and open source under the MIT license, with no subscription for the tool itself. You pay only for whatever model you point it at (your own API key, an existing Copilot/ChatGPT plan, or a free local model). The team also offers “Zen,” an optional paid, curated model service for people who don’t want to manage providers.
What does OpenCode replace?
OpenCode is an open source alternative to Claude Code, Cursor, and GitHub Copilot, and it overlaps with autonomous agents like Devin. It does the same read-your-code-and-edit-it job, but stays model-agnostic and free rather than binding you to one vendor’s models or subscription.
FAQ
Is OpenCode open source? Yes. OpenCode is fully open source under the permissive MIT license, with the code public on GitHub, where it has passed 200,000 stars.
Can I use OpenCode for free? The tool is free. Your only cost is the model behind it — bring your own API key, reuse a GitHub Copilot or ChatGPT subscription you already pay for, or run a free local model.
Is OpenCode a good Claude Code alternative? For anyone who wants model choice, yes — OpenCode is terminal-first like Claude Code but works with any provider instead of only Anthropic’s models. The tradeoff is more setup and some added latency from its client-server design.
What do I need to run OpenCode? A terminal on macOS, Windows, or Linux, install via the curl one-liner or npm/Homebrew/your package manager, and access to at least one LLM — an API key, an existing AI subscription, or a local model. It also ships as a desktop app and IDE extension. If you prefer a self-hostable agent that opens pull requests, OpenHands is a related option.