romain325

Opencode Hooks Plugin — Development skill for Claude Code

Development community

Use claude code hooks definition in opencode.

How to install Opencode Hooks Plugin

This entry records only its repository, not the path inside it, so there is no exact command to give. Open romain325/opencode-hooks-plugin and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Opencode Hooks Plugin does

Use claude code hooks definition in opencode.

Alternatives in Development

  • IPolloWork — Enterprise-grade, local-first Agent Workbench for people and agent teams 4.9k ★
  • Petdex — A public gallery of animated pets for Codex, Claude Code, DeepSeek Harness, Hermes, OpenCode, Gemini CLI, and 4k ★
  • Hapi — App for Claude Code / Codex / Gemini / OpenCode, vibe coding anytime, anywhere 3.6k ★

README

opencode-hooks-api

An OpenCode plugin that runs your Claude Code hooks inside OpenCode. Same config format, same execution contract, different runtime. Because apparently one place to define your hooks wasn't ambitious enough.

What it does

Reads hook definitions from `.claude/settings.json` and fires them in response to OpenCode lifecycle events. If you already have Claude Code hooks set up, they'll work here without any changes.

Supports all four hook types: `command` (bash), `http` (POST), `prompt` (LLM call), and `agent` (LLM call, but it gets to think longer).

Local development setup

If you want to use the plugin directly from a local checkout — without publishing to npm — use OpenCode's local plugin directory instead of the `plugin` array in `opencode.json`.

**1. Clone the repo and build it**

git clone https://github.com/your-org/opencode-hooks-api
cd opencode-hooks-api
bun install
bun run build      # compiles src/ → dist/

**2. Symlink (or copy) the compiled entry point into your project's plugin directory**

# From the root of the project where you want to use the plugin:
mkdir -p .opencode/plugins
ln -s /path/to/opencode-hooks-api/dist/index.js .opencode/plugins/opencode-hooks-api.js

Alternatively, copy the file if you don't want a symlink:

cp /path/to/opencode-hooks-api/dist/index.js .opencode/plugins/opencode-hooks-api.js

OpenCode automatically loads every `.js` / `.ts` file found in `.opencode/plugins/` at startup — no entry in `opencode.json` needed.

**3. Define your hooks** in `.claude/settings.json` (same as usual — see [Setup](#setup) below).

**4. Rebuild after changes**

If you edit the source, recompile before restarting OpenCode:

# One-off rebuild
bun run build

# Or keep a watcher running while you develop
bun run dev

Setup

**1. Register the plugin** in `opencode.json`:

{
  "plugin": ["opencode-hooks-api"]
}

**2. Define your hooks** in `.claude/settings.