codex
БесплатноЗапускает вложенные скриптыНе проверенUse when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing
от majiayu000★ 301 звезда на GitHubОб этом скилле
Codex Skill Guide
Operating Contract
- Run
codex --versionandcodex exec --helpfirst. Stop if Codex is unavailable, and only use flags shown by the installed CLI. - If the user did not specify a model or reasoning effort, use the installed default. Do not hardcode a model list; model names and supported reasoning levels change over time.
- Select the smallest sandbox needed:
--sandbox read-onlyfor inspection and--sandbox workspace-writefor requested local edits. Network access, extra writable roots, and broader modes are separate grants. - Assemble the command from supported options such as:
-m, --model <MODEL>--config model_reasoning_effort="<LEVEL>"--sandbox <read-only|workspace-write|danger-full-access>-C, --cd <DIR>--add-dir <DIR>--json--ephemeral--skip-git-repo-check--dangerously-bypass-approvals-and-sandbox
- Do not use
--skip-git-repo-checkby default. Use it only when the user explicitly asks to run outside a Git repository or has approved that boundary bypass for this command. - Do not use deprecated compatibility shortcuts such as
--full-auto; use the explicit sandbox shown by current help. - Preserve stderr. Keep it out of the parent context by writing it to a bounded artifact and reading only the exit status, short tail, or targeted diagnostics. Never redirect it to
/dev/null. - For automation, batch work, cost investigation, or any run that needs measured usage, add
--jsonand save stdout as JSONL. Read the final usage event and report input, cached input, output, and reasoning tokens when present. - Enforce a hard wall-clock timeout with the supervising runtime. Stop on non-zero exit or timeout; do not automatically retry an expensive run.
- When continuing a genuinely conversational task, use
codex exec resume --lastvia stdin. Do not resume a session for homogeneous record batches; start a fresh bounded--ephemeralrun per tranche so accumulated history is not resent on every model call.
Safe Prompt Passing
Do not build Codex commands with echo "user prompt" | ...; user text can contain quotes, substitutions, or newlines. Prefer a quoted heredoc so the shell never reinterprets prompt contents:
(
for required_command in python3 head wc mkfifo; do
command -v "$required_command" >/dev/null 2>&1 || {
printf 'Missing required command: %s\n' "$required_command" >&2
exit 127
}
done
codex_skill_dir=${CODEX_SKILL_DIR:-$HOME/.claude/skills/codex}
[ -f "$codex_skill_dir/scripts/run_with_timeout.py" ] || {
printf 'Missing Codex timeout helper: %s\n' \
"$codex_skill_dir/scripts/run_with_timeout.py" >&2
exit 1
}
codex_artifacts=$(mktemp -d) || exit 1
codex_stderr_max_bytes=1048576
codex_stderr_pipe="$codex_artifacts/stderr.pipe"
mkfifo "$codex_stderr_pipe" || exit 1
head -c "$codex_stderr_max_bytes" <"$codex_stderr_pipe" \
>"$codex_artifacts/stderr.log" &
codex_stderr_limiter_pid=$!
if python3 "$codex_skill_dir/scripts/run_with_timeout.py" 1800 \
codex exec resume --last \
2>"$codex_stderr_pipe" <<'EOF'
Your follow-up prompt goes here.
EOF
then
codex_status=0
else
codex_status=$?
fi
stderr_limiter_status=0
wait "$codex_stderr_limiter_pid" || stderr_limiter_status=$?
rm -- "$codex_stderr_pipe" || exit 1
artifact_status=0
stderr_bytes=$(wc -c <"$codex_artifacts/stderr.log") || exit 1
if [ "$stderr_bytes" -ge "$codex_stderr_max_bytes" ]; then
printf 'Codex stderr reached its %s-byte artifact limit\n' \
"$codex_stderr_max_bytes" >&2
artifact_status=125
fi
if [ "$stderr_limiter_status" -ne 0 ]; then artifact_status=$stderr_limiter_status; fi
tail -c 4000 -- "$codex_artifacts/stderr.log"
tail_status=$?
if [ "$codex_status" -eq 0 ] && [ "$artifact_status" -eq 0 ] && [ "$tail_status" -eq 0 ]; then
rm -R -- "$codex_artifacts" || exit $?
else
printf 'Codex artifacts retained: %s\n' "$codex_artifacts" >&2
fi
if [ "$codex_status" -ne 0 ]; then exit "$codex_status"; fi
if [ "$artifact_status" -ne 0 ]; then exit "$artifact_status"; fi
exit "$tail_status"
)
Quick Reference
| Use case | Sandbox mode | Key flags |
|---|---|---|
| Read-only review or analysis | read-only |
--sandbox read-only |
| Apply local edits | workspace-write |
--sandbox workspace-write |
| Apply edits that need network access | workspace-write plus config |
--sandbox workspace-write -c 'sandbox_workspace_write.network_access=true' after approval |
| Machine-readable usage | Match task | --json; save JSONL stdout and stderr separately |
| Independent batch tranche | Match task | --ephemeral --json; do not resume the previous tranche |
| Permit extra write scope | Prefer --add-dir |
Ask before adding extra writable directories |
| Permit broad file access | danger-full-access only after approval |
Ask before adding --sandbox danger-full-access |
| Resume a conversational task | Inherited from original | codex exec resume --last via quoted hered |
Установить codex в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл codex?
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing
Как установить скилл codex?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл codex запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic