Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15,384 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode logo

The open source AI coding agent.

A fork of opencode, powered by CAR.

Discord npm Build status

English | 简体中文 | 繁體中文 | 한국어 | Deutsch | Español | Français | Italiano | Dansk | 日本語 | Polski | Русский | Bosanski | العربية | Norsk | Português (Brasil) | ไทย | Türkçe | Українська | বাংলা | Ελληνικά | Tiếng Việt

OpenCode Terminal UI


Note

This is the Matt Liotta fork of opencode, with an optional CAR integration. CAR is a deterministic Rust runtime for AI agents. It is off by default — enable it with OPENCODE_ENABLE_CAR=true. Disabled, this behaves exactly as upstream opencode. See Powered by CAR.

Installation

This is a personal fork distributed as source. Build it yourself:

git clone https://github.com/mliotta/opencode.git
cd opencode
bun install                # requires Bun (https://bun.sh)
bun run dev                # run from source

Note

The package-manager commands you may have seen for upstream opencode (curl | bash, npm i -g opencode-ai, brew install opencode, scoop, choco, pacman, mise, nixpkgs) all install sst/opencode, not this fork. To run this fork's CAR-powered engine, build from source.

Agents

OpenCode includes two built-in agents you can switch between with the Tab key.

  • build - Default, full-access agent for development work
  • plan - Read-only agent for analysis and code exploration
    • Denies file edits by default
    • Asks permission before running bash commands
    • Ideal for exploring unfamiliar codebases or planning changes

Also included is a general subagent for complex searches and multistep tasks. This is used internally and can be invoked using @general in messages.

Learn more about agents.

Documentation

For more info on how to configure OpenCode, head over to our docs.

Contributing

If you're interested in contributing to OpenCode, please read our contributing docs before submitting a pull request.

Building on OpenCode

If you are working on a project that's related to OpenCode and is using "opencode" as part of its name, for example "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in any way.

Powered by CAR

This fork can run opencode's agent engine on top of CAR (Common Agent Runtime), a deterministic Rust runtime that sits between the model and tools: the model proposes, CAR verifies and executes. See CAR.md for the full integration reference.

CAR is off by default. Enable it with OPENCODE_ENABLE_CAR=true; delegated inference is a separate opt-in via OPENCODE_CAR_DELEGATED_INFERENCE=true, because it is the one part that still costs seconds per call. Disabled, opencode behaves exactly as upstream — no daemon contact, no native binary loaded, identical CLI surface, and a test suite that matches a pristine upstream checkout.

What works when enabled:

  • CAR-routed tool execution — every built-in and MCP tool becomes a proposal that CAR verifies before it reaches its host implementation, with the tool's JSON Schema registered so malformed parameters are caught before any side effect. Plugin hooks, permission gating, snapshots and bus events are unchanged.
  • Graph memory — user turns, assistant turns, tool results and tool errors are ingested as facts, weighted by whether they were observed directly or asserted by the model. Queryable with opencode debug car --recall.
  • CAR-grounded system prompt — each model call appends a <car_context> block built from the project's memory.
  • Skills with a feedback loopSKILL.md files are ingested into CAR's graph, and the outcome of the turn a skill participated in is reported back, so CAR can surface degraded skills (--evolve) and propose repairs (--repair).
  • Delegated inference — model calls route through CAR and back into opencode's AI-SDK provider stack, so CAR observes the full lifecycle for policy and replay. The AI SDK still owns the wire.
  • Inspectable runtimeopencode debug car reports daemon reachability, version skew, whether the delegated model is registered, fact counts, ingested skills, and a count of degraded CAR calls.

Known limitations, all filed upstream against CAR:

  • Delegated inference costs 1.9–4.3s per model call on 0.46.0, down from a constant ~5s (#75) — so it is opted into separately from the rest of CAR, which adds single-digit milliseconds per turn.

  • Memory is shared across every project on the machine, so facts from one codebase can surface in another's context. 0.46.0 added per-project namespaces, but they are not yet durable across daemon restarts (#82), so opencode has not adopted them.

  • Durable approvals — CAR classifies each action's risk tier from the command's content and records your permission answers to an auditable ledger, so an approval given once is honoured on later evaluations. opencode's own ruleset stays authoritative: CAR can skip a prompt you've already answered, never allow something opencode denies.

The opencode TUI, CLI, config, MCP client, LSP, providers and storage are untouched.

CAR · Matt Liotta

FAQ

How is this different from upstream opencode?

With CAR disabled, which is the default, it is upstream opencode plus this fork's own changes — the test suite matches a pristine upstream checkout. With OPENCODE_ENABLE_CAR=true, tool execution, memory, context and inference additionally flow through CAR, which brings cross-session graph memory, verified tool proposals, and a replayable execution record. See Powered by CAR for what is and is not wired.

How is this different from Claude Code?

It's very similar to Claude Code in terms of capability. Here are the key differences:

  • 100% open source
  • Not coupled to any provider. Although we recommend the models we provide through OpenCode Zen, OpenCode can be used with Claude, OpenAI, Google, or even local models. As models evolve, the gaps between them will close and pricing will drop, so being provider-agnostic is important.
  • Built-in opt-in LSP support
  • A focus on TUI. OpenCode is built by neovim users and the creators of terminal.shop; we are going to push the limits of what's possible in the terminal.
  • A client/server architecture. This, for example, can allow OpenCode to run on your computer while you drive it remotely from a mobile app, meaning that the TUI frontend is just one of the possible clients.

Join our community Discord | X.com

About

The open source coding agent.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages