codex
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodex Second Opinion
Codex 第二意见
Use Codex to get an independent review from OpenAI's reasoning models.
Use when:
- You want a second opinion on a plan, diff, or architecture decision.
- You need a fresh pass for bugs, edge cases, or missing requirements.
- You want a quick sanity check before sharing with users or stakeholders.
借助Codex从OpenAI的推理模型获取独立审查意见。
适用场景:
- 你需要对计划、代码差异(diff)或架构决策获取第二意见时
- 你需要重新排查bug、边缘情况或遗漏的需求时
- 你需要在向用户或利益相关者分享前快速进行合理性检查时
Invocation
调用方式
Use for non-interactive execution. The prompt can be passed as an argument or piped via stdin.
codex execbash
undefined使用进行非交互式执行。提示语可作为参数传入,或通过标准输入(stdin)管道传输。
codex execbash
undefinedDirect prompt
Direct prompt
codex exec "Read the files in src/ and review them for bugs"
```bashcodex exec "Read the files in src/ and review them for bugs"
```bashPipe via stdin
Pipe via stdin
git diff main..HEAD | codex exec "Review this diff for issues"
undefinedgit diff main..HEAD | codex exec "Review this diff for issues"
undefinedKey Options
关键选项
- : Select model (always use the most capable available:
-m MODEL)gpt-5.2-codex - : Override config values inline (e.g.,
-c key=value)-c model="gpt-5.2-codex" - : Use a config profile from
-p PROFILEto avoid repeating flags~/.codex/config.toml - : Set working directory
-C DIR - : Automatic execution with workspace-write sandbox (fewer approval pauses)
--full-auto - : Sandbox policy (
-s SANDBOX_POLICY,read-only)workspace-write - : Skip repo detection (saves time outside git)
--skip-git-repo-check
- : 选择模型(始终使用可用的最强大模型:
-m MODEL)gpt-5.2-codex - : 内联覆盖配置值(例如:
-c key=value)-c model="gpt-5.2-codex" - : 使用
-p PROFILE中的配置文件,避免重复输入标志~/.codex/config.toml - : 设置工作目录
-C DIR - : 自动执行,使用可写入工作区的沙箱(减少确认停顿)
--full-auto - : 沙箱策略(
-s SANDBOX_POLICY、read-only)workspace-write - : 跳过仓库检测(在Git外的环境节省时间)
--skip-git-repo-check
Workflow
工作流程
- Gather context: Identify the files, plans, or diffs Codex needs
- Define the objective: What does “good” look like? Include constraints and acceptance criteria
- Compose a focused prompt: Be specific about what to review and what feedback you want
- Invoke Codex: Use with appropriate options
codex exec - Report findings: Present Codex's feedback to the user with your own assessment of which points are valid
- 收集上下文:确定Codex需要的文件、计划或代码差异
- 明确目标:“合格”的标准是什么?包含约束条件和验收标准
- 编写聚焦的提示语:明确说明需要审查的内容和想要的反馈类型
- 调用Codex:使用并搭配合适的选项
codex exec - 汇报结果:向用户展示Codex的反馈,并附上你对哪些反馈有效的评估
Model Policy
模型策略
- Prefer ; if unavailable, use
gpt-5.2-codex.gpt-5.2 - If neither is available in this environment, select the strongest model supported by and note the fallback.
codex
- 优先使用;若不可用,则使用
gpt-5.2-codex。gpt-5.2 - 若当前环境中两者都不可用,选择支持的最强大模型,并记录降级使用情况。
codex
Safety and Scope
安全与范围
- Default to for review-only tasks.
-s read-only - Use only when Codex needs to run tests or inspect generated artifacts.
workspace-write - Never pass secrets, tokens, or private customer data.
- 对于仅审查的任务,默认使用。
-s read-only - 仅当Codex需要运行测试或检查生成的产物时,才使用。
workspace-write - 切勿传入密钥、令牌或客户隐私数据。
Prompt Guidelines
提示语指南
- State the review goal explicitly (e.g., "find logical errors", "evaluate scalability", "check for missing edge cases")
- Include constraints or requirements Codex should check against
- Ask for structured output (numbered issues, severity levels) for actionable feedback
- Ask for concrete references (file:line) when reviewing code or diffs
- 明确说明审查目标(例如:“查找逻辑错误”、“评估可扩展性”、“检查遗漏的边缘情况”)
- 包含Codex需要对照检查的约束条件或需求
- 要求结构化输出(编号问题、严重程度等级)以便获取可执行的反馈
- 审查代码或差异时,要求提供具体的引用(文件:行号)
Interpreting Results
结果解读
- Treat Codex feedback as a second opinion, not authority.
- Verify any claims that seem uncertain or conflict with known constraints.
- Prefer actionable items: bugs, regressions, missing tests, and unclear requirements.
- 将Codex的反馈视为第二意见,而非权威结论。
- 验证任何看起来不确定或与已知约束条件冲突的结论。
- 优先关注可执行项:bug、回归问题、缺失的测试、不明确的需求。
Prompt Examples
提示语示例
Plan Review
计划审查
bash
cat plan.md | codex exec -m gpt-5.2-codex -s read-only \
"Review this plan for risks, missing steps, and unclear assumptions.
Return:
1) Critical issues
2) Medium risks
3) Suggested improvements
4) Questions to clarify"bash
cat plan.md | codex exec -m gpt-5.2-codex -s read-only \
"Review this plan for risks, missing steps, and unclear assumptions.
Return:
1) Critical issues
2) Medium risks
3) Suggested improvements
4) Questions to clarify"Diff Review
差异审查
bash
git diff main..HEAD | codex exec -m gpt-5.2-codex -s read-only \
"Review this diff for bugs, regressions, security issues, and missing tests.
Return numbered findings with severity and file:line references."bash
git diff main..HEAD | codex exec -m gpt-5.2-codex -s read-only \
"Review this diff for bugs, regressions, security issues, and missing tests.
Return numbered findings with severity and file:line references."Architecture Review
架构审查
bash
cat design.md | codex exec -m gpt-5.2-codex -s read-only \
"Evaluate this architecture for scalability, fault tolerance, and operational risk.
Call out assumptions and suggest alternatives where applicable."bash
cat design.md | codex exec -m gpt-5.2-codex -s read-only \
"Evaluate this architecture for scalability, fault tolerance, and operational risk.
Call out assumptions and suggest alternatives where applicable."Large Codebase Review
大型代码库审查
bash
codex exec -m gpt-5.2-codex -s read-only \
"Review the codebase with focus on correctness, edge cases, and missing tests.
Read these folders: src/, scripts/, and packages/.
Return numbered findings with severity and file:line references."bash
codex exec -m gpt-5.2-codex -s read-only \
"Review the codebase with focus on correctness, edge cases, and missing tests.
Read these folders: src/, scripts/, and packages/.
Return numbered findings with severity and file:line references."