Runi Help

OpenCode

A plugin that briefs OpenCode on the first turn, and the experimental hook that makes it possible.

OpenCode is briefed by a plugin instead of by hooks. The plugin appends the team briefing to the session's system prompt on the first turn, and records what the session does after that.

Careful

OpenCode 1.18 or later. The plugin runs against the plugin API from that version onward. Earlier releases load nothing.

What Runi installs#

A single plugin file in ~/.config/opencode/plugin/, and an entry for Runi's MCP server in ~/.config/opencode/opencode.jsonc. Nothing inside your repository.

How the briefing arrives#

Through OpenCode's experimental.chat.system.transform hook, which hands a plugin the system blocks about to reach the model. That is a genuine injection point, the same thing SessionStart gives the Claude adapter.

Careful

OpenCode marks that hook experimental. If a future OpenCode release withdraws it, your sessions keep being observed and quietly stop being briefed. Nothing on our side can prevent that, so it is worth knowing the symptom in advance: everything looks normal and the briefings just stop. Your fallback is runi_brief over MCP, which does not depend on that hook.

What is recorded#

  • Your prompts to the session.
  • The files OpenCode changes, and the lines it changed.
  • The commands it runs and their test results.

All of it redacted on your machine first, and none of it from a repository your workspace does not track. The plugin never writes to your repository.

Verify it#

terminal
$ ls ~/.config/opencode/plugin/
$ runi doctor

  ok   adapter:opencode ok, last seen 2 min ago

Known limits#

  • The briefing lands once per session, on the first turn. A teammate's note that arrives mid-session reaches the next session.
  • Context injection depends on an experimental OpenCode hook, as above.
  • Only repositories your workspace tracks are published.
  • OpenCode 1.18 and later only.

Troubleshooting#

The plugin file is there but nothing is observed
Check

OpenCode's version, and whether the session was started in a tracked repository.

Fix

Update to 1.18 or later and restart OpenCode, because plugins are loaded at start. Then add the repository if the doctor says it is untracked.

Sessions are observed but never briefed
Cause

Observation and injection come through different parts of the plugin API. If the experimental system-transform hook is unavailable in your build, the first half keeps working and the second silently does not.

Fix

You still have the pull channel. OpenCode can call runi_brief through the MCP server and get the same packet on request. See Asking Runi from inside your agent.

Did this solve it?