Introduction
openclaude-loop is a Claude Code plugin that puts a second, independent agent between you and the code.
Claude Code does the recon, settles the requirements with you and writes the plan. The OpenCode CLI then tears that plan apart in a genuinely read-only session, and the two argue — in one continuous OpenCode session — until the plan survives or the round budget runs out. Then somebody builds it, and whoever built it never grades it.
Claude Code
│
│ coordinator: recon, requirements, PLAN.md, arbitration
▼
openclaude-loop
│
▼
OpenCode CLI
│
▼
configured OpenCode provider / model
OpenCode is not a model. It is a CLI. The second opinion you get is whatever provider and model you configured OpenCode to use.
This is not an official Anthropic or OpenCode project.
✨ Features
- Adversarial plan review before any code exists — OpenCode reads your actual repository and the exact
PLAN.md, and returns a structuredAPPROVED/REVISE/BLOCKED. - One continuous review session — revision rounds resume the same OpenCode session id, so the reviewer judges whether its own earlier findings were really fixed, rather than being a fresh critic each round.
- Read-only in fact, not by request — enforced through OpenCode's permission system with a generated deny-by-default profile, never by asking the model nicely.
- Either agent can build —
builder=claude(default) orbuilder=opencode. The one that didn't build does the final inspection, always in a fresh session. - Machine-readable verdicts — parsed only from an
<OPENCLAUDE_RESULT>block and schema-validated. The word "approved" in prose is not approval. - Fingerprinted approvals — approval binds to the plan's SHA256; inspection binds to a hash of every staged, unstaged, deleted and untracked change. Edit either and the binding breaks.
- Failures stay failures — a timeout, empty response, non-zero exit or malformed result can never become a verdict.
- Proof, not promises — Claude runs the verification command itself and records the exit code. An agent saying "tests should pass" is not evidence.
- No quota burned in CI — 73 contract tests drive a fake OpenCode CLI on Linux, macOS and Windows.
The invariant
Whoever creates something is never the agent that grades it.
| Claude Code | OpenCode | |
|---|---|---|
Recon, requirements, PLAN.md | owns | — |
| Plan review | arbitrates the findings | independent adversarial reviewer, read-only |
builder=claude (default) | implements | fresh read-only session inspects the diff |
builder=opencode | independently inspects the diff | implements with controlled write access |
| Proof commands | runs them itself | never trusted to verify its own work |
What ships
| Path | What it is |
|---|---|
skills/openclaude-loop/SKILL.md | The workflow Claude follows |
skills/openclaude-loop/references/ | runtime.md, security.md, protocol.md, build.md |
skills/openclaude-loop/scripts/runner.py | The OpenCode adapter — one turn per invocation, no pip dependencies |
skills/opencode-review/, skills/opencode-build/ | Direct entry points |
Credits
openclaude-loop is based on and inspired by chaseai-yt/claudex-loop by Chase AI, used under the MIT License, with the Codex integration replaced by OpenCode throughout. The upstream authors have not endorsed this project.
Released under the MIT License.