Critical rules - Use the bundled shell script rather than calling CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing , , spaces, or special characters (e.g. ). Without quotes, zsh treats as a glob pattern and fails with "no matches found". - Keep the task prompt to the goal and constraints, not t…

\\nPriority files (read these first before making changes):'\n for ref in \"${file_refs[@]}\"; do\n resolved=\"$(resolve_file_ref \"$workspace\" \"$ref\")\"\n [[ -z \"$resolved\" ]] && continue\n exists_tag=\"missing\"\n [[ -e \"$resolved\" ]] && exists_tag=\"exists\"\n file_block+=

Critical rules - Use the bundled shell script rather than calling CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing , , spaces, or special characters (e.g. ). Without quotes, zsh treats as a glob pattern and fails with "no matches found". - Keep the task prompt to the goal and constraints, not t…

\\n- '\"${resolved} (${exists_tag})\"\n done\nfi\n\n# --- Build prompt ---\n\nprompt=\"$task_text\"\nif [[ -n \"$file_block\" ]]; then\n prompt+=

Critical rules - Use the bundled shell script rather than calling CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing , , spaces, or special characters (e.g. ). Without quotes, zsh treats as a glob pattern and fails with "no matches found". - Keep the task prompt to the goal and constraints, not t…

\\n'\"$file_block\"\nfi\n\n# --- Determine reasoning effort ---\n\nif [[ -z \"$reasoning_effort\" ]]; then\n reasoning_effort=\"medium\"\nfi\n\n# --- Build codex command ---\n\nif [[ -n \"$session_id\" ]]; then\n # Resume mode: continue a previous session\n # Note: resume only supports -c/--config and --last flags (no --json, --sandbox, etc.)\n cmd=(codex exec resume -c \"model_reasoning_effort=\\\"$reasoning_effort\\\"\" -c \"skip_git_repo_check=true\")\n cmd+=(\"$session_id\")\nelse\n # New session\n cmd=(codex exec --cd \"$workspace\" --skip-git-repo-check --json -c \"model_reasoning_effort=\\\"$reasoning_effort\\\"\")\n if [[ \"$read_only\" == true ]]; then\n cmd+=(--sandbox read-only)\n elif [[ -n \"$sandbox_mode\" ]]; then\n cmd+=(--sandbox \"$sandbox_mode\")\n elif [[ \"$full_auto\" == true ]]; then\n cmd+=(--full-auto)\n fi\n [[ -n \"$model\" ]] && cmd+=(-m \"$model\")\nfi\n\n# --- Progress watcher function ---\n\nprint_progress() {\n local line=\"$1\"\n local item_type cmd_str preview\n # Fast string checks before calling jq\n case \"$line\" in\n *'\"item.started\"'*'\"command_execution\"'*)\n cmd_str=$(printf '%s' \"$line\" | jq -r '.item.command // empty' 2>/dev/null | sed 's|^/bin/zsh -lc ||; s|^/bin/bash -c ||' | cut -c1-100)\n [[ -n \"$cmd_str\" ]] && echo \"[codex] > $cmd_str\" >&2\n ;;\n *'\"item.completed\"'*'\"agent_message\"'*)\n preview=$(printf '%s' \"$line\" | jq -r '.item.text // empty' 2>/dev/null | head -1 | cut -c1-120)\n [[ -n \"$preview\" ]] && echo \"[codex] $preview\" >&2\n ;;\n esac\n}\n\n# --- Execute and capture output ---\n\nstderr_file=\"$(mktemp)\"\njson_file=\"$(mktemp)\"\ntext_file=\"$(mktemp)\"\nprompt_file=\"$(mktemp)\"\ntrap 'rm -f \"$stderr_file\" \"$json_file\" \"$text_file\" \"$prompt_file\"' EXIT\n\n# Write prompt to a temp file and pipe from there to avoid shell argument\n# length issues and encoding problems with very long or multi-byte prompts.\nprintf \"%s\" \"$prompt\" > \"$prompt_file\"\n\n# Run codex and capture its output.\n# We prefer `script` to allocate a pseudo-TTY, which forces codex to line-buffer\n# its output so progress events arrive in real time. However, `script` requires a\n# real controlling terminal and fails with \"tcgetattr/ioctl: Operation not supported\n# on socket\" in socket-based environments (e.g. some Claude Code sandboxes). We\n# detect this upfront and fall back to direct execution — output may arrive all at\n# once at the end, but the task still completes correctly.\nrun_codex() {\n # BSD script (macOS): script [-q] [file [command...]]\n # util-linux script (Linux): script [-q] -c \u003ccommand> [file]\n # Probe the local variant and use matching syntax for PTY allocation.\n # Falls back to direct execution if neither probe succeeds (e.g. socket stdin).\n local os\n os=\"$(uname -s)\"\n if [[ \"$os\" == \"Darwin\" ]]; then\n if script -q /dev/null true >/dev/null 2>&1; then\n script -q /dev/null /bin/bash -c \\\n \"cd $(printf '%q' \"$workspace\") && $(printf '%q ' \"${cmd[@]}\") \u003c $(printf '%q' \"$prompt_file\") 2>$(printf '%q' \"$stderr_file\")\"\n return\n fi\n else\n if script -q -c \"true\" /dev/null >/dev/null 2>&1; then\n script -q -c \\\n \"cd $(printf '%q' \"$workspace\") && $(printf '%q ' \"${cmd[@]}\") \u003c $(printf '%q' \"$prompt_file\") 2>$(printf '%q' \"$stderr_file\")\" \\\n /dev/null\n return\n fi\n fi\n # Fallback: direct execution (no PTY; progress events arrive in batch)\n (cd \"$workspace\" && \"${cmd[@]}\" \u003c \"$prompt_file\" 2>\"$stderr_file\")\n}\n\nif [[ -n \"$session_id\" ]]; then\n # Resume mode: plain text output (no JSON support)\n run_codex | while IFS= read -r line; do\n # Strip terminal artifacts (carriage return, ^D EOF marker)\n cleaned=\"${line//

