CodeX — Your Codex Coding Partner Delegate coding execution to Codex CLI. CodeX turns clear plans into working code. Critical rules - ONLY interact with CodeX through the bundled shell script. NEVER call CLI directly. - Run the script ONCE per task. If it succeeds (exit code 0), read the output file and proceed. Do NOT re-run or retry. - Do NOT read or inspect the script source code. Treat it as a black box. - ALWAYS quote file paths containing brackets, spaces, or special characters when passing to the script (e.g. ). Unquoted triggers zsh glob expansion. - Keep the task prompt focused. Aim…

\\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+=

CodeX — Your Codex Coding Partner Delegate coding execution to Codex CLI. CodeX turns clear plans into working code. Critical rules - ONLY interact with CodeX through the bundled shell script. NEVER call CLI directly. - Run the script ONCE per task. If it succeeds (exit code 0), read the output file and proceed. Do NOT re-run or retry. - Do NOT read or inspect the script source code. Treat it as a black box. - ALWAYS quote file paths containing brackets, spaces, or special characters when passing to the script (e.g. ). Unquoted triggers zsh glob expansion. - Keep the task prompt focused. Aim…

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

CodeX — Your Codex Coding Partner Delegate coding execution to Codex CLI. CodeX turns clear plans into working code. Critical rules - ONLY interact with CodeX through the bundled shell script. NEVER call CLI directly. - Run the script ONCE per task. If it succeeds (exit code 0), read the output file and proceed. Do NOT re-run or retry. - Do NOT read or inspect the script source code. Treat it as a black box. - ALWAYS quote file paths containing brackets, spaces, or special characters when passing to the script (e.g. ). Unquoted triggers zsh glob expansion. - Keep the task prompt focused. Aim…

