Skip to content

Latest commit

 

History

244 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

External Models for Codex

中文 | English

External Models for Codex is a Codex plugin marketplace for external model CLI workflows. It publishes provider-specific Codex plugins that let Codex ask another local model CLI to review, plan, challenge, rescue, and gate work without turning that model into the implementation authority.

The marketplace currently includes:

  • Claude for Codex: calls the local Claude Code CLI for read-only review, scorecard review, taskset planning, validation-evidence review, bounded assisted review, adversarial critique, implementation planning, multi-role review, native SDK subagent teams, rescue diagnosis, background jobs, structured review output, explicit-cost ultrareview, and an optional Stop hook review gate. It also includes natural-language routing, a dynamic model alias registry, request-local outcome classification, a global Claude work-slot governor, cheap doctor --json diagnostics, and fork-safe CI dogfood so Codex can map "strict", "strongest local", "native subagents", and "background review" requests to Claude-native plugin arguments without requiring users to write internal flags.
  • Gemini for Codex: calls the legacy Gemini CLI (gemini) for Gemini-only read-only review, scorecard review, taskset planning, plan-file review, bounded assisted review, planning, rescue diagnosis, structured review output, role packs, background jobs, and Gemini CLI-native session capability checks.
  • Antigravity for Codex: calls Google Antigravity CLI (agy) for mature plugin-managed review workflows: read-only review, adversarial critique, planning, rescue diagnosis, multi-role review, structured reports, role packs, background jobs, mailbox/leases, lifecycle hooks, GitHub Actions workflow rendering, release checks, opt-in real smoke, and an opt-in Stop hook gate with explicit Gemini or Claude model-provider selection.

External Models for Codex 是一个面向 Codex 的外部模型插件市场,用于把本地 Claude Code CLI、Antigravity CLI、Gemini CLI 等外部模型接入 Codex 的审阅、规划、对抗性复审、救援诊断和 Hook 门禁流程。Codex 仍负责实现和最终决策,外部模型提供独立第二视角。

当前市场包含:

  • Claude for Codex:调用本地 Claude Code CLI,提供只读审阅、scorecard 审阅、taskset 规划、validation evidence 审阅、有界 assisted-review、对抗性审阅、独立规划、多角色审阅、原生 SDK subagent 团队、救援诊断、后台任务、结构化审阅输出、需要费用确认的 ultrareview 和可选 Stop Hook 门禁;同时支持自然语言路由、dynamic model alias registry、request-local outcome classification、全局 Claude 进程 governor、低成本 doctor --json 诊断和 fork-safe CI dogfood,让 Codex 把“严格审阅”“最强本地 Claude”“原生 subagents”“后台审阅”等意图映射到 Claude 原生插件参数,而不要求用户手写内部参数。
  • Gemini for Codex:调用 legacy Gemini CLI(gemini)提供 Gemini-only 只读审阅、scorecard 审阅、taskset 规划、计划文件审阅、有界 assisted-review、规划、救援诊断、结构化审阅输出、角色包、后台任务和 Gemini CLI 原生 session 能力探测。
  • Antigravity for Codex:调用本地 Google Antigravity CLI(agy)提供成熟的插件托管审阅工作流:只读审阅、对抗性审阅、规划、救援诊断、多角色审阅、结构化报告、角色包、后台任务、mailbox/leases、生命周期 hooks、GitHub Actions 工作流渲染、release checks、可选真实 smoke 和可选 Stop Hook 门禁,并显式选择 Gemini 或 Claude 模型 provider。

Install

Remote install from GitHub:

codex plugin marketplace add yilibinbin/external-models-for-codex --ref claude-for-codex-v0.20.1
codex plugin add claude-for-codex@external-models-for-codex

codex plugin marketplace add yilibinbin/external-models-for-codex --ref gemini-for-codex-v0.12.0
codex plugin add gemini-for-codex@external-models-for-codex

codex plugin marketplace add yilibinbin/external-models-for-codex --ref antigravity-for-codex-v0.7.0
codex plugin add antigravity-for-codex@external-models-for-codex

Use the provider-specific immutable release ref for the plugin you want to install. Use main only for development snapshots.

Upgrade an existing install:

codex plugin marketplace upgrade external-models-for-codex
codex plugin remove claude-for-codex
codex plugin add claude-for-codex@external-models-for-codex
codex plugin remove gemini-for-codex
codex plugin add gemini-for-codex@external-models-for-codex
codex plugin remove antigravity-for-codex
codex plugin add antigravity-for-codex@external-models-for-codex

Local development install from this repository:

codex plugin marketplace add .
codex plugin add claude-for-codex@external-models-for-codex
codex plugin add gemini-for-codex@external-models-for-codex
codex plugin add antigravity-for-codex@external-models-for-codex

