Use subagents and custom agents in Codex
Summary
OpenAI Codex has released subagents in general availability, a feature previously in preview. These subagents, similar to those in Claude Code, include default roles like "explorer," "worker," and "default." While the distinction between "worker" and "default" is not explicitly clear, "worker" appears designed for parallel execution of numerous small tasks. Codex also enables users to define custom agents via TOML files in `~/.codex/agents/`. These custom agents can be configured with specific instructions and assigned to particular models, such as `gpt-5.3-codex-spark` for enhanced speed. The documentation provides an example prompt demonstrating how to orchestrate custom agents like `browser_debugger`, `code_mapper`, and `ui_fixer` to diagnose and resolve software issues.
Key takeaway
For AI Architects designing automated development workflows, you should explore OpenAI Codex's subagent and custom agent capabilities. Defining custom agents with specific models like `gpt-5.3-codex-spark` can optimize performance for specialized tasks, while orchestrating multiple agents in a prompt allows for complex problem-solving, such as debugging and code remediation. This approach offers enhanced modularity and control over AI-driven development processes.
Key insights
OpenAI Codex now offers subagents and custom agents for modular, specialized AI-driven development tasks.
Principles
- Modular agents enhance task specialization
- Custom agents allow model-specific tuning
Method
Define custom agents in TOML files with specific instructions and model assignments, then orchestrate them by name within prompts to tackle complex development problems.
In practice
- Use "worker" subagent for parallel tasks
- Assign `gpt-5.3-codex-spark` for speed
- Orchestrate agents for debugging workflows
Topics
- OpenAI Codex
- AI Subagents
- Custom AI Agents
- AI Coding Assistants
- Multi-Agent Systems
Best for: AI Architect, AI Engineer, Machine Learning Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Simon Willison's Weblog.