Codex

Delegate coding tasks to the Codex CLI through print mode and tmux interactive sessions.

Updated Jul 10, 2026
One-click install
npx skills add https://github.com/AvaTar-ArTs/.Agent-skills --skill codex-avatar-arts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Codex
Source: https://github.com/AvaTar-ArTs/.Agent-skills/tree/main/skills/autonomous-ai-agents/claude-code
Command: npx skills add https://github.com/AvaTar-ArTs/.Agent-skills --skill codex-avatar-arts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Orchestrating an autonomous coding agent from another agent or automation pipeline is error-prone: interactive prompts block execution, sessions lose context, and runaway loops burn budget. This Skill provides a complete operational guide for delegating coding work to the Codex CLI reliably. ## Core Features & Use Cases - Two Orchestration Modes: Non-interactive print mode (-p) for one-shot tasks and CI pipelines, plus tmux-based interactive PTY sessions for multi-turn iterative work. - Structured Output & Session Control: JSON output with --output-format json, schema-validated extraction via --json-schema, and session resumption with --resume and --fork-session. - Safety & Cost Controls: Permission modes, --allowedTools whitelists, --max-turns, --max-budget-usd, and PTY dialog handling for trust and permission prompts. - Use Case: Pipe a git diff into Codex for automated PR review, run three parallel tmux sessions to fix a bug, write tests, and update docs simultaneously, then capture results as JSON for downstream processing. ## Quick Start Ask the agent to run Codex in print mode with a task like fixing a bug in a specific file, limiting it to Read and Edit tools with a maximum of 10 turns.

Frequently Asked Questions about Codex

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Codex CLI non-interactively for automation?

Use print mode with the -p flag, which runs a one-shot task and exits without interactive prompts. Combine it with --allowedTools to restrict capabilities and --max-turns to prevent runaway loops, making it suitable for CI/CD pipelines.

How do I handle Codex interactive prompts in tmux?

Send keystrokes with tmux send-keys to answer the workspace trust dialog (press Enter for the default Yes) and the permissions bypass dialog (press Down then Enter to select Yes, I accept). The trust dialog only appears on first visit to a directory.

Can Codex CLI output structured JSON for scripting?

Yes, use --output-format json to get a result object containing session_id, num_turns, total_cost_usd, and the result text. Add --json-schema to force output matching a specific schema, or stream-json for real-time newline-delimited events.

How do I resume a previous Codex session?

Capture the session_id from JSON output, then pass it with --resume to continue that conversation. Use --continue to resume the most recent session in the current directory, or add --fork-session to branch with a new ID while keeping history.

How do I limit Codex API costs during automated runs?

Set --max-turns to cap agentic loops and --max-budget-usd to cap spend in print mode. Use --effort low for simple tasks and --fallback-model haiku to switch models when the default is overloaded.

When should I use print mode versus interactive tmux mode?

Use print mode for one-shot tasks, CI automation, and piped input processing since it skips all interactive dialogs. Use tmux interactive mode for multi-turn iterative work, slash commands like /compact and /review, and exploratory sessions needing human decisions.