Requirements

  • Codex CLI with plugin support
  • Claude Code CLI available as claude
  • Optional @anthropic-ai/claude-agent-sdk package for Claude --backend sdk --agent-team sdk-subagents native review mode
  • Gemini CLI available as gemini for Gemini for Codex
  • Google Antigravity CLI available as agy, AGY_CLI_PATH, or ANTIGRAVITY_CLI_PATH for Antigravity for Codex
  • Node.js 20 or newer
  • Git repository for review context collection

Check runtime status:

node plugins/claude-for-codex/scripts/claude-companion.mjs setup

What It Provides

  • claude-review: read-only Claude review of local changes or branch diffs.
  • claude-adversarial-review: challenge assumptions, tradeoffs, rollback paths, and hidden failure modes.
  • claude-plan: ask Claude for an independent implementation plan before Codex edits.
  • claude-plan-review: asks Claude to review a saved implementation plan file. Native SDK subagents are explicit via --backend sdk --agent-team sdk-subagents; ultrareview remains explicit-cost only.
  • claude-assisted-review: runs explicit bounded scorecard feedback; Claude reviews, Codex decides and fixes.
  • claude-multi-review: run role-based review across correctness, security, tests, release, and adversarial perspectives.
  • claude-multi-review --backend sdk --agent-team sdk-subagents: run Claude native SDK subagent review teams; add --native-structured for SDK schema-backed output and --stream-progress for sanitized progress events.
  • claude-ultrareview: run Claude cloud ultrareview only after explicit --confirm-cost consent for possible usage-credit billing.
  • claude-role-packs: inspect built-in Claude reviewer presets and validate user-authored role-pack JSON.
  • claude-mailbox: inspect sanitized review/job coordination summaries.
  • claude-leases: inspect, claim, or release advisory path attention leases.
  • claude-review-gate: configure the optional Stop hook review gate.
  • claude-collaboration-loop: run a plan, reconcile, implement, review, and report workflow.
  • gemini-review, gemini-adversarial-review, gemini-plan, gemini-multi-review, gemini-rescue: Gemini CLI-backed equivalents that stay read-only. gemini-review --structured validates schema-backed findings, gemini-multi-review runs parallel role fan-out, and Gemini CLI-only native agent/session flags are capability-gated from the installed CLI.
  • gemini-mailbox, gemini-leases: inspect sanitized Gemini coordination summaries and advisory path-attention leases.
  • antigravity-review, antigravity-adversarial-review, antigravity-plan, antigravity-multi-review, antigravity-rescue, antigravity-review-gate, antigravity-github-actions-review: Antigravity-backed mature plugin-managed review, planning, rescue, Stop gate, and workflow-risk review with explicit Gemini or Claude model-provider selection. It uses agy only, does not claim Claude SDK, Gemini native-agent, or ultrareview parity, and keeps Claude-through-Antigravity separate from claude-for-codex.

These are skills-and-hook plugins, not MCP/app tool plugins. It is expected that tool_search will not expose callable claude-for-codex, gemini-for-codex, or antigravity-for-codex tools. Codex should route through the provider skills such as claude-for-codex:*, gemini-for-codex:*, and antigravity-for-codex:*.

Claude for Codex supports --quality auto|fast|standard|strong|max. The policy uses Claude Code aliases (sonnet, opus, fable, best) plus valid effort values (low, medium, high, xhigh, max) instead of concrete model ids, so future Claude Code alias updates do not require a plugin change. Explicit --model and --effort override quality. ultracode is not emitted as an effort value, and claude-ultrareview remains explicit-cost only.

Claude for Codex 0.20.1 keeps those aliases in a shared model alias registry used by CLI policy and SDK subagent selection. It also records compact outcome classification metadata for CLI/SDK runs, exposes doctor --json as a cheap no-prompt health check, documents SDK subagents as fresh isolated context reviewers, ships fork-safe repository CI validation, and hardens SDK timeout handling across permission-compatibility retries.

Claude for Codex diagnostics now include install consistency between the running plugin manifest and Codex's enabled registry entry. Review, multi-review, adversarial review, plan, and rescue prompts include bounded advisory project rules from CLAUDE.md, REVIEW.md, .claude/review.md, and .claude/CLAUDE.md; symlinks and outside-workspace files are ignored. capabilities --json also explains adaptive quality routing decisions.

Claude for Codex 0.20.1 adds advisory scorecards and quality-feedback inputs without turning Claude into an unattended implementer. Use review --scorecard --json or multi-review --scorecard --json for weighted quality scorecards, plan --taskset for repo-external task decomposition state, review --validation-log <file> for already-produced validation evidence, and assisted-review --scorecard --max-review-rounds 2 for an explicit bounded review loop. Scorecards are advisory, validation logs are user-provided, and Claude still does not edit, commit, create PRs, merge, close issues, or invoke ultrareview unless the user explicitly requests the separate ultrareview skill.

