Skip to content

About

Claude Code skill for running OpenAI Codex CLI non-interactively

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

codex-exec

A Claude Code skill for running OpenAI's Codex CLI non-interactively from within Claude Code sessions. Useful for getting a second opinion from a differently-trained model, automated code generation, and code reviews.

Purpose

Codex CLI (codex exec) runs OpenAI models in a sandboxed, non-interactive mode. This skill gives Claude Code the knowledge to invoke it correctly, with sensible defaults for model selection, sandbox mode, and output handling. It enables multi-model workflows where Claude can delegate tasks to Codex or use it for adversarial review.

Prerequisites

  • Codex CLI installed and on PATH (installation guide)
  • OpenAI API key configured for Codex
  • Claude Code installed and working

Usage

/codex-exec [prompt or options]

Claude will run Codex with these defaults unless told otherwise:

codex exec --full-auto -m gpt-5.3-codex -c model_reasoning_effort=high "your prompt"

Key features

Execution modes

Mode Flag Description
Full auto --full-auto Sandboxed automatic execution (default)
Read-only -s read-only No write access
Workspace write -s workspace-write Can write to workspace
Full access -s danger-full-access Full system access

Output options

Flag Description
--json JSONL event stream to stdout
-o <file> Write final message to file
--output-schema <file> Structured output via JSON Schema

Code review

codex exec review --base main           # Review against main branch
codex exec review --uncommitted          # Review staged/unstaged changes
codex exec review --commit <SHA>         # Review a specific commit

Session resume

codex exec resume --last "follow-up prompt"
codex exec resume <SESSION_ID> "follow-up prompt"

JSON output events

When using --json, events are emitted as JSONL:

Event Description
thread.started Session begins
turn.started Agent turn begins
item.completed Reasoning, message, or tool call completed
turn.completed Turn finished with usage stats
turn.failed Turn failed with error

Limitations

  • Requires a separate OpenAI API key (not included with Claude Code)
  • Codex CLI must be installed independently
  • --full-auto uses workspace-write sandbox — files outside the workspace are not writable
  • --dangerously-bypass-approvals-and-sandbox should only be used in already-sandboxed environments
  • Running outside a git repo requires --skip-git-repo-check

License

MIT

About

Claude Code skill for running OpenAI Codex CLI non-interactively

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors