codex
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodex
Codex
Profiles
预设配置
- (no profile) — read-only analysis (no compilation, no tests)
- — local edits, build, or test (
--profile edit, full-auto)workspace-write - — network or broad filesystem access (
--profile full, full-auto)danger-full-access
Use whenever the task involves , , or any command that writes build artifacts. The default read-only sandbox blocks all writes including compiler temp dirs.
--profile editgo testgo buildFor complex tasks, add .
--config model_reasoning_effort="xhigh"- (无配置) — 只读分析(不编译、不测试)
- — 本地编辑、构建或测试(
--profile edit,全自动)workspace-write - — 网络或广泛文件系统访问(
--profile full,全自动)danger-full-access
当任务涉及、或任何写入构建产物的命令时,请使用。默认的只读沙箱会阻止所有写入操作,包括编译器临时目录的写入。
go testgo build--profile edit对于复杂任务,添加 参数。
--config model_reasoning_effort="xhigh"Model Selection
模型选择
Default to the project model in ().
.codex/config.tomlgpt-5.4Use for speed-first interactive work:
--model gpt-5.3-codex-spark- tight back-and-forth iteration
- quick bug fixes and targeted edits
- small-to-medium refactors or UI tweaks
- rapid prototyping where frequent redirect/interrupt is expected
Stay on default for depth-first work:
gpt-5.4- long autonomous runs
- broad multi-file changes with heavy reasoning
- test-heavy or verification-heavy tasks
- higher correctness/risk surfaces where deeper reasoning is worth the extra latency
If the user explicitly requests a model, follow the user's request.
默认使用中配置的项目模型()。
.codex/config.tomlgpt-5.4对于优先考虑速度的交互式工作,请使用:
--model gpt-5.3-codex-spark- 紧密的来回迭代
- 快速修复bug和定向编辑
- 中小型重构或UI调整
- 需要频繁重定向/中断的快速原型开发
对于深度优先的工作,请保持使用默认的:
gpt-5.4- 长时间自主运行
- 需要大量推理的广泛多文件更改
- 重测试或重验证的任务
- 高正确性要求/高风险场景,此时深度推理值得付出额外的延迟成本
如果用户明确指定了模型,请遵循用户的要求。
Commands
命令
Project defaults in . Always include and . Only override model when the user explicitly requests it, or when the task clearly fits the Spark speed-first criteria above.
.codex/config.toml--skip-git-repo-check2>/dev/null| Use case | Command |
|---|---|
| Read-only analysis | |
| Speed-first interactive loop (Spark) | add |
| Apply local edits | add |
| Network / broad access | add |
| Resume session | |
Create a temp file for output before running: . Read the result from after completion.
CODEX_OUT=$(mktemp /tmp/codex-out.XXXXXX)$CODEX_OUTRun with Bash . Monitor via with — do NOT use commands to poll. Read the file for the final answer.
run_in_background: trueTaskOutputblock: true, timeout: 600000sleep-o项目默认配置在中。始终包含和参数。仅当用户明确要求,或任务明显符合上述Spark速度优先标准时,才覆盖模型配置。
.codex/config.toml--skip-git-repo-check2>/dev/null| 使用场景 | 命令 |
|---|---|
| 只读分析 | |
| 速度优先交互式循环(Spark) | 添加 |
| 应用本地编辑 | 添加 |
| 网络/广泛访问 | 添加 |
| 恢复会话 | |
运行前创建一个临时文件用于输出:。运行完成后从中读取结果。
CODEX_OUT=$(mktemp /tmp/codex-out.XXXXXX)$CODEX_OUT使用Bash运行,设置。通过进行监控,设置 — 请勿使用命令轮询。读取参数指定的文件获取最终结果。
run_in_background: trueTaskOutputblock: true, timeout: 600000sleep-oResuming
恢复会话
Don't pass model/effort/sandbox flags when resuming — original session settings carry over. is safe to include.
-o恢复会话时不要传递模型/推理强度/沙箱相关参数 — 原始会话的设置会自动沿用。包含参数是安全的。
-oConventions
约定
This is a Go project. Use , , in prompts. Codex workers don't receive CLAUDE.md or hooks, so project conventions must be explicit.
go testgo buildgo vet这是一个Go项目。在提示词中使用、、命令。Codex worker不会接收CLAUDE.md或hooks,因此项目约定必须明确。
go testgo buildgo vetPost-Execution Verification
执行后验证
Always verify Codex output via — never trust the worker's self-reported file list. Codex workers may make out-of-scope changes (deleting files, reverting unrelated code, removing test functions). The completion promise may list only intended files while omitting destructive side effects.
git diff --statWhen other work exists in the same codebase, include explicit "DO NOT modify or delete" file lists in the prompt. The positive instruction ("only touch these files") is insufficient — Codex interprets "clean up" broadly.
Per [[principles/prove-it-works]]: trust artifacts, not self-reports.
始终通过验证Codex的输出 — 切勿信任worker自行报告的文件列表。Codex worker可能会做出超出范围的更改(删除文件、还原不相关的代码、移除测试函数)。完成承诺可能仅列出预期修改的文件,而遗漏破坏性的副作用。
git diff --stat当同一代码库中存在其他工作时,请在提示词中包含明确的“请勿修改或删除”的文件列表。正向指令(“仅修改这些文件”)是不够的 — Codex会宽泛地解释“清理”的含义。
根据[[principles/prove-it-works]]:信任产物,而非自我报告。
Worktree Usage
工作树使用
With , the worktree has its own git index. may symlink to — use paths for git operations.
-C <worktree-dir>.claude/.agents/.agents/使用时,工作树有自己的git索引。可能符号链接到 — 执行git操作时请使用路径。
-C <worktree-dir>.claude/.agents/.agents/