Critical rules - Use the bundled shell script rather than calling CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing , , spaces, or special characters (e.g. ). Without quotes, zsh treats as a glob pattern and fails with "no matches found". - Keep the task prompt to the goal and constraints, not t…

\\r'/}\"\n cleaned=\"${cleaned//

Critical rules - Use the bundled shell script rather than calling CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing , , spaces, or special characters (e.g. ). Without quotes, zsh treats as a glob pattern and fails with "no matches found". - Keep the task prompt to the goal and constraints, not t…

\\004'/}\"\n [[ -z \"$cleaned\" ]] && continue\n # Write to text_file for later output\n printf '%s\\n' \"$cleaned\" >> \"$text_file\"\n # Print progress\n preview=\"${cleaned:0:120}\"\n echo \"[codex] $preview\" >&2\n done\nelse\n # New session: JSON output\n run_codex | while IFS= read -r line; do\n # Strip terminal artifacts (carriage return, ^D EOF marker)\n cleaned=\"${line//

Critical rules - Use the bundled shell script rather than calling CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing , , spaces, or special characters (e.g. ). Without quotes, zsh treats as a glob pattern and fails with "no matches found". - Keep the task prompt to the goal and constraints, not t…

\\r'/}\"\n cleaned=\"${cleaned//

Critical rules - Use the bundled shell script rather than calling CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing , , spaces, or special characters (e.g. ). Without quotes, zsh treats as a glob pattern and fails with "no matches found". - Keep the task prompt to the goal and constraints, not t…