\\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 cmd=(codex exec resume --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\")\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 JSON output ---\n\nstderr_file=\"$(mktemp)\"\njson_file=\"$(mktemp)\"\nprompt_file=\"$(mktemp)\"\ntrap 'rm -f \"$stderr_file\" \"$json_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# Use `script` to run codex in a pseudo-TTY so it line-buffers its JSONL output.\n# Without this, codex block-buffers when stdout is a pipe, preventing real-time progress.\nscript -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 | while IFS= read -r line; do\n # Strip terminal artifacts (carriage return, ^D EOF marker, ANSI escapes, other control chars)\n cleaned=\"${line//

CodeX — Your Codex Coding Partner Delegate coding execution to Codex CLI. CodeX turns clear plans into working code. Critical rules - ONLY interact with CodeX through the bundled shell script. NEVER call CLI directly. - Run the script ONCE per task. If it succeeds (exit code 0), read the output file and proceed. Do NOT re-run or retry. - Do NOT read or inspect the script source code. Treat it as a black box. - ALWAYS quote file paths containing brackets, spaces, or special characters when passing to the script (e.g. ). Unquoted triggers zsh glob expansion. - Keep the task prompt focused. Aim…

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

CodeX — Your Codex Coding Partner Delegate coding execution to Codex CLI. CodeX turns clear plans into working code. Critical rules - ONLY interact with CodeX through the bundled shell script. NEVER call CLI directly. - Run the script ONCE per task. If it succeeds (exit code 0), read the output file and proceed. Do NOT re-run or retry. - Do NOT read or inspect the script source code. Treat it as a black box. - ALWAYS quote file paths containing brackets, spaces, or special characters when passing to the script (e.g. ). Unquoted triggers zsh glob expansion. - Keep the task prompt focused. Aim…

\\004'/}\"\n # Strip ANSI escape sequences and any non-printable chars before the JSON opening brace\n cleaned=\"$(printf '%s' \"$cleaned\" | sed

CodeX — Your Codex Coding Partner Delegate coding execution to Codex CLI. CodeX turns clear plans into working code. Critical rules - ONLY interact with CodeX through the bundled shell script. NEVER call CLI directly. - Run the script ONCE per task. If it succeeds (exit code 0), read the output file and proceed. Do NOT re-run or retry. - Do NOT read or inspect the script source code. Treat it as a black box. - ALWAYS quote file paths containing brackets, spaces, or special characters when passing to the script (e.g. ). Unquoted triggers zsh glob expansion. - Keep the task prompt focused. Aim…

s/\\x1b\\[[0-9;]*[a-zA-Z]//g; s/^[^{]*//')\"\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\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# --- Extract thread_id and all messages from JSON stream ---\n\nthread_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 (shell commands codex ran)\n jq -r '\n select(.type == \"item.completed\" and .item.type == \"command_execution\")\n | .item\n | \"### Shell: `\" + (.command // \"unknown\" | gsub(\"^/bin/zsh -lc \"; \"\") | gsub(\"^/bin/bash -c \"; \"\"))[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 (not just the last one)\n jq -r '\n select(.type == \"item.completed\" and .item.type == \"agent_message\")\n | .item.text\n ' \u003c \"$json_file\" 2>/dev/null\n} > \"$output_path\"\n\n# If nothing was captured, write a fallback\nif [[ ! -s \"$output_path\" ]]; then\n echo \"(no response from codex)\" > \"$output_path\"\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":9935,"content_sha256":"d823c5e8d4b5883b2c9d9e4ab4846ea98f3a13ec83b5a70352ecabaca6cdcfbe"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"CodeX — Your Codex Coding Partner","type":"text"}]},{"type":"paragraph","content":[{"text":"Delegate coding execution to Codex CLI. CodeX turns clear plans into working code.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Critical rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ONLY interact with CodeX through the bundled shell script. NEVER call ","type":"text"},{"text":"codex","type":"text","marks":[{"type":"code_inline"}]},{"text":" CLI directly.","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. Do NOT re-run or retry.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT read or inspect the script source code. Treat it as a black box.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ALWAYS quote file paths containing brackets, spaces, or special characters when passing to the script (e.g. ","type":"text"},{"text":"--file \"src/app/[locale]/page.tsx\"","type":"text","marks":[{"type":"code_inline"}]},{"text":"). Unquoted ","type":"text"},{"text":"[...]","type":"text","marks":[{"type":"code_inline"}]},{"text":" triggers zsh glob expansion.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Keep the task prompt focused.","type":"text","marks":[{"type":"strong"}]},{"text":" Aim for under ~500 words. Describe WHAT to do and key constraints, not step-by-step HOW. CodeX is an autonomous agent with full workspace access — it reads files, explores code, and figures out implementation details on its own.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Never 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. Duplicating file contents in the prompt wastes tokens and adds no value.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Don't reference or describe the SKILL.md itself in the prompt.","type":"text","marks":[{"type":"strong"}]},{"text":" CodeX doesn't need to know about this skill's configuration.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"How to call the script","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":"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":"Decision policy","type":"text"}]},{"type":"paragraph","content":[{"text":"Call CodeX when at least one of these is true:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The implementation plan is clear and needs coding execution.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The task involves batch refactoring, code generation, or repetitive changes.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Multiple files need coordinated modifications following a defined pattern.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"You want a practitioner's perspective on whether a plan is feasible.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The task is cost-sensitive and doesn't require deep architectural reasoning.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Writing or updating tests based on existing code.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Simple-to-moderate bug fixes where the root cause is identified.","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":"Design the solution and identify the key files involved.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run the script with a clear, concise task description. Tell CodeX the goal and constraints, not step-by-step implementation details — it figures those out itself. For discussion, use a question-oriented task with ","type":"text"},{"text":"--read-only","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pass relevant files with ","type":"text"},{"text":"--file","type":"text","marks":[{"type":"code_inline"}]},{"text":" (2-6 high-signal entry points; CodeX has full workspace access and will discover related files on its own).","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":"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":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"codex","author":"@skillopedia","source":{"stars":60,"repo_name":"claude-gpt-workflow","origin_url":"https://github.com/longranger2/claude-gpt-workflow/blob/HEAD/codex/SKILL.md","repo_owner":"longranger2","body_sha256":"a3c60c48440811a102980202464df0592e7ebc681f3616c22d7ee5d57ce2d673","cluster_key":"90f006aa7856db22e13d9401b8a6ee0f047a21949dde7b669762d6c59dfa1674","clean_bundle":{"format":"clean-skill-bundle-v1","source":"longranger2/claude-gpt-workflow/codex/SKILL.md","attachments":[{"id":"50327fec-ff71-5037-bb86-02f3d211e120","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/50327fec-ff71-5037-bb86-02f3d211e120/attachment","path":".gitignore","size":10,"sha256":"c740db8c5771bc53deca3faf16465ffd78a57c5bc6df70143f0a8f422fb469ab","contentType":"text/plain; charset=utf-8"},{"id":"3756a74d-2a30-561e-afc8-0ad5ffc64f11","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3756a74d-2a30-561e-afc8-0ad5ffc64f11/attachment.sh","path":"scripts/ask_codex.sh","size":9935,"sha256":"d823c5e8d4b5883b2c9d9e4ab4846ea98f3a13ec83b5a70352ecabaca6cdcfbe","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"48173e3957d6a710aed47679b27a7906d01902ae3a51cc589338d1a973eea809","attachment_count":2,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":1,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"codex/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"testing-qa","category_label":"Testing"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"testing-qa","import_tag":"clean-skills-v1","description":"Delegate coding tasks to Codex CLI for execution, or discuss implementation approaches with it. CodeX is a cost-effective, strong coder — great for batch refactoring, code generation, multi-file changes, test writing, and multi-turn implementation tasks. Use when the plan is clear and needs hands-on coding. Claude handles architecture, strategy, copywriting, and ambiguous problems better."}},"renderedAt":1782981400627}

CodeX — Your Codex Coding Partner Delegate coding execution to Codex CLI. CodeX turns clear plans into working code. Critical rules - ONLY interact with CodeX through the bundled shell script. NEVER call CLI directly. - Run the script ONCE per task. If it succeeds (exit code 0), read the output file and proceed. Do NOT re-run or retry. - Do NOT read or inspect the script source code. Treat it as a black box. - ALWAYS quote file paths containing brackets, spaces, or special characters when passing to the script (e.g. ). Unquoted triggers zsh glob expansion. - Keep the task prompt focused. Aim…