一键导入
codex
Run OpenAI Codex CLI as a subagent for second opinions, code reviews, and questions. Use when you want a different AI model's perspective.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run OpenAI Codex CLI as a subagent for second opinions, code reviews, and questions. Use when you want a different AI model's perspective.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Investigate GitHub pull request review comments, determine whether each comment is valid, propose fixes, and document the analysis in an active samocode session. Use when the user asks to analyze PR comments, run /prcomments, investigate review feedback, or triage pull request comments.
Run Anthropic Claude CLI as a subagent for second opinions, code reviews, and questions. Use from a Codex (or other) session when you want Claude's perspective.
Create GitHub PR review comments from review findings. Use after running a code review to post findings as line-bound comments.
Execute implementation tasks with different approaches (single, dual-agent, plan-based).
Create implementation plans with phase management.
Final PR readiness gate after fix loops, merges, and manual debugging.
| name | codex |
| description | Run OpenAI Codex CLI as a subagent for second opinions, code reviews, and questions. Use when you want a different AI model's perspective. |
Run OpenAI Codex CLI (GPT-5.2) for second opinions and external reviews.
Before using Codex, verify it's installed:
which codex >/dev/null 2>&1 || echo "CODEX_NOT_INSTALLED"
If not installed, inform the user: "Codex CLI is not installed. Skipping Codex review."
OUTPUT_FILE=$(mktemp)
codex exec \
--skip-git-repo-check \
--dangerously-bypass-approvals-and-sandbox \
-o "$OUTPUT_FILE" \
"$PROMPT" </dev/null 2>/tmp/codex_stderr.log
cat "$OUTPUT_FILE"
rm "$OUTPUT_FILE"
| Flag | Purpose |
|---|---|
exec | Non-interactive mode |
--skip-git-repo-check | Run outside git repositories |
--dangerously-bypass-approvals-and-sandbox | No prompts, no sandbox restrictions |
-o <file> | Capture clean output to file |
</dev/null | Required. Close stdin — without it codex blocks on "Reading additional input from stdin..." and the -o file comes back empty (exit 0, zero bytes). Bites hardest in non-interactive / background Bash where there's no TTY. |
2>/tmp/codex_stderr.log | Send stderr to a file, not 2>/dev/null — if codex hangs or errors you need to see the stdin/auth message. Inspect the log when the output file is empty. |
Codex can take several minutes for complex prompts. Use 15 minute timeout:
timeout 900 codex exec --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox -o "$OUTPUT_FILE" "$PROMPT" </dev/null 2>/tmp/codex_stderr.log
OUTPUT_FILE=$(mktemp)
codex exec --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox -o "$OUTPUT_FILE" \
"What are the tradeoffs between Redis and Memcached for session storage?" 2>/dev/null
cat "$OUTPUT_FILE"
rm "$OUTPUT_FILE"
DIFF=$(git diff main...HEAD)
OUTPUT_FILE=$(mktemp)
codex exec --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox -o "$OUTPUT_FILE" \
"Review this diff for issues:
$DIFF
List concerns with severity (blocking/important/nice-to-have)." 2>/dev/null
cat "$OUTPUT_FILE"
rm "$OUTPUT_FILE"
OUTPUT_FILE=$(mktemp)
codex exec --dangerously-bypass-approvals-and-sandbox -C /path/to/repo -o "$OUTPUT_FILE" \
"Analyze the architecture of this codebase" 2>/dev/null
cat "$OUTPUT_FILE"
rm "$OUTPUT_FILE"
Codex has access to gh CLI. Pass the PR URL and let it fetch the diff:
OUTPUT_FILE=$(mktemp)
timeout 900 codex exec --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox -o "$OUTPUT_FILE" \
"Review this PR: https://github.com/owner/repo/pull/123
Use gh CLI to get the diff and review for issues." 2>/dev/null
cat "$OUTPUT_FILE"
rm "$OUTPUT_FILE"
/dev/null. Even with a prompt passed as an argument, codex exec reads stdin; in a non-interactive/background Bash call with no TTY it blocks ("Reading additional input from stdin...") and the -o output file ends up empty with exit code 0. The simpler usage examples above omit </dev/null — add it to every invocation.