OpenAI Codex Integration

VerifiedCaution

Send prompts to OpenAI Codex CLI via /codex command, then process the output in various modes: review, compare, integrate, or raw. Useful for collaborative coding where Claude analyzes or refines Codex's solutions.

Sby Skills Guide Bot
DevelopmentAdvanced
6/2/2026
Claude Code
#codex#integration#claude-code#code-review#multi-ai

Recommended for

Automated summary

This skill enables sending prompts to OpenAI's Codex CLI from Claude, then analyzing, reviewing, or integrating the results into the project.

Strengths

  • Leverages the complementary strengths of Claude and Codex for complex tasks.
  • Offers multiple processing modes (review, compare, integrate) suited to different needs.
  • Provides structured review covering correctness, security, and performance.
  • Facilitates integration of generated code with Claude's refinements.

Limitations

  • Requires Codex to be installed and authenticated on the system.
  • Parsing Codex's JSONL output can be complex and error-prone.
  • Adds latency due to dual execution (Claude then Codex).
When to use it

Use this skill when you need to solve a coding problem that would benefit from the combined perspectives of two AI models.

When not to use it

Avoid using it if the task can be efficiently handled by Claude alone, or if Codex installation is not possible or allowed in your environment.

Security analysis

Caution
Quality score92/100

The skill executes external Codex commands with shell, which could be powerful, but it does not instruct destructive actions like data exfiltration or system-wide deletions. The risk lies in the --full-auto option that potentially modifies project files within the sandbox, requiring trust in Codex's behavior and user prompts. No obfuscated payloads or secret leaks are present.

Findings
  • •Skill invokes Codex CLI with --full-auto flag, enabling automatic workspace-write sandbox, which could modify files without user preview if a malicious or poorly constructed prompt is supplied. The skill does not enforce --sandbox read-only for all modes.
How this analysis is made

Examples

Fix type error
/codex fix the type error in auth.ts
Add input validation
/codex add input validation to the user form
Refactor database queries
/codex refactor the database queries for better performance

name: codex description: Send prompts to OpenAI Codex CLI and process the output. Use /codex <prompt> to invoke Codex, then Claude analyzes, reviews, or integrates the results. user-invocable: true allowed-tools: Bash(codex:), Bash(cat:), Read, Glob, Grep, AskUserQuestion, Edit, Write

Codex Integration Skill

Purpose

This skill enables a collaborative workflow between Claude and OpenAI's Codex CLI. Send prompts to Codex, capture its output, and have Claude process the results.

How to Use

Invoke with: /codex <your prompt here>

If no prompt is provided, ask the user what they want Codex to do.

Execution Flow

Step 1: Determine the prompt

If the user provided a prompt after /codex, use it. Otherwise, ask them what task they want Codex to perform.

Step 2: Ask for processing mode

Ask the user how they want Claude to process Codex's output:

  1. Review - Analyze Codex's solution for correctness, security, performance, and best practices
  2. Compare - Have Claude solve the same problem, then compare approaches
  3. Integrate - Take Codex's output and integrate it into the codebase with Claude's refinements
  4. Raw - Just show Codex's output without additional processing

Step 3: Execute Codex

Run Codex in non-interactive mode with the user's prompt.

First, create a unique output file to avoid collisions with parallel invocations:

CODEX_OUTPUT=$(mktemp /tmp/codex-output-XXXXXX.json)

Then execute Codex:

codex exec --full-auto --json "<prompt>" 2>&1 | tee "$CODEX_OUTPUT"

Or as a single command:

CODEX_OUTPUT=$(mktemp /tmp/codex-output-XXXXXX.json) && codex exec --full-auto --json "<prompt>" 2>&1 | tee "$CODEX_OUTPUT" && echo "Output saved to: $CODEX_OUTPUT"

Options to consider:

  • --full-auto: Enables automatic execution with workspace-write sandbox
  • --json: Outputs structured JSONL for easier parsing
  • --sandbox read-only: For safer execution when reviewing only
  • -m <model>: Specify a different model (e.g., o3, o4-mini)

Step 4: Process the output based on mode

Review Mode

  1. Parse the Codex output
  2. Identify any code changes or suggestions made
  3. Analyze for:
    • Correctness: Does it solve the stated problem?
    • Security: Any vulnerabilities introduced?
    • Performance: Efficiency concerns?
    • Best practices: Follows project conventions?
    • Edge cases: Are they handled?
  4. Provide a structured review with recommendations

Compare Mode

  1. First, read and understand Codex's solution
  2. Independently solve the same problem as Claude
  3. Compare both approaches:
    • Similarities and differences
    • Trade-offs of each approach
    • Which is more maintainable/readable
    • Which handles edge cases better
  4. Recommend which approach (or hybrid) to use

Integrate Mode

  1. Parse Codex's output for code changes
  2. Review the changes for quality and correctness
  3. Make refinements based on:
    • Project coding standards
    • Security best practices
    • Performance optimizations
    • Better naming/structure
  4. Apply the refined changes to the codebase
  5. Summarize what was changed

Raw Mode

  1. Display the Codex output directly
  2. Offer to do further processing if requested

Output Parsing

Codex --json output is JSONL format. Key event types:

  • message_output_item_added: Contains agent messages and tool calls
  • message_output_item_done: Completed items
  • response_completed: Final response

Extract code changes from code_interpreter tool calls or direct file modifications.

Error Handling

  • If Codex fails to run, check that it's installed and authenticated
  • If execution times out, suggest using --sandbox read-only or a simpler prompt
  • If output is too large, summarize key points and offer to dive into specifics

Example Invocations

  • /codex fix the type error in auth.ts
  • /codex add input validation to the user form
  • /codex refactor the database queries for better performance

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/openai-codex-integration-mm8o5284/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/openai-codex-integration-mm8o5284' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/openai-codex-integration-mm8o5284/download' --output '.skill-downloads/openai-codex-integration-mm8o5284/SKILL.md.part' && mv '.skill-downloads/openai-codex-integration-mm8o5284/SKILL.md.part' '.skill-downloads/openai-codex-integration-mm8o5284/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash(codex:*), Bash(cat:*), Read, Glob, Grep, AskUserQuestion, Edit, Write

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/openai-codex-integration-mm8o5284/SKILL.md' && test -s '.skill-downloads/openai-codex-integration-mm8o5284/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/codex' && cp -R '.skill-downloads/openai-codex-integration-mm8o5284' '.claude/skills/codex'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/openai-codex-integration-mm8o5284'

openskills read 'openai-codex-integration-mm8o5284'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/openai-codex-integration-mm8o5284/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills