What this thread does
Do first: create .codex/agents/reviewer.toml for the project reviewer.
When you need it
Use a custom agent when a local Codex client needs a focused review role with its own instructions and model settings. The page's reviewer example targets correctness, security, regressions and missing tests.
Steps
1. Put one custom agent in .codex/agents/reviewer.toml. The page's complete reviewer definition is:
name = "reviewer"
description = "PR reviewer focused on correctness, security, and missing tests."
model = "gpt-6.2-sol"
model_reasoning_effort = "medium"
developer_instructions = """
Review code like an owner.
Do not edit files.
Prioritize correctness, security, behavior regressions, and missing test coverage.
Lead with concrete findings, include reproduction steps when possible, and avoid style-only comments unless they hide a real bug.
"""
2. In a local Codex client, explicitly ask Codex to use the reviewer agent to review the branch against main. The page's PR-review prompt assigns reviewer to find real risks; its other named roles are separate custom agents.
Check it worked
In the interactive CLI, use /subagents to inspect agent threads. In the app, open the subagent thread shown in the main chat's activity to inspect the review and returned result. Codex identifies this custom agent by name, so look for reviewer.
Limits
name, description and developer_instructions are required. The agent inherits parent permissions, provider and MCP servers; the TOML file cannot replace them. Asking it to avoid edits does not create a separate read-only sandbox. The example uses gpt-6.2-sol; the page advises a model available in every client if the same agent also runs in the IDE extension. For this custom-agent feature, the page does not name a version.
Not for: setting up Claude Code roles and orchestration; see claude-code-multi-agent-roles-and-orchestration.
Sources
- Subagents, Codex documentation, read 2026-11-24: "Each file defines one custom agent."
Checked
2026-11-24; read <https://learn.chatgpt.com/docs/agent-configuration/subagents.md#example-1-pr-review>; no command was run.
Started from a post by @OpenAI, packaged by the editor. Original post