OpenCode

OpenCode: Open Source Alternative to Claude Code

Open-source, provider-agnostic AI coding agent for terminal, desktop, and IDE.

Open source alternative to:Claude CodeCursorGitHub Copilot

OpenCode is an open-source AI coding agent with 167k+ GitHub stars — a provider-agnostic alternative to Claude Code. Run it in the terminal, desktop app, or IDE extension as part of our Developer Tools collection, and bring your own model from 75+ providers or use included free models.

Looking for other proprietary options? Compare OpenCode with Cursor and GitHub Copilot before you choose.

Key features

Agent modes

  • Build — full-access agent for development (default)
  • Plan — read-only agent for exploring codebases and planning changes
  • General subagent for complex searches and multi-step tasks
  • Custom agents with prompts, models, and tool access

Models & providers

  • Not locked to one vendor — Claude, GPT, Gemini, Grok, GitHub Copilot, local models (Ollama, LM Studio), and more
  • OpenCode Zen for recommended hosted models, or connect your own API keys
  • Switch models per session without changing your workflow

Developer workflow

  • LSP support for diagnostics and navigation
  • Multi-session TUI with split panes and shareable session links
  • Project context via AGENTS.md and opencode.json configuration
  • MCP tools, TypeScript plugins, and custom provider integrations
  • Granular permission controls for file edits and shell commands

Privacy

  • Code and context are not stored by OpenCode
  • Self-hostable share endpoint for teams behind a VPN
  • MIT license — audit, fork, or extend freely

OpenCode vs Claude Code

OpenCodeClaude Code
LicenseMIT (open source)Proprietary
Models75+ providers, bring your own keysAnthropic Claude only
InterfacesTerminal, desktop, IDE extensionTerminal, IDE
PrivacyCode not stored by OpenCodeProcessed via Anthropic API
CostFree software + your API usageAnthropic subscription

Choose OpenCode if you want model flexibility, an auditable MIT codebase, and no vendor lock-in.

Choose Claude Code if you prefer a turnkey Anthropic-native agent with minimal setup.

Browse more open-source alternatives to Claude Code, or explore other Developer Tools in the directory.

At a glance

LicenseMIT
InterfacesTerminal, desktop, IDE extension
Models75+ providers + local
Configopencode.json, .opencode/, AGENTS.md
Installcurl, Homebrew, npm, nix, scoop

Getting started

Install via curl -fsSL https://opencode.ai/install | bash, Homebrew, or npm. Desktop builds available for macOS, Windows, and Linux.

FAQ

Is OpenCode a free alternative to Claude Code?

Yes. OpenCode is MIT-licensed and free to use. You pay only for the LLM API keys or hosted models you connect — there is no OpenCode subscription.

Can OpenCode use Claude models?

Yes. OpenCode supports Anthropic Claude alongside GPT, Gemini, Grok, local models via Ollama, and GitHub Copilot credentials among 75+ providers.

How does OpenCode compare to Cursor?

Cursor is a proprietary AI-first IDE. OpenCode is an open-source agent that runs in your terminal, desktop, or existing editor — with any model provider, not just Cursor's bundled stack.

Does OpenCode store my code?

No. OpenCode does not store your code or context. Sessions stay local unless you opt into shareable session links on your own infrastructure.

Is OpenCode self-hostable?

The agent runs locally by default. Teams can self-host the optional share endpoint behind a VPN for collaborative sessions.

Screenshots

OpenCode screenshot 1OpenCode screenshot 2OpenCode screenshot 3

Tags

aicoding-agentterminaldeveloper-toolsopen-source

Built with

TypeScriptBunTUILSPMCP