agentskills.codes

Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. Trigger phrases include "use codex", "ask codex", "run codex", "call codex", "codex cli", "GPT-5 reasoning", "OpenAI reasoning", or when users request complex implementation challenges, advanced reasoning, architecture

Install

mkdir -p .claude/skills/codex-diegosouzapw && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16226" && unzip -o skill.zip -d .claude/skills/codex-diegosouzapw && rm skill.zip

Installs to .claude/skills/codex-diegosouzapw

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. Trigger phrases include "use codex", "ask codex", "run codex", "call codex", "codex cli", "GPT-5 reasoning", "OpenAI reasoning", or when users request complex implementation challenges, advanced reasoning, architecture design, or high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.
453 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)

About this skill

Codex: High-Reasoning AI Assistant for Claude Code


DEFAULT MODEL: Task-Based Model Selection with Read-Only Default

Codex uses task-based model selection. Sandbox is read-only by default - only use workspace-write when user explicitly requests file editing.

Task TypeModelSandbox (default)Sandbox (explicit edit)
Code-related tasksgpt-5.2-codexread-onlyworkspace-write
General tasksgpt-5.2read-onlyworkspace-write
  • Code-related tasks: Use gpt-5.2-codex - optimized for agentic coding (56.4% SWE-Bench Pro)
  • General tasks: Use gpt-5.2 - high-reasoning general model
  • Sandbox default: Always read-only unless user explicitly requests editing
  • Explicit editing: Only when user says "edit", "modify", "write changes", etc., use workspace-write
  • Always use -c model_reasoning_effort=xhigh for maximum capability
# Code task (read-only default)
codex exec -m gpt-5.2-codex -s read-only \
  -c model_reasoning_effort=xhigh \
  "analyze this function implementation"

# General task (read-only default)
codex exec -m gpt-5.2 -s read-only \
  -c model_reasoning_effort=xhigh \
  "explain this architecture"

# Code task with explicit edit request
codex exec -m gpt-5.2-codex -s workspace-write \
  -c model_reasoning_effort=xhigh \
  "edit this file to add the feature"

# General task with explicit edit request
codex exec -m gpt-5.2 -s workspace-write \
  -c model_reasoning_effort=xhigh \
  "modify the documentation file"

Model Fallback Chain

If the primary model is unavailable, fallback gracefully:

  1. Code tasks: gpt-5.2-codexgpt-5.2gpt-5.1-codex-max
  2. General tasks: gpt-5.2gpt-5.1gpt-5.1-codex-max
  3. Reasoning effort: xhighhighmedium

CRITICAL: Always Use codex exec

MUST USE: codex exec for ALL Codex CLI invocations in Claude Code.

NEVER USE: codex (interactive mode) - will fail with "stdout is not a terminal" ALWAYS USE: codex exec (non-interactive mode)

Examples:

  • codex exec -m gpt-5.2 "prompt" (CORRECT)
  • codex -m gpt-5.2 "prompt" (WRONG - will fail)
  • codex exec resume --last (CORRECT)
  • codex resume --last (WRONG - will fail)

Why? Claude Code's bash environment is non-terminal/non-interactive. Only codex exec works in this environment.


IMPORTANT: Interactive vs Exec Mode Flags

Some Codex CLI flags are ONLY available in interactive mode, NOT in codex exec.

FlagInteractive codexcodex execAlternative for exec
--search✅ Available❌ NOT available--enable web_search_request
-a/--ask-for-approval✅ Available❌ NOT available--full-auto or -c approval_policy=...
--add-dir✅ Available✅ AvailableN/A
--full-auto✅ Available✅ AvailableN/A

For web search in exec mode:

# CORRECT - works in codex exec
codex exec --enable web_search_request "research topic"

# WRONG - --search only works in interactive mode
codex --search "research topic"

For approval control in exec mode:

# CORRECT - works in codex exec
codex exec --full-auto "task"
codex exec -c approval_policy=on-request "task"

# WRONG - -a only works in interactive mode
codex -a on-request "task"

Trigger Examples

This skill activates when users say phrases like:

  • "Use codex to analyze this architecture"
  • "Ask codex about this design decision"
  • "Run codex on this problem"
  • "Call codex for help with this implementation"
  • "I need GPT-5 reasoning for this task"
  • "Get OpenAI's high-reasoning model on this"
  • "Continue with codex" or "Resume the codex session"
  • "Codex, help me with..." or simply "Codex"

When to Use This Skill

This skill should be invoked when:

  • User explicitly mentions "Codex" or requests Codex assistance
  • User needs help with complex coding tasks, algorithms, or architecture
  • User requests "high reasoning" or "advanced implementation" help
  • User needs complex problem-solving or architectural design
  • User wants to continue a previous Codex conversation

How It Works

Detecting New Codex Requests

When a user makes a request, first determine the task type (code vs general), then determine sandbox based on explicit edit request:

Step 1: Determine Task Type (Model Selection)

  • Code-related tasks: Use gpt-5.2-codex - for implementation, refactoring, code analysis, debugging, etc.
  • General tasks: Use gpt-5.2 - for architecture design, explanations, reviews, documentation, etc.

Step 2: Determine Sandbox (Edit Permission)

  • Default: read-only - safe for all tasks unless user explicitly requests editing
  • Explicit edit request: workspace-write - ONLY when user explicitly says to edit/modify/write files

Code-related task examples:

  • Read-only: "Analyze this function", "Review this implementation", "Debug this code"
  • With editing: "Edit this file to fix the bug", "Modify the function", "Refactor and save"

General task examples:

  • Read-only: "Design a queue data structure", "Explain this algorithm", "Review the architecture"
  • With editing: "Update the documentation file", "Modify the README"

