Harnesses

OpenCode

XDG paths on every platform including Windows, one SQLite database for sessions, JSON or JSONC config at four locations, its own MCP dialect.
IDopencode11 / 1320 paths · project
Harness

OpenCode CLI

  • opencode

XDG paths on every platform, one SQLite database, its own MCP dialect.

Invoke
2 of 6 · official
Models
no listing
MCP
json · opencode
Agents file
~/.config/opencode/AGENTS.md
Inferred 0 / 20

Access

GetgetHarness("opencode")
CLIharnesses paths opencode --json
Tryopencode in the explorer

OpenCode is the tidy one. Config is opencode.json or .jsonc at the user level under ~/.config/opencode/ and at the project level either in the root or under .opencode/. Everything it writes goes into one SQLite database under ~/.local/share/opencode/, through Drizzle, and the same paths hold on Windows, which the notes say so nobody adds an %APPDATA% variant.

MCP servers use the opencode dialect, which nests entries differently from the standard family; the library normalizes both directions. opencode run is the headless mode, --format json the structured one. No advisor and no sandbox, and it reads .claude/skills/ and ~/.agents/skills/ beside its own.

Capabilities and invocation

  • mcp: yes
  • vision: yes
  • audio: no
  • video: no
  • tools: yes
  • streaming: yes

Binary opencode, evidence official. Model selection appends --model {model}.

Callinvoke(prompt, options)2 of 6 modes
  • advisor{}rejected
  • advisor · json{ structured: true }rejected
  • read-only{ readOnly: true }rejected
  • read-only · json{ readOnly: true, structured: true }rejected
  • agent{ tools: true }run {prompt}
  • agent · json{ tools: true, structured: true }run --format json {prompt}

Paths

Templates as the registry stores them. ~, ${HOME}, ${TMPDIR} and %VAR% expand in resolve(); entries tagged with a platform are dropped on the others. Open in the explorer to see them expanded for a home directory of your choice.

PathsgetHarness("opencode")20 templates · 6 groups

config

  • ~/.config/opencode/opencode.jsoncuserofficialall

    XDG-based, same path on all platforms.

  • ~/.config/opencode/opencode.jsonuserofficialall
  • opencode.jsoncprojectofficialall
  • opencode.jsonprojectofficialall
  • .opencode/opencode.jsoncprojectofficialall
  • .opencode/opencode.jsonprojectofficialall

sessions

  • ~/.local/share/opencode/opencode.dbdataofficialall

    SQLite database with sessions, messages, and parts. XDG-based, same path on all platforms.

instructions

  • AGENTS.mdprojectofficialall
  • CLAUDE.mdprojectofficialall

    Supported for Claude Code compatibility.

  • ~/.config/opencode/AGENTS.mduserofficialall

    Global user-level instructions.

skills

  • .opencode/skills/projectofficialall
  • .claude/skills/projectofficialall

    Claude Code compatible.

  • .agents/skills/projectofficialall
  • ~/.config/opencode/skills/userofficialall
  • ~/.claude/skills/userofficialall

    Claude Code compatible.

  • ~/.agents/skills/userofficialall

commands

  • .opencode/commands/projectofficialall

    Markdown prompt commands; also configurable through command entries in opencode.json.

  • ~/.config/opencode/commands/userofficialall

    Global Markdown prompt commands.

promptTemplates

  • .opencode/commands/projectofficialall

    Markdown prompt commands; also configurable through command entries in opencode.json.

  • ~/.config/opencode/commands/userofficialall

    Global Markdown prompt commands.

Empty

hookstempThat is not the same as the feature being missing.

MCP servers

FilemcpConfigs2 files
  • ~/.config/opencode/opencode.jsonuser · json · opencode · mcp
  • opencode.jsonproject · json · opencode · mcp

Detection

CalldetectHarness()project markers only

envVars

None. Detection is by project markers only.

projectMarkers

  • .opencode
  • opencode.jsonc
  • opencode.json

Persistence

  • JSON/JSONC - Config files. (official)
  • SQLite - Session and message storage via Drizzle ORM. (official)

syncAgentsFiles links ~/.config/opencode/AGENTS.md to the master bundle.