OpenCode Reference: Hooks, Config, Permissions

Updated by

An independent reference for OpenCode (Anomaly), with every table generated from the open-source repository at the v1.18.33 release tag and refreshed with each release. Each page answers the questions the official documentation leaves open: exact event order, payload fields, defaults, and what each setting blocks.

Pages

  • OpenCode Plugins Reference: All 21 OpenCode plugin hooks with input and output shapes, where plugins load from, load order, why a plugin does not load, and the Claude Code hook mapping.
  • OpenCode Config Reference (opencode.json): Every opencode.json key with type and description, where OpenCode looks for config files, the merge order, env overrides, and which OpenCode 2 keys 1.x accepts.
  • OpenCode Permissions Reference: OpenCode permission keys, defaults, per-agent rules, bash pattern matching, why the last matching rule wins, --auto mode and the OpenCode 2 permissions array.

Common OpenCode questions

How these pages stay current

Tables on every page are regenerated from the OpenCode source with each release: hook events and payload schemas, configuration keys with their types and defaults, and permission modes. The version and date under each title are the release the tables were read from. Prose explains behaviour the tables cannot show, such as the order events fire in and which exit codes block, and cites the exact source files it relies on. Where the Anomaly documentation and the code disagree, these pages follow the code and link both. Each page ends with a Sources list that links every file its tables were read from, pinned to the release tag, so any row can be checked against the exact code that shipped.

Release history

What changed in each OpenCode release, including new hooks, settings and permission modes, is tracked in the OpenCode version tracker.