尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Deterministic delegation between Claude Code and the Codex CLI, in both directions. Seven task classes per side, wrappers that own every flag, Codex models resolved from the live catalog (GPT-6 ready), model-pinned agent templates, guard hooks, and Teams/Enterprise org guidance.
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
Delegation between Claude Code and the OpenAI Codex CLI, in both directions, with a script owning every flag so the model classifies but never improvises.
This is the setup I run daily as Chief Agent Officer at the Marketing + Media Alliance, extracted and stripped of anything organization-specific. Every claim below was verified against a named CLI version on a stated date, and the failure modes in the "what this cost to get right" sections are ones that actually bit.查看完整 README ↗Delegation between Claude Code and the OpenAI Codex CLI, in both directions, with a script owning every flag so the model classifies but never improvises.
This is the setup I run daily as Chief Agent Officer at the Marketing + Media Alliance, extracted and stripped of anything organization-specific. Every claim below was verified against a named CLI version on a stated date, and the failure modes in the "what this cost to get right" sections are ones that actually bit.
Two reasons to run it either way:
You don't invoke any of this by hand. You talk to whichever CLI you're in; the skill and rules make it classify and route on its own:
review-class call.explore or ingest worker, with only the summary returning to your context.review-class call, framed as feedback, not a bug hunt.What each wrapper routes to today, with list prices. API prices are USD per million uncached input / output tokens at standard processing and standard context length (Astra bills more above 272K input). Codex credits are the Standard-speed rate a ChatGPT-plan Codex call burns per million uncached input / output tokens.
| Provider | Model | Role in this kit | API $/M in / out | Codex credits/M in / out | Released |
|---|---|---|---|---|---|
| Anthropic | Fable 5.1 (claude-fable-5-1) | orchestrator (optional) | $10 / $50 | n/a | 2026-09-01 |
| Anthropic | Opus 5.5 (claude-opus-5-5) | orchestrator; hardest worker | $4 / $20 | n/a | 2026-09-22 |
| Anthropic | Sonnet 5.5 (claude-sonnet-5-5) | implement, explore, review workers | $2 / $10 | n/a | 2026-09-28 |
| Anthropic | Haiku 4.5 (claude-haiku-4-5-20251001) | commit, ingest workers | $1 / $5 | n/a | 2025-10-15 |
| OpenAI | GPT-6 Astra (gpt-6-astra) | frontier tier: review, hardest | $10 / $50 | 250 / 1,250 | 2026-09-03 |
| OpenAI | GPT-6.1 Sol (gpt-6.1-sol) | standard tier: implement, explore, ingest, prose | $2 / $10 | 50 / 250 | 2026-09-29 |
| OpenAI | GPT-6 Luna (gpt-6-luna) | fast tier: commit | $0.10 / $0.50 | 2.5 / 12.5 | 2026-09-22 |
Anthropic has said Haiku 5.5 will follow Sonnet 5.5; until it ships, Haiku 4.5 is the cheap Claude tier. GPT-6 Sol (2026-09-22) is still listed but the catalog now labels it "previous generation", and the resolver picks GPT-6.1 Sol. Sources: Anthropic launch pages for Opus 5.5 and Sonnet 5.5, Anthropic release notes, the OpenAI API changelog, and Codex pricing, all read 2026-09-30.
List price per token says little about what a task costs, because models differ in how many tokens they spend. These are the published per-task figures for the models above. The units differ between sources, so compare within a row group, never across.
| Source and metric | Model (effort) | Score | Cost |
|---|---|---|---|
| Artificial Analysis Intelligence Index, $/task | GPT-6 Astra (max) | 53 | $3.26 |
| Claude Fable 5.1 (max, with fallback) | 53 | $7.63 | |
| Claude Opus 5.5 (max) | 58 | $5.98 | |
| Claude Sonnet 5.5 (max, prerelease build) | 56 | $7.60 | |
| GPT-6.1 Sol (max) | 52 | $0.72 | |
| GPT-6 Sol / GPT-6 Luna (max) | not published | $1.06 / $0.07 | |
| Vals Terminal-Bench 4.0, $/test | GPT-6 Astra | 59.6% | $9.58 |
| Claude Fable 5.1 | 58.1% | $17.18 | |
| Anthropic SWE-bench Pro (478-task internal subset), $/solved task | Claude Opus 5.5 (medium) | 92.8% | $0.22 |
| Claude Opus 5.5 (low) | 87.4% | $0.12 | |
| Claude Fable 5.1 (default) | 92.3% | $1.19 | |
| Claude Fable 5.1 (low) | 88.6% | $0.54 | |
| Claude Sonnet 5 (default) |
What this means for routing:
standard tier and Astra is reserved for review and hardest.This kit implements the orchestrator-worker pattern: a strong model plans and delegates, cheaper workers loop to completion, only summaries come back. Anthropic's September 2026 cost and intelligence guide is the most careful public measurement of when that pays, and it is narrower than the launch-week coverage suggested:
Launch coverage in July (the-decoder) reported the orchestrator reaching 96% of Fable 5's BrowseComp score at 46% of the cost. The current guide reports a different full-set comparison, with Fable 5 alone matching coordinator accuracy at 22% to 30% lower cost; whether the two setups are comparable is not documented. Earlier versions of this README quoted exact per-problem figures from that period that we can no longer source, so they have been removed.
That is why this kit routes by class instead of delegating everything: bulky, parallel, read-heavy work (explore, ingest, multi-file implement) goes out; a single hard reasoning chain stays with the orchestrator or goes to one hardest call. It also extends Anthropic's setup in two ways: the worker pool spans two model families (Claude and GPT-6), and routing is deterministic (pinned definitions and a flag-owning script) rather than left to the orchestrator's judgment on each spawn.
Everything here was built by fixing real failure modes, each independently verified (July 2026, codex-cli 0.144.1, Claude Code 2.1.x):
-c 'mcp_servers={}' is a no-op (TOML table overrides merge), so the popular "disable MCP for speed" advice never worked; the real switch is --ignore-user-config.model/reasoning_effort (openai/codex#31814), silently running every subagent on the parent model; two feature flags restore them.codex exec hangs on piped stdin in background runs; piping its stdout through tail silently truncates findings.model: inherit, so ad-hoc spawns from an Opus session burn Opus on mechanical work.Install the half that matches the CLI you drive. Most people want one; installing both makes delegation work whichever session they happen to be in.
In Claude Code (delegates out to Codex):
cp -r for-claude-code/skills/delegate-to-codex ~/.claude/skills/
mkdir -p ~/.claude/agents && cp for-claude-code/agents/*.md ~/.claude/agents/ # optional, model-pinned templates
In Codex (delegates out to Claude Code):
cp -r for-codex/skills/delegate-to-claude ~/.codex/skills/
mkdir -p ~/.codex/agents && cp for-codex/agents/*.toml ~/.codex/agents/ # optional, Codex fan-out roles
As a plugin marketplace, which is the version that keeps updating:
# Claude Code
/plugin marketplace add alectivism/cross-model-agent-delegation
# Codex
codex plugin marketplace add alectivism/cross-model-agent-delegation
Requires: both CLIs installed and logged in (codex login, claude auth), plus jq for the guard hooks. Also add the routing rules from docs/claude-md-snippet.md to your CLAUDE.md. That's the always-in-context layer that makes delegation happen by default instead of on request.
Each skill loads automatically when a task smells like cross-model delegation ("ask GPT", "get Claude's read", "second opinion", "offload this review"), or when the orchestrator decides on its own that a subtask is worker work. It classifies into one of seven classes (commit, implement, explore, ingest, review, hardest, prose) and runs the wrapper, which owns every flag. You never type the invocation yourself, though you can:
~/.claude/skills/delegate-to-codex/scripts/codex-run.sh review "Here is a plan and its context: ..."
~/.codex/skills/delegate-to-claude/scripts/claude-run.sh review "Here is a plan and its context: ..."
An instruction is a nudge; a hook is a gate. Each side ships a guard that blocks raw CLI calls, with an explicit bypass (CODEX_RAW=1 / CLAUDE_RAW=1). In ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/delegate-to-codex/scripts/codex-guard.sh",
"timeout": 10
}]
}]
}
}
for-codex/skills/delegate-to-claude/scripts/claude-guard.sh is the mirror, reading the same JSON envelope on stdin.
Same core classes on both sides, so the mental model transfers. Each maps to a model tier, an effort level, and a write posture.
On the Codex side, models are resolved, not pinned. codex-models.sh reads Codex's own server-fetched catalog (~/.codex/models_cache.json, refreshed on every codex run) and resolves three tiers by model family, newest generation first: frontier (newest Astra), standard (newest Sol), and fast (newest Luna), each following any server upgrade pointer and falling back up a tier if its family disappears. It does not use catalog rank, which is picker order: on 2026-09-22 the catalog listed GPT-6 Sol above GPT-6 Astra. Versions are compared zero-padded, so gpt-6.1-sol outranks gpt-6-sol; the original unpadded sort ranked 6 above 6.1, so the first catalog to list both kept routing to the older Sol until the fix on 2026-09-30. A new GPT release is picked up on the next call with no edit to the kit, once the CLI is new enough to list it (GPT-6.1 Sol needs codex-cli 0.159.x). codex-models.sh check shows the catalog, the resolved tiers, and whether the installed agent TOMLs in $CODEX_HOME/agents (normally ~/.codex/agents, copied from for-codex/agents, tagged # codex-tier:) have drifted; sync-agents rewrites them.
Claude Code to Codex (codex-run.sh):
| Class | Tier / effort | Sandbox | For |
|---|---|---|---|
commit | fast / low | read-only | commit messages, renames, trivial mechanical |
implement | standard / medium | workspace-write | bounded, specified code changes |
explore | standard / medium | read-only | ambiguous work needing repo exploration or judgment |
ingest | standard / medium | read-only | long-context read-heavy extraction |
review | frontier / medium | read-only | adversarial review, verdicts, architecture |
hardest | frontier / high | read-only | after another class failed, or genuinely hardest; --escalate = xhigh, --effort ultra adds Codex-side automatic sub-agent delegation |
prose | standard / medium | read-only | readability and copy editing of reader-facing text by a second model |
--escalate lifts any standard class to frontier.
Codex to Claude Code (claude-run.sh):
| Class | Model / effort | Tools | For |
|---|---|---|---|
commit | haiku / low | read-only | commit messages, renames, trivial mechanical |
implement | sonnet / high | write (acceptEdits) | small, fully specified code changes |
explore | sonnet / medium | read-only | ambiguous work needing repo exploration or judgment |
ingest | haiku / medium | read-only | long-context read-heavy extraction |
review | sonnet / high | read-only | adversarial review, verdicts, architecture |
hardest | opus / xhigh | read-only | after a cheaper class failed |
--escalate moves one rung up on either side (allowed after a failure, or upfront when a wrong verdict triggers something irreversible). --effort <level> tunes effort within a class on either side (low..max; codex-run.sh also accepts ultra on models that support it) while the model stays class-assigned. The rest are codex-run.sh only: --model <slug> pins a slug for one call when you need an A/B, and --priority (formerly --fast-tier) opts into Codex's Fast service tier, which bills 2.5x included subscription usage (2x on purchased credits); OpenAI documents a 1.5x speedup for GPT-5.5/5.6 and publishes no per-model figure for GPT-6 (Codex speed); the wrapper pins service_tier="default" otherwise, because the catalog's per-model default is Fast and --ignore-user-config would let it through. The design principle: the LLM only classifies; code owns the flags. Determinism comes from shrinking the judgment surface to one enum, not from asking the model to remember rules.
codex-run.sh also bakes in --ignore-user-config (drops ~20 MCP servers and ~50 plugins that otherwise cold-start for minutes), an explicit sandbox, env -u OPENAI_API_KEY (forces subscription auth), output to a file instead of stdout, </dev/null (background hang fix), and the #31814 feature flags so a v2-parent orchestrator can actually route cheaper leaves.
claude-run.sh bakes in --strict-mcp-config and --disable-slash-commands, full model IDs rather than aliases, a read-only tool allowlist with no shell, the prompt on stdin, env -u ANTHROPIC_API_KEY, and a worker-framing system prompt so the reply comes back as an answer rather than an offer of next steps.
Every one of these was found by running it, not by reading the docs:
--model haiku silently ran Sonnet 5: On 2.1.220 haiku wasn't a documented alias and fell through to Sonnet, so a haiku-tier call billed at Sonnet with nothing in the output saying so. Proof is in --output-format json → modelUsage. By 2.1.286 (re-checked 2026-09-30) all four aliases resolve correctly, but the wrapper still pins full IDs (claude-haiku-4-5-20251001, claude-sonnet-5-5, claude-opus-5-5) so an alias change can never move a tier silently.--strict-mcp-config took a fully loaded machine from 123 tools to 29 built-ins: Those 94 tool schemas load every turn otherwise.--bare is a trap: It looks like the equivalent of Codex's --ignore-user-config, but it also forces auth to ANTHROPIC_API_KEY or an apiKeyHelper and never reads OAuth or the keychain. On a subscription it either fails or quietly bills the API.--tools, --add-dir, --allowedTools, and --mcp-config are variadic, so a trailing positional prompt is swallowed as another value. The symptom is Input must be provided either through stdin or as a prompt argument when you clearly passed one.--permission-mode plan does block writes including through Bash, but it drags the interactive framing along: workers write plan documents into ~/.claude/plans/ and end on "shall I proceed?". Dropping Bash from the allowlist is the stronger lock and the quieter one. Confirmed by asking a review worker to overwrite a file: it declines in one line and the file is untouched.-C: The CLI has no working-directory flag; the wrapper cds and passes --add-dir.Facts current as of Claude Code 2.1.x (docs):
model: (sonnet, opus, haiku, full ID, or inherit) and effort: (low..max). Both default to inheriting the session.model override, but no effort parameter; effort only exists in definitions. So an instruction like "scale reasoning effort to difficulty" is unactionable for ad-hoc spawns; the orchestrator has no knob to turn. If you want effort routing, ship named agents with effort presets and instruct by agent name. That asymmetry is why this kit is definitions-first.CLAUDE_CODE_SUBAGENT_MODEL sets the model for subagents, teammates, and workflow agents that are not assigned one another way; a per-call model and a definition's model (including inherit) both beat it. CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 (v2.1.257+) makes it win over everything, built-ins included (docs). Pinning per definition is still the precise tool; the env var is the safety net.general-purpose and one-off subagents follow per-call model, then frontmatter, then CLAUDE_CODE_SUBAGENT_MODEL, then the session model; claude-code-guide runs on Haiku. An Opus session that spawns an ad-hoc researcher with no model and no env default runs it on Opus. This is the single biggest silent cost leak; the templates in for-claude-code/agents/ exist to close it.for-claude-code/agents/ specifies what its final message must contain.~/.claude/agents/), project (.claude/agents/), Enterprise managed subagents (managed settings directory; override same-named user/project agents), or a plugin agents/ directory, the packaging unit that also reaches Cowork. Org admins can force-install plugins (Organization settings → Plugins, or managed-settings.json); note CLI users still install with , and plugin agents ignore , , and frontmatter. Skills cannot define agents; they can only reference them.The orchestrator re-reads its whole conversation every turn, including after each worker returns. Delegation pays because it controls what enters that transcript: a worker burns its tokens in a disposable context and hands back a tight brief, so 50k tokens of search noise become 500 tokens of summary, and prompt caching discounts the re-read of everything older. Two costs to respect: spawning has fixed overhead (system prompt + tool definitions load per worker, and multi-agent sessions run roughly 4-7x the raw tokens of single-agent), so tiny tasks are a net loss inline-able in one call; and nesting beyond two layers usually loses to context blindness: each layer only knows what its parent passed down. Anthropic's measurements above say the same thing from the other side. Fan out when the work is exploratory and bulky, stay inline when it's small, and stop at one orchestrator-to-worker layer except when the middle layer genuinely compresses (a researcher fanning out per-source readers).
for-claude-code/agents/ ships pinned templates: researcher, deep-research, content-writer, bug-investigator, doc-writer, pr-preparer, test-writer, dependency-auditor, adversarial-verifier, and a _template.md. The adversarial-verifier pairs with any generator as a generator/verifier split; run the verifier on a different model (or model family, via codex-run.sh review or claude-run.sh review) than the generator, because different models catch different errors.
The Claude Code Playbook (repo) is the wider setup this kit came out of: MCP strategy, subagent pinning, hooks, security, and 34 dated lessons.
See docs/org-instructions-cowork.md for a paste-ready organization instruction that propagates a lightweight version of this delegation policy to every member across Chat, Cowork, and Code, plus why an instruction alone isn't sufficient and what the plugin/managed-agent backstop looks like.
for-claude-code/ install this half into ~/.claude
skills/delegate-to-codex/ SKILL.md + codex-run.sh + codex-guard.sh
agents/ model+effort-pinned Claude agent templates
for-codex/ install this half into ~/.codex
skills/delegate-to-claude/ SKILL.md + claude-run.sh + claude-guard.sh
agents/ Codex fan-out roles: luna-leaf (fast tier), terra-ingest (standard tier), sol-reviewer (frontier tier); names are historical, the `# codex-tier:` tag decides
docs/org-instructions-cowork.md org instruction for Teams/Enterprise admins
docs/claude-md-snippet.md routing rules for your CLAUDE.md (always-in-context layer)
Skill names read as verbs from the installer's point of view: you install delegate-to-codex in Claude Code and delegate-to-claude in Codex. The folder says which host, the name says which direction.
docs/claude-md-snippet.md.A model reading a rule is compliance; a script owning the flags is determinism. Use both.
The five rules everything here follows from:
Codex model slugs are resolved from the live catalog, but the fallback constants in codex-models.sh, the pinned Claude IDs in claude-run.sh, the prices and benchmark figures above (read 2026-09-30), and behaviors like #31814 are point-in-time; re-verify after either CLI updates. The codex features list and codex mcp list commands are your friends, and don't trust an LLM's self-report of its own tool schema, ours confidently got it wrong in both directions. Verify with --json events or A/B tests.
MIT
| 77.4% |
| $0.84 |
/plugin installhooksmcpServerspermissionMode