> ## Documentation Index
> Fetch the complete documentation index at: https://docs.termyte.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode

> Capture OpenCode chat, tool, compaction, and session events.

# OpenCode

Select OpenCode when you run:

```bash theme={null}
termyte init
```

Termyte writes:

```text theme={null}
~/.config/opencode/plugins/termyte.js
~/.config/opencode/opencode.json
```

The generated plugin forwards:

* user and assistant messages;
* completed tool calls;
* compaction events;
* session start, idle, and deletion lifecycle signals.

Forwarding runs in the background and does not block OpenCode if Termyte cannot accept an event. Replayed events with the same platform ID are stored only once.

## Background synthesis

OpenCode can be selected as the memory-processing provider after `termyte init` verifies its existing authentication. The detached worker invokes `opencode run --format json` with a synthesis prompt, parses completed text events, validates the structured observations or memories, and persists them with source provenance.

This is a separate non-interactive process; it does not reuse or block the active OpenCode session.

## Current boundary

The OpenCode plugin does not return automatic Termyte context. Use `termyte task resume` or the MCP tools for explicit continuity.

## Verify

After restarting OpenCode, complete a tool-using task and open:

```bash theme={null}
termyte viewer
```

`termyte doctor` does not yet report OpenCode plugin coverage.
