codex-plan-reviewer
A Claude Code plugin that uses OpenAI's Codex CLI to review plan files produced
by the superpowers writing-plans skill,
then loops the findings back to Claude — via the Stop-hook block channel —
until configurable exit conditions are met. Flawed plans get caught before
an autonomous agent executes them.
What it does
When superpowers writes a plan to docs/superpowers/plans/*.md, this plugin asks
Codex to review it for correctness, completeness, ambiguity, sequencing, test
coverage, hidden assumptions, and scope creep. If Codex reports HIGH-severity
findings, the Stop hook blocks Claude from ending its turn and hands back the
findings, so Claude revises the plan and the reviewer runs again. The loop exits
when there are no HIGH findings (or per your configured exit conditions / a max
iteration cap).
How it works
Claude (superpowers writing-plans) ──Write──► docs/superpowers/plans/<date>-feature.md
│
▼ PostToolUse (Write|Edit|MultiEdit)
on-plan-write.sh ── marks the plan PENDING for this session (no Codex call)
│
▼ Claude tries to end its turn → Stop hook
loop-controller.sh
│ plan content changed since last review?
├── no → clear pending, exit 0 (Claude stops)
└── yes → run-codex-review.sh
codex exec - --output-schema --sandbox read-only
--skip-git-repo-check --ephemeral
→ findings.json (+ error flag)
→ iteration++, store verdict/hash/findings
→ should-continue.sh:
RETRY_ERROR → block "Codex review could not run …"
BLOCK → block "## Codex plan review #N … findings"
EXIT_* → clear pending, exit 0
A block re-prompts Claude with the findings as the reason. Codex runs once
per turn-end, and only when the plan's content hash changed — so iteration
counts genuine review rounds, not keystrokes, and you pay for one Codex call per
round.
Prerequisites
- Claude Code with the plugin system enabled.
- Codex CLI installed and authenticated:
codex login (or set
OPENAI_API_KEY, or printenv OPENAI_API_KEY | codex login --with-api-key).
jq and shasum on PATH.
- macOS users may optionally
brew install coreutils for gtimeout; a portable
pure-shell timeout fallback is built in if it's absent.
Install
This repo is also a one-plugin marketplace (.claude-plugin/marketplace.json),
so end users don't symlink anything. Inside Claude Code:
/plugin marketplace add smart-byte/codex-plan-reviewer
/plugin install codex-plan-reviewer@smart-byte
Or the browse-and-click flow (closest to "one click"): after the first
/plugin marketplace add …, run /plugin, open the Discover tab, select
Codex Plan Reviewer, and press Install. Plugins enable on install — no
restart. Confirm with /plugin that it lists a PostToolUse and a Stop hook.
There is no true single-click install: it's inherently two steps — register the
marketplace once, then install the plugin (like adding an app store, then
picking an app). Everything after the marketplace add is one click in the UI.
Team / non-interactive install — commit this to a project's .claude/settings.json
so the plugin auto-installs when teammates trust the workspace:
{
"extraKnownMarketplaces": {
"smart-byte": { "source": { "source": "github", "repo": "smart-byte/codex-plan-reviewer" } }
},
"enabledPlugins": { "codex-plan-reviewer@smart-byte": true },
"pluginConfigs": {
"codex-plan-reviewer@smart-byte": {
"options": { "auto_review": "true", "plan_path_glob": "docs/superpowers/plans/*.md,docs/plans/*.md" }
}
}
}
Prerequisite for distribution: the repo must be pushed to a public Git host
(e.g. github.com/smart-byte/codex-plan-reviewer) so /plugin marketplace add
can fetch it. Adjust the owner/repo and the marketplace name in
.claude-plugin/marketplace.json if yours differ.
Local dev install (no GitHub, no push): the relative source: "./" only
resolves when the directory is a git repo, so initialise one locally first
(this stays on your machine — no remote, no push):
cd /path/to/codex-plan-reviewer
git init && git add -A && git commit -m "local test build"
Then in Claude Code:
/plugin marketplace add /path/to/codex-plan-reviewer
/plugin install codex-plan-reviewer@smart-byte
/plugin # confirm the PostToolUse + Stop hooks are listed
Installed files are copied into ~/.claude/plugins/cache, so after editing
the source run /reload-plugins to pick up changes (reinstall for structural
changes). For a quick functional check without git, the old
ln -s … ~/.claude/plugins/ symlink also still works.