codex-plugin-cc
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodex Plugin for Claude Code
面向Claude Code的Codex插件
Skill by ara.so — Daily 2026 Skills collection.
A Claude Code plugin that lets you run OpenAI Codex code reviews and delegate background tasks to Codex directly from your Claude Code session. Use it for read-only code reviews, adversarial design challenges, and handing off investigative or fix tasks to Codex as a subagent.
由ara.so开发的Skill — 2026年度每日技能精选集。
这是一款Claude Code插件,支持你直接在Claude Code会话中调用OpenAI Codex执行代码审查,以及将后台任务委派给Codex处理。可用于只读代码审查、对抗性设计挑战,还可将调研或修复任务交给作为子代理的Codex处理。
What It Does
功能说明
- — Standard read-only Codex code review of uncommitted changes or a branch diff
/codex:review - — Steerable review that challenges design decisions, tradeoffs, and assumptions
/codex:adversarial-review - — Delegate a task (bug investigation, fix, etc.) to Codex as a background subagent
/codex:rescue - — Check progress of background Codex jobs
/codex:status - — Retrieve output from a finished job (includes Codex session ID for
/codex:result)codex resume - — Cancel an active background job
/codex:cancel - — Verify Codex is installed and authenticated; optionally enable/disable the review gate
/codex:setup
- — 针对未提交变更或分支差异的标准只读Codex代码审查
/codex:review - — 可定向的审查模式,会质疑设计决策、权衡方案和隐含假设
/codex:adversarial-review - — 将任务(漏洞调研、修复等)作为后台子代理任务委派给Codex
/codex:rescue - — 查看Codex后台任务的进度
/codex:status - — 获取已完成任务的输出(包含Codex会话ID,可用于
/codex:result命令)codex resume - — 取消正在运行的后台任务
/codex:cancel - — 验证Codex是否已安装并完成身份验证;可选择启用/禁用审查闸门
/codex:setup
Requirements
依赖要求
- Node.js 18.18 or later
- A ChatGPT subscription (Free tier works) or an OpenAI API key
- Claude Code with plugin support
- Node.js 18.18或更高版本
- ChatGPT订阅(免费版可用)或 OpenAI API密钥
- 支持插件功能的Claude Code
Installation
安装步骤
1. Add the marketplace and install the plugin
1. 添加应用市场并安装插件
bash
/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-pluginsbash
/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins2. Verify setup
2. 验证安装配置
bash
/codex:setupIf Codex CLI is missing, can install it for you via npm, or install manually:
/codex:setupbash
npm install -g @openai/codexbash
/codex:setup如果缺少Codex CLI,可以通过npm为你安装,你也可以手动安装:
/codex:setupbash
npm install -g @openai/codex3. Authenticate with Codex
3. 完成Codex身份验证
bash
!codex loginSupports ChatGPT account login or API key. Your existing Codex CLI authentication is reused automatically if already logged in.
bash
!codex login支持ChatGPT账号登录或API密钥验证。如果你已经完成登录,已有的Codex CLI身份验证信息会被自动复用。
Key Commands
核心命令
/codex:review
/codex:review/codex:review
/codex:reviewRuns a standard read-only Codex review on your current work.
bash
undefined对你当前的工作内容执行标准只读Codex审查。
bash
undefinedReview uncommitted changes
审查未提交的变更
/codex:review
/codex:review
Review diff against a base branch
审查与基准分支的差异
/codex:review --base main
/codex:review --base main
Run in the background (recommended for multi-file changes)
后台运行(推荐多文件变更场景使用)
/codex:review --background
/codex:review --background
Run and wait inline
运行并等待执行完成
/codex:review --wait
undefined/codex:review --wait
undefined/codex:adversarial-review
/codex:adversarial-review/codex:adversarial-review
/codex:adversarial-reviewChallenges implementation decisions, tradeoffs, and hidden assumptions. Accepts optional free-text focus after flags.
bash
undefined质疑实现决策、权衡方案和隐含假设。可在参数后添加可选的自由文本指定审查重点。
bash
undefinedBasic adversarial review
基础对抗性审查
/codex:adversarial-review
/codex:adversarial-review
Target a branch diff with a specific focus
针对分支差异审查,指定审查重点
/codex:adversarial-review --base main challenge whether this caching approach was correct
/codex:adversarial-review --base main challenge whether this caching approach was correct
Run in background, focus on race conditions
后台运行,重点排查竞态条件
/codex:adversarial-review --background look for race conditions and question the retry design
undefined/codex:adversarial-review --background look for race conditions and question the retry design
undefined/codex:rescue
/codex:rescue/codex:rescue
/codex:rescueHands off a task to Codex via the subagent.
codex:codex-rescuebash
undefined通过子代理将任务交给Codex处理。
codex:codex-rescuebash
undefinedInvestigate a failing test
调研测试失败的原因
/codex:rescue investigate why the tests started failing
/codex:rescue investigate why the tests started failing
Apply a minimal fix
应用最小化修复方案
/codex:rescue fix the failing test with the smallest safe patch
/codex:rescue fix the failing test with the smallest safe patch
Resume the most recent Codex session for this repo
恢复当前仓库最近一次的Codex会话
/codex:rescue --resume apply the top fix from the last run
/codex:rescue --resume apply the top fix from the last run
Start fresh (ignore previous session)
开启全新会话(忽略之前的会话记录)
/codex:rescue --fresh investigate the regression
/codex:rescue --fresh investigate the regression
Use a specific model and effort level
指定使用的模型和推理投入等级
/codex:rescue --model gpt-5.4-mini --effort medium investigate the flaky integration test
/codex:rescue --model gpt-5.4-mini --effort medium investigate the flaky integration test
Use the faster "spark" model (maps to gpt-5.3-codex-spark)
使用速度更快的"spark"模型(对应gpt-5.3-codex-spark)
/codex:rescue --model spark fix the issue quickly
/codex:rescue --model spark fix the issue quickly
Run in the background
后台运行
/codex:rescue --background investigate why the build is failing in CI
You can also trigger rescue via natural language to Claude:
```text
Ask Codex to redesign the database connection to be more resilient./codex:rescue --background investigate why the build is failing in CI
你也可以通过自然语言向Claude发起委派请求:
```text
Ask Codex to redesign the database connection to be more resilient./codex:status
/codex:status/codex:status
/codex:statusbash
undefinedbash
undefinedList all running and recent jobs for this repo
列出当前仓库所有运行中及最近的任务
/codex:status
/codex:status
Check a specific job
查看指定任务的状态
/codex:status task-abc123
undefined/codex:status task-abc123
undefined/codex:result
/codex:result/codex:result
/codex:resultbash
undefinedbash
undefinedGet result of the most recent finished job
获取最近一次已完成任务的结果
/codex:result
/codex:result
Get result for a specific job
获取指定任务的结果
/codex:result task-abc123
Output includes a Codex session ID. Resume that session directly in Codex:
```bash
codex resume <session-id>/codex:result task-abc123
输出内容包含Codex会话ID,你可以直接在Codex中恢复该会话:
```bash
codex resume <session-id>/codex:cancel
/codex:cancel/codex:cancel
/codex:cancelbash
undefinedbash
undefinedCancel the most recent active job
取消最近一次运行中的任务
/codex:cancel
/codex:cancel
Cancel a specific job
取消指定任务
/codex:cancel task-abc123
undefined/codex:cancel task-abc123
undefined/codex:setup
— Review Gate
/codex:setup/codex:setup
— 审查闸门
/codex:setupbash
undefinedbash
undefinedEnable the stop hook review gate
启用停止钩子审查闸门
/codex:setup --enable-review-gate
/codex:setup --enable-review-gate
Disable it
禁用审查闸门
/codex:setup --disable-review-gate
> **Warning:** The review gate runs a Codex review on every Claude response and blocks the stop if issues are found. This can trigger long Claude/Codex loops and drain usage limits. Only enable it when actively monitoring the session.
---/codex:setup --disable-review-gate
> **警告:** 审查闸门会对Claude的每一次响应执行Codex审查,如果发现问题就会阻止停止操作。这可能会触发Claude/Codex长时间循环,消耗使用额度。请仅在主动监控会话时启用该功能。
---Configuration
配置说明
The plugin uses the same as the Codex CLI. Configuration is layered:
config.toml| Location | Scope |
|---|---|
| User-level defaults |
| Project-level overrides (requires trusted project) |
该插件使用与Codex CLI相同的配置文件,配置采用分层生效规则:
config.toml| 位置 | 作用范围 |
|---|---|
| 用户级默认配置 |
| 项目级覆盖配置(需要项目处于可信状态) |
Example: Set default model and effort for a project
示例:为项目设置默认模型和推理投入等级
toml
undefinedtoml
undefined.codex/config.toml
.codex/config.toml
model = "gpt-5.4-mini"
model_reasoning_effort = "xhigh"
undefinedmodel = "gpt-5.4-mini"
model_reasoning_effort = "xhigh"
undefinedExample: Point to a custom OpenAI-compatible endpoint
示例:指定自定义的OpenAI兼容接口端点
toml
undefinedtoml
undefined~/.codex/config.toml
~/.codex/config.toml
openai_base_url = "https://your-custom-endpoint.example.com/v1"
API keys and authentication are managed via `codex login` — do not hardcode keys in config files. The CLI reads from the authenticated session or from the `OPENAI_API_KEY` environment variable.
---openai_base_url = "https://your-custom-endpoint.example.com/v1"
API密钥和身份验证信息通过`codex login`管理 — 请勿在配置文件中硬编码密钥。CLI会读取已认证的会话信息,或者从`OPENAI_API_KEY`环境变量中获取密钥。
---Common Patterns
常用使用场景
Review before shipping
发布前审查
bash
/codex:review --base mainbash
/codex:review --base mainStart a long-running review, check back later
启动长时间运行的审查,后续再查看结果
bash
/codex:adversarial-review --background look for auth and data-loss risks
/codex:status
/codex:resultbash
/codex:adversarial-review --background look for auth and data-loss risks
/codex:status
/codex:resultDelegate a bug investigation and resume in Codex
委派漏洞调研任务,之后在Codex中恢复会话
bash
/codex:rescue --background investigate why the integration test is flakybash
/codex:rescue --background investigate why the integration test is flaky... later ...
... 后续操作 ...
/codex:result
/codex:result
Copy session ID from output, then:
从输出中复制会话ID,然后执行:
codex resume <session-id>
undefinedcodex resume <session-id>
undefinedIterative rescue workflow
迭代式修复工作流
bash
undefinedbash
undefinedFirst pass
首次排查
/codex:rescue investigate the failing build
/codex:rescue investigate the failing build
Apply what Codex found, continuing the same thread
应用Codex发现的问题,延续同一会话继续处理
/codex:rescue --resume apply the recommended fix from the last run
/codex:rescue --resume apply the recommended fix from the last run
Start completely fresh
开启全新会话重新排查
/codex:rescue --fresh re-investigate with a clean slate
undefined/codex:rescue --fresh re-investigate with a clean slate
undefinedUse Claude to delegate naturally
通过Claude自然语言委派任务
text
Ask Codex to refactor the authentication module to remove the global state.Claude will invoke the subagent automatically.
codex:codex-rescuetext
Ask Codex to refactor the authentication module to remove the global state.Claude会自动调用子代理完成请求。
codex:codex-rescueTroubleshooting
问题排查
/codex:setup
says Codex is not installed
/codex:setup/codex:setup
提示Codex未安装
/codex:setupbash
npm install -g @openai/codexbash
npm install -g @openai/codexor let /codex:setup install it for you
或者让/codex:setup自动为你安装
undefinedundefinedCodex is installed but not authenticated
Codex已安装但未完成身份验证
bash
!codex loginSupports ChatGPT account or API key. If using an API key directly:
bash
export OPENAI_API_KEY=your-key-herebash
!codex login支持ChatGPT账号或API密钥验证。如果直接使用API密钥,可以执行:
bash
export OPENAI_API_KEY=your-key-hereBackground job seems stuck
后台任务疑似卡住
bash
/codex:status
/codex:cancel task-abc123bash
/codex:status
/codex:cancel task-abc123Plugin commands not appearing after install
安装后插件命令未显示
bash
/reload-pluginsbash
/reload-pluginsProject-level config not being picked up
项目级配置未生效
Project config in only loads when the project is trusted by Codex. Run directly in the project directory to trust it, or check the Codex advanced config docs.
.codex/config.tomlcodexReview gate creating runaway loops
审查闸门引发无限循环
Disable it immediately:
bash
/codex:setup --disable-review-gate立即禁用该功能:
bash
/codex:setup --disable-review-gateHow It Works Internally
内部工作原理
- The plugin wraps the local binary and the Codex app server
codex - All jobs run in your local environment against your local repository checkout
- Authentication, config, and model settings come from your existing Codex CLI setup
- Background jobs are tracked per-repository and can be resumed in Codex directly via session IDs
- The subagent is registered in
codex:codex-rescueand can be invoked by Claude automatically when you ask it to delegate work to Codex/agents
- 该插件封装了本地二进制文件和Codex应用服务
codex - 所有任务都在你的本地环境中运行,基于你本地的仓库代码执行操作
- 身份验证、配置和模型设置都复用你已有的Codex CLI配置
- 后台任务按仓库维度追踪,可通过会话ID直接在Codex中恢复
- 子代理已注册在
codex:codex-rescue路径下,当你要求Claude将任务委派给Codex时会自动调用/agents