OpenAI Codex
OpenAI Codex
Section titled “OpenAI Codex”OpenAI Codex implements the Agent Skills open standard, reaching parity with the rest of the AI IDE ecosystem. Codex also supports sub-agents with custom TOML-defined roles, enabling parallel delegation and workflow orchestration. Codex loads skills from .agents/skills/ and evaluates each skill’s description to decide when to load it — the same progressive disclosure model used by Claude Code, Cursor, and Copilot.
Skills
Section titled “Skills”Supports Agent Skills standard: ✅ Yes
| Scope | Path |
|---|---|
| Project | .agents/skills/ |
| User | ~/.agents/skills/ |
| Admin | /etc/codex/skills/ |
Codex scans .agents/skills/ in every directory from the current working directory up to the repository root. It still loads the older ~/.codex/skills/ user location for backward compatibility; do not add new skills there.
Codex uses the shared .agents/skills/ convention, the canonical factory engineering location, so no copy is needed. Codex does not read .claude/skills/. Codex evaluates each skill’s description via progressive disclosure to decide when to load it.
Codex reads only name and description (plus metadata.short-description) from SKILL.md. It ignores Claude Code’s disable-model-invocation and user-invocable properties. To reserve a skill for explicit invocation, add an agents/openai.yaml file inside the skill directory:
policy: allow_implicit_invocation: falseInside Codex, list loaded skills with the /skills command and invoke a skill explicitly by name with $skill-name.
📖 OpenAI Codex Skills Documentation
For more about how skills work in factory engineering, see Skills.
Commands
Section titled “Commands”Slash-command markdown file support: ❌ No. Use skills.
Codex has no custom slash-command files. Its slash commands are a fixed built-in set, and custom prompt files are no longer supported. Skills are Codex’s only reusable-instruction mechanism, which matches the factory engineering pattern of authoring commands as skills.
Author each command as a skill in .agents/skills/ with an agents/openai.yaml file that disables implicit invocation (see Commands):
.agents/skills/write-spec/├── SKILL.md└── agents/ └── openai.yamlpolicy: allow_implicit_invocation: falseWith allow_implicit_invocation: false, Codex does not select the skill on its own; it runs only when you name it. Codex ignores disable-model-invocation in SKILL.md, so keep both controls in shared commands.
Invocation: In the Codex CLI, invoke the command by name with $command-name, not a slash, and mention the artifact (e.g. $write-spec @docs/user-stories/submit-sales-order.md). Codex reserves / for its built-in commands. Codex’s /import command converts other IDEs’ command folders into skills.
For more about how commands work in factory engineering, see Commands.
Agents
Section titled “Agents”Supports true agents: ✅ Yes (memory via markdown instruction)
Feature name: Custom agents (sub-agents with role definitions)
Storage location: TOML profiles — Project: .codex/agents/; User: ~/.codex/agents/
OpenAI Codex supports sub-agents with custom role definitions. Each custom agent is a TOML file in .codex/agents/ that declares name, description, and the required developer_instructions (the role prompt), plus any config.toml setting to override for that role, such as model, model_reasoning_effort, or sandbox_mode. Codex ships with three built-in roles (default, worker, and explorer) and lets you author additional custom agents for specialized roles.
name = "spec-writer"description = "Technical specification writer. Use to turn a user story into a detailed spec."developer_instructions = """You are a technical specification writer.At the start of each task, read .claude/agent-memory/spec-writer/MEMORY.md.At the end of each task, append your learnings to that file."""model_reasoning_effort = "high"Role specialization: ✅ Custom agents are defined as TOML profiles with a distinct role, scoped tool access, and configurable model selection, so each agent runs in its own context for its delegated task.
Persistent memory: ⚠️ Not per agent. Codex has a native memories feature (off by default; enable it in the [memories] section of config.toml or with /memories) that summarizes past sessions into ~/.codex/memories/ and injects the summary into later sessions. Those memories are global to the user, live outside the repository, and are not generated in sub-agent sessions, so they do not give each role its own shared memory. The AGENTS.md file that Codex reads at session start is an instruction document, not an agent memory file or an agent implementation.
Memory via markdown instruction: Get the factory-engineering memory pattern by instructing each custom agent (in its TOML role definition or referenced skill) to read from a markdown file at the start of work and append learnings at the end. Use the path .claude/agent-memory/{agent-name}/MEMORY.md for cross-IDE compatibility.
📖 OpenAI Codex Sub-Agents Documentation
For more about how agents work in factory engineering, see Agents.
Workflows
Section titled “Workflows”Orchestration support: ✅ Yes
Invoke a workflow by name with $tdd-cycle and mention the artifact. Store the workflow as a command skill in .agents/skills/. The parent agent reads it and delegates each step with the spawn_agent tool, passing a role name from .codex/agents/ as the agent type. Codex includes each role’s description in the guidance for that tool, so write descriptions that say when the orchestrator should use the role.
Orchestration is configurable in the [agents] section of config.toml:
max_threads— maximum concurrent sub-agents per session (default:6)max_depth— how deep sub-agents can spawn further sub-agents (default:1, so specialists cannot delegate further)
Hooks and plugins: Codex runs hooks from hooks.json (SessionStart, PreToolUse, PostToolUse, Stop, SubagentStop, and more) and installs plugins that bundle skills. Its plugin loader also accepts Claude Code and Cursor plugin manifests.
📖 OpenAI Codex Sub-Agents Documentation
For more about how workflows work in factory engineering, see Workflows.