content/skills/ai-llm-skills/codex/SKILL.md
OpenAI Codex CLI wrapper — five modes: `codex review` for PR/diff/commit review, adversarial challenge for edge cases and security, consult for second opinions on code or architecture, live research with citations via `--search`, and apply/fix for approved code changes. Use when the user invokes /codex or explicitly wants the local Codex CLI.
npx skillsauth add bahayonghang/my-claude-code-settings codexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run Codex CLI for $ARGUMENTS.
codex reviewcodex execgpt-5.4 (referred to as $MODEL in recipes below)-c model_reasoning_effort=xhigh-c model_reasoning_effort=high--search--full-auto before --dangerously-bypass-approvals-and-sandboxcodex exec resume <session_id> "<follow-up>"command -v codexGet-Command codexnpm install -g @openai/codexcodex login status
codex loginTreat current local CLI help as the source of truth before constructing commands:
codex --help, codex exec --help, codex review --help, and codex resume --help when a recipe looks stale.--reasoning flag. Current Codex CLI exposes reasoning through -c model_reasoning_effort=<level>.codex review accepts either a review target flag (--uncommitted, --base, --commit) or a custom prompt, not both in the same command.codex review to codex exec with an explicit prompt over the repo or files.codex sessions list or codex --print-config; prefer codex resume --all, the session id printed by codex exec, or reading ~/.codex/config.toml directly.Keep danger-full-access and --dangerously-bypass-approvals-and-sandbox
available, but never use them by default.
Before using either bypass path:
read-only, workspace-write, or --full-auto first.Use this confirmation shape:
Codex needs <danger-full-access | full bypass> for this run to <reason>.
This would allow <scope>. Proceed?
This skill wraps the local Codex CLI (codex command). It is distinct from the
OMC orchestration layer's ask_codex MCP tool, which delegates to Codex as an
agent role (architect, planner, critic, etc.) via the MCP protocol.
codex review, codex exec, or Codex CLI featuresask_codex: orchestrator delegates analysis/review to Codex as a reasoning backendIf the user says "ask codex about X" without specifying CLI usage, defer to OMC's
MCP delegation. This skill activates on /codex invocation or explicit CLI intent.
If $ARGUMENTS is empty, ask the user for the task description.
Choose one primary mode:
review: PR, diff, branch, commit, uncommitted changes, merge readiness, or review-style second opinion. Prefer codex review.challenge: adversarial probing for edge cases, race conditions, security issues, or failure modes. Use codex exec with a read-only posture and an attack-minded prompt.consult: second opinion on a file, module, architecture decision, migration, or plan. Use codex exec without write access.research: latest docs, current product comparisons, citations, release notes, or vendor landscape. Use top-level --search with codex exec.apply/fix: generation, refactoring, debugging, or fixing approved findings. Only use when the user explicitly wants Codex to make changes.resume: follow-up on a previous non-interactive session via codex exec resume.If a task spans multiple modes, do them in this order:
review or challengeconsultresearchapply/fix| Keywords in $ARGUMENTS | → Mode |
|--------------------------------------------------|-------------|
| review, PR, diff, merge, branch, commit, changes | review |
| challenge, break, attack, adversarial, scary | challenge |
| consult, second opinion, what do you think, @file| consult |
| research, compare, latest, docs, citations | research |
| fix, apply, refactor, implement, write, generate | apply/fix |
| resume, continue, follow-up, session | resume |
If ambiguous, prefer read-only modes (review/challenge/consult) over write modes (apply/fix).
Before any Codex invocation, emit this block exactly once:
Planned AI Run
- Tool: Codex CLI
- Mode: <review | challenge | consult | research | apply/fix | resume>
- Model: <literal model id>
- Runtime: <model_reasoning_effort=xhigh | model_reasoning_effort=high | model_reasoning_effort=<level>; sandbox=<mode>>
- Search: <off | live>
- Access: <review-safe | workspace-write | confirmed danger-full-access | confirmed bypassed sandbox/approvals>
- Workdir: <path or current>
Rules:
codex review, pass model or sandbox overrides as top-level Codex options before the subcommand, for example codex -m $MODEL -s read-only review ....-c model_reasoning_effort=<level> in the final command. Never invent a --reasoning flag.codex review target selectors with a prompt. Use codex exec when the user needs both a fixed scope and custom focus.Search: live only for runs started with top-level --search.review, challenge, and consult should default to read-only or another review-safe posture.apply/fix should default to workspace-write / --full-auto.danger-full-access or full bypass only after explicit confirmation for that exact run.-C is omitted, show current for Workdir.| Mode | Command | Default flags |
|-----------|----------------------------------|----------------------------|
| Review | codex review | -m $MODEL -s read-only |
| Challenge | codex exec | -s read-only -c model_reasoning_effort=xhigh |
| Consult | codex exec | -s read-only -c model_reasoning_effort=xhigh |
| Research | codex --search exec | --skip-git-repo-check -c model_reasoning_effort=high |
| Apply/Fix | codex exec | --full-auto -c model_reasoning_effort=xhigh |
| Resume | codex exec resume <id> "<msg>" | inherits previous session |
For full command recipes, prompt templates, and shell-quoting notes, read $SKILL_DIR/references/REFERENCE.md.
Read $SKILL_DIR/references/REFERENCE.md for:
Codex runs commands inside a sandbox that restricts file system access. This is the single most common source of "Permission denied" errors, especially for git operations.
Even in workspace-write mode, Codex force-mounts .git/ as read-only after
writable roots are applied. Any git command that writes metadata — fetch, commit,
pull, push, checkout, merge, rebase, stash — will fail with:
error: cannot open '.git/FETCH_HEAD': Permission denied
| Sandbox mode | git read | git write | When to use |
|--------------|----------|-----------|-------------|
| read-only (default) | Yes | No | review, challenge, consult |
| workspace-write | Yes | No (.git/ stays read-only) | editing files only |
| --full-auto | Yes | No (same sandbox; sets -a on-request + -s workspace-write) | low-friction file edits |
| danger-full-access | Yes | Yes | apply/fix that needs git write |
| --dangerously-bypass-approvals-and-sandbox | Yes | Yes | last resort, unrestricted |
For any mode that needs git write access (commit, push, pull), you must use
danger-full-access or --dangerously-bypass-approvals-and-sandbox.
Do not switch to either mode until the user has explicitly confirmed the bypassed run.
-s read-only (default, safe)--skip-git-repo-check (no repo context needed)--full-auto (low-friction, sandboxed)danger-full-access after confirmation; use full bypass only as a confirmed last resortWindows:
bash.exe) fails inside Windows sandbox with "couldn't create signal pipe, Win32 error 5" (issue #15016).# ~/.codex/config.toml
[windows]
sandbox = "off"
Linux (bubblewrap):
.git/ and resolved gitdir: targets are force-mounted read-only after writable
roots, and --add-dir cannot override this (issue #14338).unprivileged_userns restriction can prevent the sandbox from starting
entirely (issue #9273).macOS:
git config --local core.fsmonitor false
To avoid the trust prompt on every run, add the project to config.toml:
# ~/.codex/config.toml
[projects."/path/to/your/project"]
trust_level = "trusted"
Use the built-in sandbox diagnostic to see what is being blocked:
codex sandbox <platform> --log-denials <command>
# Example:
codex sandbox macos --log-denials git diff
codex sandbox linux --log-denials git commit -m "test"
For full sandbox configuration details, read $SKILL_DIR/references/REFERENCE.md.
codex: command not found: tell the user to install @openai/codexcodex login status fails or shows no auth: tell the user to run codex login--search and an explicit request for URLs.git/: switch to danger-full-access or --dangerously-bypass-approvals-and-sandbox; see the Sandbox section abovegit config --local core.fsmonitor falsekernel.apparmor_restrict_unprivileged_userns sysctlcodex exec is the preferred general non-interactive entrypoint.codex review is the preferred review entrypoint for branch, diff, commit, and uncommitted review.~/.codex/config.toml and current CLI help.development
Use only when the user explicitly asks for swarm, subagents, parallel agents, dynamic workflow, multi-agent orchestration, 多智能体编排, or when the task truly needs coordinated research plus implementation plus review plus verification packets. Do not use for ordinary code review, planning-only work, single-line bugfixes, routine audits, or migrations unless orchestration is requested or at least two independent workflow dimensions are present.
development
Run a code quality review focused on maintainability, structure, abstraction quality, file growth, branching complexity, boundary cleanliness, and refactoring opportunities. Use when the user asks for code quality review, code review, maintainability review, architecture quality review, PR code quality feedback, 代码质量审查, 代码质量 review, 可维护性审查, 架构质量审查, or review comments about code structure. Do not use for pure security review, formatting-only review, performance profiling, or implementation tasks unless the user also asks for a code quality review.
development
Plan-first brainstorming workflow that turns an idea into an approved Markdown implementation plan by default. Use when the user wants to brainstorm, design, scope, or plan a feature/spec before implementation. Spark explores project context, asks only blocking questions, writes the plan under the project root's .plannings/YYYY-MM-DD-feature-slug.md path, self-reviews it, and waits for user approval. Create an HTML or visual plan/spec only when the user explicitly asks for HTML, browser-viewable, or visual output; save the paired .html beside the Markdown plan.
development
Run a code quality review focused on maintainability, structure, abstraction quality, file growth, branching complexity, boundary cleanliness, and refactoring opportunities. Use when the user asks for code quality review, code review, maintainability review, architecture quality review, PR code quality feedback, 代码质量审查, 代码质量 review, 可维护性审查, 架构质量审查, or review comments about code structure. Do not use for pure security review, formatting-only review, performance profiling, or implementation tasks unless the user also asks for a code quality review.