From agentic-coding-tools
Wrapper around codex CLI for non-interactive runs (prompt via args/file/stdin) with resume support. Outputs session_id for conversation continuation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agentic-coding-tools:codex-agentThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**This script runs synchronously and returns output directly. Do NOT run it in the background.**
This script runs synchronously and returns output directly. Do NOT run it in the background.
When invoking via Bash, you MUST:
timeout: 600000 (10 minutes) — codex runs can take several minutesrun_in_background)Example Bash invocation:
Bash(command: "~/.claude/skills/codex-agent/scripts/codex-agent Your prompt here", timeout: 600000)
Thin wrapper around codex CLI (OpenAI Codex) for non-interactive use:
PROMPT_FILE, or stdin--model or CODEX_MODEL env var--resume or CODEX_SESSION env var~/.codex/auth.json) or API keysCodex CLI v0.80.0+ required:
npm install -g @openai/codex@latest
codex --version # should be 0.80.0 or higher
Authentication (one of these):
codex login for ChatGPT OAuth (creates ~/.codex/auth.json)OPENAI_API_KEY environment variableCODEX_API_KEY environment variable (exec mode only)# Arguments
~/.claude/skills/codex-agent/scripts/codex-agent Your prompt here
# File via env var
PROMPT_FILE=task.md ~/.claude/skills/codex-agent/scripts/codex-agent
# Stdin
cat task.md | ~/.claude/skills/codex-agent/scripts/codex-agent
# Resume most recent session
~/.claude/skills/codex-agent/scripts/codex-agent --resume latest "Follow-up question"
# Resume by UUID (find in ~/.codex/sessions/)
~/.claude/skills/codex-agent/scripts/codex-agent --resume 019bf3a2-40ce-7923-b501-3d4ebd00aed3 "Continue"
# Via environment variable
CODEX_SESSION=latest ~/.claude/skills/codex-agent/scripts/codex-agent "Follow-up"
# Via flag
~/.claude/skills/codex-agent/scripts/codex-agent --model gpt-5.2-codex "Your prompt"
# Via environment variable
CODEX_MODEL=gpt-5.2-codex ~/.claude/skills/codex-agent/scripts/codex-agent "Your prompt"
| Variable | Description |
|---|---|
PROMPT_FILE | Read prompt from this file |
CODEX_MODEL | Model to use (passed as --model) |
CODEX_SESSION | Session to resume (latest or UUID) |
OPENAI_API_KEY | API key authentication |
CODEX_API_KEY | API key for exec mode |
Returns plain text response followed by the session ID:
<response text>
[session_id: <uuid>]
Capture the session ID to continue the conversation with --resume <uuid>.
Diagnostics are shown automatically on any failure. You can also run:
~/.claude/skills/codex-agent/scripts/codex-agent --version
Common issues:
codex login to set up OAuth, or set OPENAI_API_KEYnpm install -g @openai/codex~/.codex/sessions/ for valid UUIDscodex exec --dangerously-bypass-approvals-and-sandbox (YOLO mode)--skip-git-repo-check to allow running outside git repos~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonlcodex app-server directly (JSON-RPC)npx claudepluginhub thesylvester/agentic-coding-tools --plugin read-transcriptRuns Codex CLI tasks with configurable model, reasoning effort, and sandbox mode. Handles session resume and stdin redirection to prevent hangs.
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing
Executes Codex CLI (codex exec, resume) for code analysis, review, and automated editing with model selection (gpt-5.3-codex), sandbox modes, and git integration.