⚠️ Important: The key distinction for sandbox is whether the user explicitly asks for file modifications. Use workspace-write ONLY when user says "edit", "modify", "write changes", "save", etc.

Bash CLI Command Structure

IMPORTANT: Always use codex exec for non-interactive execution. Claude Code's bash environment is non-terminal, so the interactive codex command will fail with "stdout is not a terminal" error.

Code Task (Read-Only Default)

codex exec -m gpt-5.2-codex -s read-only \
  -c model_reasoning_effort=xhigh \
  --enable web_search_request \
  "<code-related prompt>"

General Task (Read-Only Default)

codex exec -m gpt-5.2 -s read-only \
  -c model_reasoning_effort=xhigh \
  --enable web_search_request \
  "<general prompt>"

Code Task with Explicit Edit Request

codex exec -m gpt-5.2-codex -s workspace-write \
  -c model_reasoning_effort=xhigh \
  --enable web_search_request \
  "<edit code prompt>"

General Task with Explicit Edit Request

codex exec -m gpt-5.2 -s workspace-write \
  -c model_reasoning_effort=xhigh \
  --enable web_search_request \
  "<edit general files prompt>"

Why codex exec?

  • Non-interactive mode required for automation and Claude Code integration
  • Produces clean output suitable for parsing
  • Works in non-TTY environments (like Claude Code's bash)

Model Selection Logic

Step 1: Choose Model Based on Task Type

Use gpt-5.2-codex for code-related tasks:

  • Implementation, refactoring, code analysis
  • Debugging, fixing bugs, optimization
  • Any task involving code understanding or modification

Use gpt-5.2 for general tasks:

  • Architecture and system design
  • Explanations, documentation, reviews
  • Planning, strategy, general reasoning

Step 2: Choose Sandbox Based on Edit Intent

Use read-only (DEFAULT):

  • Analysis, review, explanation tasks
  • ANY task where user does NOT explicitly request file editing

Use workspace-write (ONLY when explicitly requested):

  • User explicitly says "edit this file", "modify the code", "write changes"
  • User explicitly asks to "make edits" or "save the changes"
  • User explicitly requests "refactor and save" or "implement and write"

Fallback Models: gpt-5.1-codex-max and gpt-5.1 are available if primary models are unavailable. See fallback chain in DEFAULT MODEL section.

Default Configuration

All Codex invocations use these defaults unless user specifies otherwise:

ParameterDefault ValueCLI FlagNotes
Model (code tasks)gpt-5.2-codex-m gpt-5.2-codexFor code-related tasks
Model (general tasks)gpt-5.2-m gpt-5.2For general tasks
Sandbox (default)read-only-s read-onlySafe default for ALL tasks
Sandbox (explicit edit)workspace-write-s workspace-writeOnly when user explicitly requests editing
Reasoning Effortxhigh-c model_reasoning_effort=xhighMaximum reasoning capability
Verbositymedium-c model_verbosity=mediumBalanced output detail
Web Searchenabled--enable web_search_requestAccess to up-to-date information

CLI Flags Reference

Codex CLI Version: 0.72.0+ (requires 0.72.0+ for gpt-5.2-codex and xhigh)

FlagValuesDescription
-m, --modelgpt-5.2-codex, gpt-5.2, gpt-5.1-codex-max, gpt-5.1Model selection
-s, --sandboxread-only, workspace-write, danger-full-accessSandbox mode
-c, --configkey=valueConfig overrides (e.g., model_reasoning_effort=high)
-C, --cddirectory pathWorking directory
-p, --profileprofile nameUse config profile
--enablefeature nameEnable a feature (e.g., web_search_request)
--disablefeature nameDisable a feature
-i, --imagefile path(s)Attach image(s) to initial prompt
--add-dirdirectory pathAdditional writable directory (repeatable)
--full-autoflagConvenience for workspace-write sandbox with on-request approval
--ossflagUse local open source model provider
--local-providerlmstudio, ollamaSpecify local provider (with --oss)
--skip-git-repo-checkflagAllow running outside Git repository
--output-schemafile pathJSON Schema file for response shape
--coloralways, never, autoColor settings for output
--jsonflagPrint events as JSONL
-o, --output-last-messagefile pathSave last message to file
`

Content truncated.

More by diegosouzapw

View all by diegosouzapw

helm-chart-scaffolding-v2

diegosouzapw

Helm Chart Scaffolding workflow skill. Use this skill when the user needs Comprehensive guidance for creating, organizing, and managing Helm charts for packaging and deploying Kubernetes applications and the operator should preserve the upstream workflow, copied support files, and provenance before

00

cc-skill-coding-standards-v2

diegosouzapw

Coding Standards & Best Practices workflow skill. Use this skill when the user needs Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development and the operator should preserve the upstream workflow, copied support files, and provenance before

00

worktree-setup

diegosouzapw

Automatically invoked after `git worktree add` to create data/shared symlink and data/local directory. Required before starting work in any new worktree.

00

parsehub-automation

diegosouzapw

Automate Parsehub tasks via Rube MCP (Composio). Always search tools first for current schemas.

00

signalwire-agents-sdk

diegosouzapw

Expert assistance for building SignalWire AI Agents in Python. Automatically activates when working with AgentBase, SWAIG functions, skills, SWML, voice configuration, DataMap, or any signalwire_agents code. Provides patterns, best practices, and complete working examples.

00

agent-sales-engineer

diegosouzapw

Expert sales engineer specializing in technical pre-sales, solution architecture, and proof of concepts. Masters technical demonstrations, competitive positioning, and translating complex technology into business value for prospects and customers.

00

Search skills

Search the agent skills registry