This plugin targets OpenCode 2. It bundles the TraceDecay MCP server, two native V2 TypeScript plugins, and, through the optional Agent component, the shared workflow skills, command prompt templates, and schema-adapted subagents. OpenCode 1 plugins do not load in OpenCode 2 and vice versa; upgrade the host before installing this bundle.
- Native plugin (
opencode/tracedecay.ts, idtracedecay-hooks): OpenCode discovers directplugins/*.{ts,js}files under the global config directory and every.opencode/directory. The definition registers anexecute.aftertool hook and subscribes to the server's public event stream for the durablesession.execution.succeeded/failed/interruptedboundaries. Each callback schedules a bounded daemon-admission child (hook-opencode-tool-afterorhook-opencode-event) in the plugin's own location directory and returns without waiting for it; the daemon owns capture and indexing. Because a shared OpenCode server loads one instance per location but publishes every location's events to each, boundaries are attributed through the located session events that precede them and dispatched once, by the owning instance. - Guidance delivery: OpenCode 2 server plugins have no client UI channel,
so daemon guidance returned by a hook child is held for the owning session
and injected as system context at that session's next model request
(
ctx.session.hook("context")). - MCP companion (
opencode/tracedecay-mcp.ts, idtracedecay-mcp, andopencode/opencode.registration.json): registers thetracedecaystdio server (tracedecay serve) throughctx.mcp.transform. The installer also merges the same server into the nativemcp.serversmap ofopencode.jsonand removes a V1-eramcp.tracedecayentry it finds there. - Skills, commands, and agents: the Agent component deploys the shared
skills/tree, the shared command prompt templates fromcommands/, and OpenCode-schema agent definitions derived fromagents/(V2permissionsfrontmatter denyingeditandshell).AGENTS.mdremains Core instruction content managed by the prompt-rule reconciler; it is not a separate rules product.
OpenCode 2 runs no language servers, so no LSP bridge is registered.
TraceDecay does not drive opencode plugin add: that command installs npm
and Git packages and records them under the host-owned plugins key, which
does not apply to a local plugin file the host already discovers.
Install the plugin (and merge its MCP registration) with:
tracedecay install --agent opencode
The installer writes the plugin to ~/.config/opencode/plugins/tracedecay.ts
(or .opencode/plugins/tracedecay.ts for a project-local install), merges
mcp.servers.tracedecay into opencode.json, and rewrites
__TRACEDECAY_BIN__ to the resolved absolute tracedecay executable path so
OpenCode does not depend on shell PATH. The plugins import only types from
@opencode/plugin, so no package install is required in the config
directory.
OpenCode reloads watched config directories automatically; run
opencode service restart if a change is not picked up. Use
tracedecay doctor to inspect the registration.
Every MCP tool is also available from the shell as tracedecay tool <name>
(tracedecay tool lists tools; tracedecay tool <name> --help shows
parameters). Bundled skills and steering use that CLI fallback when MCP
transport errors or times out, instead of querying .tracedecay databases.
The CLI uses the same daemon authority and is not an availability guarantee;
neither client starts a missing or stopped service. If the daemon is
unavailable or intentionally held, report that state and use scoped native
tools without retrying or changing daemon lifecycle.