- name
- codex
- description
- - 当用户明确要求直接操作 Codex CLI 作为后台代理(自选 sandbox、codex review、apply、resume 等原生命令,或用 git worktree 并行布置多个 worker)做代码分析、编辑、审查时使用。普通的“让 Codex 或 GPT-6 写代码、调研、review”派单走 agent-fleet(fleet code);图片生成与网站视觉素材走 imagegen。
Codex 后台代理
用 Codex CLI 承接用户指定的代码分析、编辑、审查或并行代理任务。图片生成的当前流程见 imagegen/SKILL.md;旧版操作与实验记录保存在 references/image-experiments.md。
路由前提:按全局 CLAUDE.md §2,编码、修 bug、调研与 review 默认用 fleet code(gpt-6.1-sol,见 agent-fleet),不手写 codex exec。本 Skill 只在用户明确要求直接操作 Codex CLI(自选 sandbox、codex review/apply/resume 等原生子命令、并行 worker 的 worktree 布置)时使用;简单派单不要先读本文件。
Core Principle
Never block the main conversation on a codex exec call. Always launch via Bash with run_in_background: true. The only exception is a trivial codex --version health check.
Launching a Codex Sub-Agent
- Pick reasoning effort + sandbox from context — do not interrupt the user with
AskUserQuestionunless they explicitly ask to be prompted. Model isgpt-6.1-sol(the default in~/.codex/config.toml; pass-monly when the user names another model in the current request). Defaults:- Reasoning effort:
medium;lowfor single-file edits with clear boundaries. Never escalate tohigh/xhighon your own (global §2); only when the user asks for it explicitly - Sandbox:
read-onlyunless the task clearly needs edits (workspace-write) or network (danger-full-access)
- Reasoning effort:
- Write the prompt to a temp file when it's non-trivial (multi-line, contains quotes, long context). Pipe it via stdin so quoting never breaks:
cat /tmp/codex-prompt-<tag>.md | codex exec --skip-git-repo-check \ --config model_reasoning_effort="medium" \ --sandbox read-only \ -C <workdir> 2>/dev/null - Launch with . Record the returned shell id and a short tag (e.g. , ) so you can reference it later.