\\004'/}\"\n [[ -z \"$cleaned\" ]] && continue\n # Only process JSON lines (must start with '{')\n [[ \"$cleaned\" != \\{* ]] && continue\n # Write to json_file for later parsing\n printf '%s\\n' \"$cleaned\" >> \"$json_file\"\n # Only parse progress-relevant events (fast string check before jq)\n case \"$cleaned\" in\n *'\"item.started\"'*|*'\"item.completed\"'*) print_progress \"$cleaned\" ;;\n esac\n done\nfi\n\nif [[ -s \"$stderr_file\" ]] && grep -q '\\[ERROR\\]' \"$stderr_file\" 2>/dev/null; then\n echo \"[ERROR] Codex command failed\" >&2\n cat \"$stderr_file\" >&2\n exit 1\nfi\n\nif [[ -s \"$stderr_file\" ]]; then\n cat \"$stderr_file\" >&2\nfi\n\n# --- Process output based on mode ---\n\nif [[ -n \"$session_id\" ]]; then\n # Resume mode: use plain text output\n thread_id=\"$session_id\"\n if [[ -s \"$text_file\" ]]; then\n cat \"$text_file\" > \"$output_path\"\n else\n echo \"(no response from codex)\" > \"$output_path\"\n fi\nelse\n # New session: Extract thread_id and all messages from JSON stream\n thread_id=\"$(jq -r 'select(.type == \"thread.started\") | .thread_id' \u003c \"$json_file\" | head -1)\"\n\n # Collect all completed items: file changes, tool calls, and agent messages.\n # This gives full visibility into what codex actually did, not just the last message.\n {\n # 1. Show command executions — skip pure file-reading/searching commands.\n # Codex explores the codebase heavily (sed/cat/nl/rg/grep/awk/wc/find/ls), but\n # those reads produce no signal for Claude Code — it can read files directly if needed.\n # Keep build, test, git, and mutation commands that reflect actual work done.\n #\n # Note: zsh wraps commands in quotes, so after stripping the shell prefix the\n # command may start with \" or ' — the regex accounts for this with [\\\"']?.\n jq -r '\n select(.type == \"item.completed\" and .item.type == \"command_execution\")\n | .item\n | ((.command // \"\") | gsub(\"^/bin/zsh -lc \"; \"\") | gsub(\"^/bin/bash -c \"; \"\")) as $cmd\n | select($cmd | test(\"^[\\\"'\"'\"']?(sed |cat |head |tail |nl |rg |grep |awk |wc |find |ls )\") | not)\n | \"### Shell: `\" + ($cmd[0:200]) + \"`\\n\" + (.aggregated_output // \"\" | .[0:500])\n ' \u003c \"$json_file\" 2>/dev/null\n\n # 2. Show file write/patch operations (tool_call style, if any)\n jq -r '\n select(.type == \"item.completed\" and .item.type == \"tool_call\")\n | .item\n | if .name == \"write_file\" then\n \"### File written: \" + (.arguments | fromjson | .path // \"unknown\")\n elif .name == \"patch_file\" then\n \"### File patched: \" + (.arguments | fromjson | .path // \"unknown\")\n elif .name == \"shell\" then\n \"### Shell: `\" + (.arguments | fromjson | .command // \"unknown\")[0:200] + \"`\\n\" + (.output // \"\" | .[0:500])\n else empty\n end\n ' \u003c \"$json_file\" 2>/dev/null\n\n # 3. Show all agent messages. Short messages (lint results, \"tests failed\",\n # \"no changes needed\") carry high signal and must not be dropped by a length\n # threshold. In practice, Codex tends to emit a small number of large blocks\n # rather than many tiny fragments, so this produces clean output without filtering.\n jq -r '\n select(.type == \"item.completed\" and .item.type == \"agent_message\") | .item.text\n ' \u003c \"$json_file\" 2>/dev/null\n } > \"$output_path\"\n\n # If nothing was captured, write a fallback\n if [[ ! -s \"$output_path\" ]]; then\n echo \"(no response from codex)\" > \"$output_path\"\n fi\nfi\n\n# --- Output results ---\n\nif [[ -n \"$thread_id\" ]]; then\n echo \"session_id=$thread_id\"\nfi\necho \"output_path=$output_path\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":12526,"content_sha256":"4a6a374c741624597ea02e78c23575f70948c1c3cb76b51fdefa7fbd2198284d"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":2},"content":[{"text":"Critical rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use the bundled shell script rather than calling ","type":"text"},{"text":"codex","type":"text","marks":[{"type":"code_inline"}]},{"text":" CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Quote file paths containing ","type":"text"},{"text":"[","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"]","type":"text","marks":[{"type":"code_inline"}]},{"text":", spaces, or special characters (e.g. ","type":"text"},{"text":"--file \"src/app/[locale]/page.tsx\"","type":"text","marks":[{"type":"code_inline"}]},{"text":"). Without quotes, zsh treats ","type":"text"},{"text":"[...]","type":"text","marks":[{"type":"code_inline"}]},{"text":" as a glob pattern and fails with \"no matches found\".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Keep the task prompt to the goal and constraints, not the implementation steps.","type":"text","marks":[{"type":"strong"}]},{"text":" Aim for under ~500 words. Codex has the same tools as Claude and will explore the codebase itself — spelling out every file to change or every step tends to constrain it rather than help.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Don't paste file contents into the prompt.","type":"text","marks":[{"type":"strong"}]},{"text":" Use ","type":"text"},{"text":"--file","type":"text","marks":[{"type":"code_inline"}]},{"text":" to point Codex to key files — it reads them directly at their current version. Pasting contents wastes tokens and risks passing stale code.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Don't mention this skill or its configuration in the prompt.","type":"text","marks":[{"type":"strong"}]},{"text":" Codex doesn't need to know about it.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"How to call the script","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Linux/macOS (bash)","type":"text"}]},{"type":"paragraph","content":[{"text":"The script path is:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"~/.claude/skills/codex/scripts/ask_codex.sh","type":"text"}]},{"type":"paragraph","content":[{"text":"Minimal invocation:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"~/.claude/skills/codex/scripts/ask_codex.sh \"Your request in natural language\"","type":"text"}]},{"type":"paragraph","content":[{"text":"With file context:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"~/.claude/skills/codex/scripts/ask_codex.sh \"Refactor these components to use the new API\" \\\n --file src/components/UserList.tsx \\\n --file src/components/UserDetail.tsx","type":"text"}]},{"type":"paragraph","content":[{"text":"Multi-turn conversation (continue a previous session):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"~/.claude/skills/codex/scripts/ask_codex.sh \"Also add retry logic with exponential backoff\" \\\n --session \u003csession_id from previous run>","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Windows (PowerShell)","type":"text"}]},{"type":"paragraph","content":[{"text":"The script path is:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"~/.claude/skills/codex/scripts/ask_codex.ps1","type":"text"}]},{"type":"paragraph","content":[{"text":"Minimal invocation:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"powershell"},"content":[{"text":"& ~/.claude/skills/codex/scripts/ask_codex.ps1 \"Your request in natural language\"","type":"text"}]},{"type":"paragraph","content":[{"text":"With file context:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"powershell"},"content":[{"text":"& ~/.claude/skills/codex/scripts/ask_codex.ps1 \"Refactor these components to use the new API\" `\n -f src/components/UserList.tsx `\n -f src/components/UserDetail.tsx","type":"text"}]},{"type":"paragraph","content":[{"text":"Multi-turn conversation (continue a previous session):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"powershell"},"content":[{"text":"& ~/.claude/skills/codex/scripts/ask_codex.ps1 \"Also add retry logic with exponential backoff\" `\n -Session \u003csession_id from previous run>","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Output format","type":"text"}]},{"type":"paragraph","content":[{"text":"The script prints on success:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"session_id=\u003cthread_id>\noutput_path=\u003cpath to markdown file>","type":"text"}]},{"type":"paragraph","content":[{"text":"Read the file at ","type":"text"},{"text":"output_path","type":"text","marks":[{"type":"code_inline"}]},{"text":" to get CodeX's response. Save ","type":"text"},{"text":"session_id","type":"text","marks":[{"type":"code_inline"}]},{"text":" if you plan follow-up calls.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Workflow","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Understand the problem: read the key files to grasp what's broken or needed. Focus on being able to describe the problem and goal clearly — you don't need to design the full solution or enumerate every affected file. Codex will explore the codebase itself.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run the script with a focused task description: the goal, key constraints, and any non-obvious context. For discussion or analysis without changes, use ","type":"text"},{"text":"--read-only","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pass 1-4 entry-point files with ","type":"text"},{"text":"--file","type":"text","marks":[{"type":"code_inline"}]},{"text":" as starting hints. Codex has the same tools as Claude and will discover related files on its own — no need to enumerate everything upfront.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read the output — Codex executes changes and reports what it did.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Review the changes in your workspace.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"For multi-step projects, use ","type":"text"},{"text":"--session \u003cid>","type":"text","marks":[{"type":"code_inline"}]},{"text":" to continue with full conversation history. For independent parallel tasks, use the Task tool with ","type":"text"},{"text":"run_in_background: true","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Failure handling","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"script: tcgetattr/ioctl: Operation not supported on socket","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" (exit code 1): the ","type":"text"},{"text":"script","type":"text","marks":[{"type":"code_inline"}]},{"text":" command probes stdin with ","type":"text"},{"text":"tcgetattr","type":"text","marks":[{"type":"code_inline"}]},{"text":" at startup and only tolerates ","type":"text"},{"text":"ENOTTY","type":"text","marks":[{"type":"code_inline"}]},{"text":"/","type":"text"},{"text":"ENODEV","type":"text","marks":[{"type":"code_inline"}]},{"text":" errors. When Claude Code connects stdin via a socketpair, the kernel returns ","type":"text"},{"text":"EOPNOTSUPP","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead — which ","type":"text"},{"text":"script","type":"text","marks":[{"type":"code_inline"}]},{"text":" doesn't whitelist, so it exits immediately. The script detects this automatically by probing with ","type":"text"},{"text":"script -q /dev/null true","type":"text","marks":[{"type":"code_inline"}]},{"text":" first and falls back to direct execution. Update to the latest version if you still see this error.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Exit code 137","type":"text","marks":[{"type":"strong"}]},{"text":": the task was interrupted (user cancel or OOM). Not a Codex bug — retry or break the task into smaller pieces.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ERROR codex_core::codex: failed to load skill ...","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" in stderr: one of Codex's own installed skills has a broken YAML file. This warning is harmless and doesn't affect the current task — ignore it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"(no response from codex)","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" in the output file: Codex ran but produced no readable output. Check stderr for clues; the task may have hit a sandbox restriction.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Options","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--workspace \u003cpath>","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Target workspace directory (defaults to current directory).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--file \u003cpath>","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Point CodeX to key entry-point files (repeatable, workspace-relative or absolute). Don't duplicate their contents in the prompt.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--session \u003cid>","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Resume a previous session for multi-turn conversation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--model \u003cname>","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Override model (default: uses Codex config).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--reasoning \u003clevel>","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Reasoning effort: ","type":"text"},{"text":"low","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"medium","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"high","type":"text","marks":[{"type":"code_inline"}]},{"text":" (default: ","type":"text"},{"text":"medium","type":"text","marks":[{"type":"code_inline"}]},{"text":"). Use ","type":"text"},{"text":"high","type":"text","marks":[{"type":"code_inline"}]},{"text":" for code review, debugging, complex refactoring, or root cause analysis.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--sandbox \u003cmode>","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Override sandbox policy (default: workspace-write via full-auto).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--read-only","type":"text","marks":[{"type":"code_inline"}]},{"text":" — Read-only mode for pure discussion/analysis, no file changes.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Resume mode limitations","type":"text"}]},{"type":"paragraph","content":[{"text":"When using ","type":"text"},{"text":"--session","type":"text","marks":[{"type":"code_inline"}]},{"text":" to resume a previous conversation, note these limitations:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Must run in a git repository","type":"text","marks":[{"type":"strong"}]},{"text":" — The ","type":"text"},{"text":"codex exec resume","type":"text","marks":[{"type":"code_inline"}]},{"text":" command requires a git-trusted directory. It does not support ","type":"text"},{"text":"--skip-git-repo-check","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Limited options","type":"text","marks":[{"type":"strong"}]},{"text":" — Resume mode only supports ","type":"text"},{"text":"-c/--config","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"--last","type":"text","marks":[{"type":"code_inline"}]},{"text":". The following options are ","type":"text"},{"text":"not supported","type":"text","marks":[{"type":"strong"}]},{"text":" in resume mode:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--sandbox","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--full-auto","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--read-only","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--model","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--workspace","type":"text","marks":[{"type":"code_inline"}]},{"text":" (resumes in the original session's context)","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Text output only","type":"text","marks":[{"type":"strong"}]},{"text":" — Resume mode returns plain text instead of JSON-structured output.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"codex","author":"@skillopedia","source":{"stars":82,"repo_name":"codex","origin_url":"https://github.com/oil-oil/codex/blob/HEAD/SKILL.md","repo_owner":"oil-oil","body_sha256":"12c95daf3d747bd4cad306d7639e5d04d1f5701b9410c5106d0c57dd87209b45","cluster_key":"d05e6fc308eae4b25889ef181590ce2b3416178b1ff07764d8334b86a53bd889","clean_bundle":{"format":"clean-skill-bundle-v1","source":"oil-oil/codex/SKILL.md","attachments":[{"id":"44a1fcfd-5aa4-56a1-9361-e448676147e0","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/44a1fcfd-5aa4-56a1-9361-e448676147e0/attachment","path":".gitignore","size":10,"sha256":"c740db8c5771bc53deca3faf16465ffd78a57c5bc6df70143f0a8f422fb469ab","contentType":"text/plain; charset=utf-8"},{"id":"85f81a76-cfe0-5c86-9aff-5b3a15021507","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/85f81a76-cfe0-5c86-9aff-5b3a15021507/attachment.ps1","path":"scripts/ask_codex.ps1","size":17753,"sha256":"72d2ce873bff9c9dcfc081d0a0984d148f008196411a36193357987a5bd02dc4","contentType":"text/plain; charset=utf-8"},{"id":"0a981752-c1d3-566c-82fd-3c7f2cdc72a3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0a981752-c1d3-566c-82fd-3c7f2cdc72a3/attachment.sh","path":"scripts/ask_codex.sh","size":12526,"sha256":"4a6a374c741624597ea02e78c23575f70948c1c3cb76b51fdefa7fbd2198284d","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"dd501ab967b9f32ecc019d138c43ab8908baca226bd82ee79f56287a38812186","attachment_count":3,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":2,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"productivity-workflow","category_label":"Productivity"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"productivity-workflow","import_tag":"clean-skills-v1","description":"Delegate coding tasks to Codex CLI for execution. Only invoke this skill when the user explicitly asks to use Codex — e.g., \"用 codex 来做\", \"让 codex 执行\", \"ask codex to...\", \"codex 帮我写\". Do not proactively delegate to Codex for general coding requests the user didn't specifically ask Codex to handle. Codex is an autonomous coding agent with the same tools as Claude (file read/write, grep, bash) — it explores the codebase and implements changes on its own. Claude's role is to understand the problem clearly and frame it well for Codex to execute."}},"renderedAt":1782987918290}

Critical rules - Use the bundled shell script rather than calling CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing , , spaces, or special characters (e.g. ). Without quotes, zsh treats as a glob pattern and fails with "no matches found". - Keep the task prompt to the goal and constraints, not t…