Claude for Codex includes a global Claude work-slot governor for all plugin-owned launch surfaces: foreground review, background jobs, multi-role parallel fan-out, SDK subagent review teams, Stop hooks, and Codex subagent delegation. Leases live outside repositories under ~/.codex/claude-for-codex/global-resource-locks by default. Set CLAUDE_FOR_CODEX_MAX_CLAUDE_PROCESSES=<n> to tune capacity, or CLAUDE_FOR_CODEX_GLOBAL_RESOURCE_LOCK_DIR=<absolute-private-dir> to move the lock store. Capacity exhaustion returns capacity_blocked instead of spawning unbounded Claude work; plugin-managed parallel role review downgrades to sequential when partial capacity is available, while SDK subagent teams reserve up to one slot per requested role, capped by the effective host limit, and return capacity_blocked when the team cannot be admitted safely. Lease TTLs are automatically raised to cover known long operation timeouts plus a refresh margin, so a live Claude process is not reclaimed simply because the configured base TTL is shorter. Diagnostics expose sanitized resourceGovernor, capacityStatus, and lockRootClass metadata without raw lock-root paths.

Fable / top-model routing

Claude for Codex treats --quality max as the strongest local Claude tier. On Claude Code versions that advertise a top model alias, the runtime prefers best, then fable, then falls back to opus. When a top model is selected through the CLI backend and --fallback-model is available, the plugin adds Claude Code's native fallback unless you supplied your own fallback. It uses --fallback-model opus,sonnet only when the installed CLI help advertises comma-separated fallback lists; otherwise it uses --fallback-model opus. This fallback only handles Claude Code-supported model unavailable, overload, or server-side model errors; it does not handle auth, quota, billing, rate-limit, network, or request-size failures.

Explicit model choices always win:

node plugins/claude-for-codex/scripts/claude-companion.mjs review \
  --model fable --effort max --scope branch --base origin/main --json

Natural language routing uses Fable only for explicit Fable/top/max requests or very high-risk automatic scores. Ordinary deep review remains --quality strong, which maps to Opus. Installed Stop hooks stay conservative and do not automatically use Fable. SDK backend runs do not infer top-model availability from CLI help; use explicit --model or CLAUDE_FOR_CODEX_TOP_MODEL when you want SDK subagents to use a top alias.

Stop Review Gate

The Stop hook is installed but disabled by default. Enable it in the repository you want to protect:

node plugins/claude-for-codex/scripts/claude-companion.mjs setup --enable-review-gate --review-gate-mode multi-role

Disable it:

node plugins/claude-for-codex/scripts/claude-companion.mjs setup --disable-review-gate

After installing or upgrading, open Codex Settings > Hooks and trust or enable the Claude for Codex Stop hook if prompted.

Documentation

Safety Model

Review workflows invoke Claude with read-only permissions. Codex remains responsible for applying or rejecting Claude findings. CLI mode remains the default; --backend sdk is explicit, and native SDK subagent teams additionally require --agent-team sdk-subagents. SDK mode resolves @anthropic-ai/claude-agent-sdk with @anthropic-ai/claude-code as a compatibility fallback. Ultrareview may use remote/cloud execution and usage-credit billing, so it requires --confirm-cost or CLAUDE_FOR_CODEX_ALLOW_ULTRAREVIEW=1. The global resource governor bounds plugin-owned Claude work slots and returns capacity_blocked when capacity is exhausted. The Stop gate blocks only when Claude explicitly returns BLOCK:; Claude runtime failures, authentication failures, rate limits, invalid output, timeouts, or resource-governor capacity blocks fail open with warnings.

Gemini workflows are Gemini CLI-only. Gemini for Codex uses the legacy gemini CLI with bounded inline git context and keeps Antigravity out of the Gemini plugin so Claude workflows remain owned by Claude for Codex or explicit Antigravity model-provider selection.

Antigravity workflows use agy --model --print-timeout --prompt and reject GPT/OpenAI model labels. ANTIGRAVITY_FOR_CODEX_MODEL_PROVIDER=gemini is the default; ANTIGRAVITY_FOR_CODEX_MODEL_PROVIDER=claude is explicit and still runs through Antigravity, not through claude-for-codex. The Stop gate blocks only when Antigravity's first line is BLOCK:; runtime failures, invalid output, or timeouts fail open with warnings. real-smoke is opt-in, and generated CI workflows require an authenticated agy command in the runner environment.

Gemini for Codex also includes lifecycle hooks for same-session cleanup and unread-result reminders, a noninteractive recommend-execution-mode helper, and optional Gemini CLI-native session flags such as --resume, --session-id, and --worktree when the local Gemini CLI reports support.

About

Codex marketplace for external model CLI review, planning, rescue, and hook-gate workflows.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages