OpenAI Codex
OpenAI’s AI coding CLI. Pioneered the AGENTS.md format. Has a richer native extension model than the AGENTS.md standard alone: TOML custom agents, native skills concept, and layered instruction discovery.Instruction Layer (AGENTS.md)
ReadsAGENTS.md as ambient layered instructions:
- Discovery: global
~/.codex/AGENTS.md→ project root → CWD walk - Override:
AGENTS.override.mdtakes precedence overAGENTS.mdat the same directory level (useful for temporary local overrides;rm AGENTS.override.mdto restore default) - Limit: 32 KiB default instruction chain (
project_doc_max_bytes) - Merge order: root→CWD concatenated, joined by blank lines; later (closer to CWD) wins
- Profiles:
CODEX_HOMEenv var for multiple setups (e.g.,CODEX_HOME=$(pwd)/.codex codex exec "...")
~/.codex/config.toml:
Custom Agents — TOML Format
Note: Codex agents use TOML, not YAML. This is the format reported in official docs as of 2026. Location:~/.codex/agents/ (global) or .codex/agents/ (project-scoped).
name— identifier; used for invocation and routingdescription— signal for when primary agent should delegatedeveloper_instructions— multiline system prompt for this agentmodel— model override (can differ from primary session model)[sandbox]— network/filesystem restrictions for this agent
Skills
Codex has a first-class skills concept. The native entrypoint isskills/<name>/SKILL.md, with optional product metadata in skills/<name>/agents/openai.yaml.
Skill tool mechanism than to ambient AGENTS.md rules.
Hooks
Codex supports repo-local hooks inconfig.toml, including events such as PostToolUse.
Minimal pattern:
Three-Layer Stack
Migration from Claude Code
See Claude Code → Cross-Platform Migration Matrix for full matrix.
Related Pages
- AGENTS.md (format) — AGENTS.md cross-tool compatibility
- Claude Code → Cross-Platform Migration Matrix — full migration matrix
- Agent Subagents — CC subagent model for comparison
- Agent Skills — CC skills model for comparison