OpenCode is a multi-surface coding agent
OpenCode is an open-source coding agent that does not live in a single place. It runs in the terminal, as an IDE extension, and as a desktop app, supports parallel agent sessions on the same project, and connects to a large range of model providers. It is, in the vocabulary we use for this stack, a harness — the execution layer that coordinates tool calls, state, and the agent loop across more than one surface.
That breadth is exactly why governance matters here. The more surfaces an agent acts through, the more places an architectural decision can quietly fail to apply. A rule enforced in the terminal but not in the desktop app is not a rule.
OpenCode coordinates execution across surfaces. Mneme enforces the architectural intent those surfaces have no opinion about — identically, wherever the agent is working.
The integration surface: OpenCode's plugin hooks
OpenCode exposes a plugin system with hooks at the points where governance belongs. A Mneme plugin, installed under .opencode/plugins/, registers on these hooks and runs mneme check against the team's recorded decisions, returning explainable PASS, WARN, or FAIL findings — each carrying the decision id that produced it.
| OpenCode hook | Mneme action | Mode |
|---|---|---|
| tool.execute.before | Check the proposed change against decisions before it runs | Advisory or blocking |
| tool.execute.after / file.edited | Verify the change that landed; surface violations with the decision id | Advisory |
| session.idle | Run a governance pass over the session's changes | Advisory |
| before git commit / push | Block changes that violate a recorded architectural decision | Blocking |
| session compaction | Inject a compact governance summary so decisions survive long sessions | Context |
Advisory at the edit, blocking at the boundary
The right enforcement mode depends on the surface. While an agent is editing, an advisory check keeps flow intact — it surfaces a finding and the decision behind it without halting work. At the boundaries that matter — before a commit, before a push — a blocking check refuses to let a change that violates an architectural decision proceed. This mirrors how Mneme works everywhere: governance before the change lands, with strict enforcement reserved for the points of no return.
Continuity across long, parallel sessions
OpenCode documents compaction hooks designed to preserve task state, decisions, modified files, and multi-agent dependencies across longer sessions. That aligns closely with the distinction at the heart of Mneme: the difference between remembering a decision and enforcing it. Compaction keeps the relevant decisions present as a session grows; Mneme makes those decisions binding. Parallel sessions on the same project see the same compiled constraints, so two agents working at once do not drift apart.
Where this sits in the stack
OpenCode is the harness; Mneme is the governance layer that runs alongside it. They are different layers of the runtime stack and they compose: OpenCode decides how the agent executes across terminal, IDE, and desktop, and Mneme decides whether the resulting changes respect the architecture. The full argument for why a capable harness still needs this layer is in Harness Engineering Still Needs Governance.
OpenCode runs the agent across every surface. Mneme keeps the same architectural decisions enforced across all of them.