
opencode-prompts
by minipuft
opencode-prompts
OpenCode plugin for the claude-prompts MCP server. Chain tracking, gate reminders, and state preservation—all working with OpenCode's native plugin API.
Why This Plugin
| Problem | Solution | Result |
|---|---|---|
| FAIL verdict executed anyway | tool.execute.before blocks prompt_engine | Gate enforcement before execution |
Chain state lost on /compact | State preservation hook | Resume from Step 3/5, not Step 1 |
| Forgot to respond to gate review | Gate reminder injection | GATE_REVIEW: PASS|FAIL prompt appears |
| Verify loop runs forever | Shell verify tracking | Loop terminates after max attempts | | MCP server setup is manual | Bundled claude-prompts server | Works out of the box |
Quick Start
# Install globally
npm install -g opencode-prompts
opencode-prompts install
# Or via npx (non-interactive)
npx opencode-prompts install -y
Restart OpenCode. You should see chain progress after prompt_engine calls:
[Chain] Step 2/4 - call prompt_engine to continue
[Gate] code-quality
Respond: GATE_REVIEW: PASS|FAIL - <reason>
CLI Reference
install
Sets up hooks and registers the plugin globally.
opencode-prompts install [options]
Options:
| Flag | Description |
|---|---|
--yes, -y | Skip prompts, auto-confirm all questions |
--force | Reinstall hooks even if already installed |
--skip-hooks | Only register plugin, skip hook installation |
--help, -h | Show help message |
What it configures:
| Component | Location | Description |
|---|---|---|
| Hook scripts | ~/.claude/hooks/claude-prompts/ | Python hooks for chain tracking, gate reminders, state preservation |
| Hook registration | ~/.claude/hooks/hooks.json | Registers hooks with Claude Code |
| Plugin registration | ~/.config/opencode/opencode.json | Adds "opencode-prompts" to global plugin array |
Examples:
opencode-prompts install # Interactive install
opencode-prompts install -y # Non-interactive (CI/scripts)
opencode-prompts install --force # Reinstall hooks
opencode-prompts install --skip-hooks # Plugin registration only
uninstall
Removes hooks and plugin registration.
opencode-prompts uninstall [options]
Options:
| Flag | Description |
|---|---|
--cleanup-legacy | Also remove hooks from project .claude/settings.json |
--help, -h | Show help message |
What it removes:
| Component | Location |
|---|---|
| Hook scripts | ~/.claude/hooks/claude-prompts/ |
| Hook registration | ~/.claude/hooks/hooks.json |
| Plugin registration | ~/.config/opencode/opencode.json |
Examples:
opencode-prompts uninstall # Full uninstall
opencode-prompts uninstall --cleanup-legacy # Also clean project hooks
Features
-
Gate Enforcement — Blocks FAIL verdicts and missing gate responses before execution
-
Chain Tracking — Shows
Step 2/4progress after each prompt_engine call -
Gate Reminders — Injects
GATE_REVIEW: PASS|FAILformat when gates are pending -
State Preservation — Chain/gate state survives session compaction
-
Shell Verify Tracking — Monitors verification loop attempts
-
Auto-cleanup — Clears state when sessions end
-
Bundled MCP Server — Includes claude-prompts server, no separate install needed
Hooks
| OpenCode Hook | Purpose |
|---|---|
tool.execute.before | Blocks FAIL gate verdicts and missing gate responses |
tool.execute.after | Injects chain progress + gate reminder |
Related servers

n8n
by n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

@modelcontextprotocol/server-everything
OfficialMCP server that exercises all the features of the MCP protocol

@modelcontextprotocol/server-filesystem
OfficialMCP server for filesystem access