cowboylogic/ai-dev/agent-creator-codex

Claude Code and agent skill by cowboylogic/ai-dev

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Guide for creating custom subagents for OpenAI Codex (standalone TOML files in .codex/agents/ or ~/.codex/agents/, each with name, description, and developer_instructions). Use this skill whenever a user wants to build, configure, review, or modify a Codex agent, choose fields (model, model_reasoning_effort, developer_instructions, and the other keys a role file can actually set), tune the [agents] table in config.toml (concurrency, default subagent model), or troubleshoot a Codex agent that is not found, never spawned, on the wrong model, or unexpectedly writing files or missing MCP servers. ALWAYS load this skill before writing or debugging Codex agent files.

Install

npx vskill@latest install cowboylogic/ai-dev/agent-creator-codex

SKILL.md

The same SKILL.md was published earlier as cowboylogic/ai-dev/agent-creator-codex.

Codex Agent Creator

Codex custom agents ("subagents") are standalone TOML files. Each file defines one agent and is loaded as a configuration layer for the sessions Codex spawns. Unlike Claude Code and Copilot agents there is no Markdown body: the system prompt is the developer_instructions string inside the TOML.

[!IMPORTANT]
A role file customizes the child; it never replaces the parent session's authority.
Codex applies only a bounded set of keys from it (see What a Role File Can Set).
sandbox_mode, approval_policy, and mcp_servers parse without error but are
ignored. The child runs under the parent session's sandbox, approvals, and MCP servers.
Codex only delegates when asked. It never spawns a subagent on its own initiative unless
the prompt, an applicable AGENTS.md, or a skill requests delegation. An agent file that
loads correctly can still sit unused. See Invocation.
The official subagents page says the same: sandbox_mode, approval_policy,
model_provider, and mcp_servers in a custom agent file "don't override the parent
configuration". The Codex source and its tests at rust-v0.163.0 agree: a role "must not
control" them. See What a Role File Can Set.

Verified against Codex CLI 0.166.0 (released 2026-10-29, the latest stable release when this skill was last reviewed on 2026-11-01). Role-file behavior was re-checked in the source at rust-v0.166.0 against rust-v0.163.0; the CLI behavior checks with codex doctor were run on 0.163.0 and the 0.166.0 binary was not run.

Official docs: <https://developers.openai.com/codex/subagents> (redirects to learn.chatgpt.com/docs/agent-configuration/subagents). Config keys: <https://developers.openai.com/codex/config-reference>.


When to Use This Skill

  • Creating a new Codex agent file
  • Choosing or fixing fields, and knowing which ones Codex actually applies
  • Setting spawn limits and defaults in the [agents] table of config.toml
  • Diagnosing an agent that is not found, never delegated to, or running with the wrong model

or permissions

  • Reviewing an agent file before committing it to a repository

For Codex settings generally (approvals, profiles, providers, hooks), read the Codex config reference. For repository-wide instructions, use AGENTS.md, not an agent file.


Quick Decision Guide

NeedApproach
Isolated context, narrower tools, or a different model for a side taskCustom agent (this skill)
Instructions every session in a repo should followAGENTS.md
Reusable procedure the main agent loads on demandSkill (SKILL.md)
Parallel work with no custom behaviorBuilt-in default, worker, or explorer
A role defined next to other config in one file[agents.<name>] table in config.toml

Agent File Format

toml
name = "pr_explorer"
description = "Read-only codebase explorer for evidence gathering. Use before proposing changes."
model = "gpt-6-luna"
model_reasoning_effort = "high"
developer_instructions = """
Stay in exploration mode. Trace real execution paths, cite files and symbols,
and avoid proposing fixes. You never edit files. Prefer fast search over broad scans.
"""

Required fields. A file that omits or blanks any of them is ignored with a warning, not rejected loudly (see Load Failures):

FieldPurpose
nameThe identifier Codex uses to spawn or refer to the agent. Authoritative over the filename
descriptionGuidance shown when Codex chooses an agent: what it does and when to use it
developer_instructionsThe agent's system-prompt-level instructions. Must not be blank

Everything else is optional. Load references/config-reference.md for the full field list and the [agents] table.

Rules that avoid load failures:

  1. Valid TOML. Use """ multi-line strings for developer_instructions.
  2. Keep name unique across project and personal scope (files are discovered recursively). Use snake_case or kebab-case

consistently and match the filename to it (pr_explorer.toml).

  1. Top-level keys go before any [table] header. A key placed after a [table] header

belongs to that table, not to the agent.

  1. Field names are snake_case, and unknown keys make the whole file invalid. Do not carry

over disallowedTools, tools, or permissionMode; Codex has no such keys.


What a Role File Can Set

Verified in the Codex source at tag rust-v0.163.0 (codex-rs/core/src/agent/role.rs, described there as "bounded agent-role overrides"), and by the upstream test codex-rs/core/src/agent/role_tests.rs, which asserts the role layer holds none of openai_base_url, chatgpt_base_url, model_provider, approval_policy, sandbox_mode, notify, apps, or mcp_servers:

KeyEffect on the spawned agent
developer_instructionsReplaces the role's instructions
model, model_reasoning_effortApplied, and locked: the spawn UI tells the model these "cannot be changed"
model_reasoning_summary, model_verbosity, personalityApplied
features.<name> = falseDisables only shell_tool, apps, plugins, memories (legacy key memory_tool), request_permissions_tool
skills.config entries with enabled = false, skills.bundled.enabled = false, skills.include_instructions = falseDisables inherited skills. Cannot enable anything

Every other key, including sandbox_mode, approval_policy, mcp_servers, web_search, features.<name> = true, and service_tier, is dropped. The spawn code applies the root session's service tier after the role, so a role-file service_tier never survives (the official page says the same: "The service tier also follows the root session's preference"). The file still loads, so nothing warns you. Configure sandbox, approvals, and MCP servers on the parent session or its config.


Where Agent Files Live

ScopeLocation
Project.codex/agents/ (loaded only when the project is trusted)
Personal~/.codex/agents/ ($CODEX_HOME/agents/)
Config table[agents.<name>] in config.toml, with config_file pointing at a TOML layer

Built-in agents default, worker, and explorer can be overridden by defining a custom agent with the same name.

[!NOTE]
Two files with the same name in one directory: Codex warns and drops the duplicate.
The same name in project and personal scope raises no warning, and the winner could not
be observed without a model call. Keep names unique across scopes.

Model and Reasoning Effort

toml
model = "gpt-6-luna"
model_reasoning_effort = "high" # low | medium | high | xhigh | max | ultra (model dependent)

Precedence: the role file's model and model_reasoning_effort are applied after the spawn-time and [agents] values, so they win over an explicit spawn value and over agents.default_subagent_model / agents.default_subagent_reasoning_effort. Those defaults only apply to roles that do not set the field. A role file that sets only model keeps the effort already resolved (spawn value, then [agents] default, then the parent's, or the chosen model's default effort when a spawn value or [agents] default selected the model without one), so set model_reasoning_effort too when that model does not support the inherited level. If an agent runs on an unexpected model, the usual causes are a different role being spawned, the role file failing to load (check the startup warnings), or the model or effort being rejected by the account.

Valid model names and effort levels depend on the account and Codex build. Run codex debug models to list the catalog and each model's supported effort levels.


Sandbox, Approvals, and MCP

A role file cannot set any of these. Codex copies the parent's live runtime policy onto the child, so:

  • The child inherits the parent's sandbox policy, approval mode, and MCP servers.
  • --yolo and /permissions changes on the parent apply to spawned agents.
  • sandbox_mode in a role file parses (an invalid value still produces a load warning) and

then has no effect. A "read-only" reviewer is read-only only if the parent session is.

  • MCP servers a role needs must be configured in the parent's config.toml. List them as a

prerequisite in the agent's documentation, and name them in developer_instructions.

  • To keep a role from writing, say so in developer_instructions and start the parent

read-only (codex --sandbox read-only). To keep it from running commands at all, set features.shell_tool = false in the role file.

  • In interactive CLI sessions, approval requests from inactive agent threads can surface in

the main view. Press o to inspect the request before approving.

Avoid danger-full-access on any parent session that spawns agents you did not write.


Invocation

Codex delegates when one of these is true:

  • Explicit request. Ask for it: "Spawn one pr_explorer per module and summarize."
  • Instruction-based. An applicable AGENTS.md or skill tells Codex to delegate.

In ChatGPT Work (the hosted web surface), Ultra intelligence level can also delegate proactively. The subagents page says local Codex releases spawn agents only after a direct request or applicable project or skill instructions.

To make an agent get used, name it in the request or in AGENTS.md, and write a description that names the trigger. Good: "Read-only reviewer. Use after any change under src/auth/". Bad: "Helps with code".

Global limits live in config.toml:

toml
[agents]
enabled = true # multi-agent tools on/off (default true)
max_concurrent_threads_per_session = 4 # spawned threads, excluding the primary
default_subagent_model = "gpt-6-luna"
default_subagent_reasoning_effort = "medium"

agents.max_threads is the legacy alias for max_concurrent_threads_per_session; the public config reference lists it. agents.interrupt_message (default true) controls whether a model-visible message is recorded when an agent turn is interrupted. agents.max_depth limits nesting for V1 agent threads and is ignored by V2. agents.job_max_runtime_seconds is a removed setting kept as a no-op. Neither of those two is in the public config reference; both are accepted without error in 0.163.0.

[!WARNING]
Under [agents], any key Codex does not know is parsed as a role table. A typo such as
max_thread = 3 is a fatal startup error (failed to load bootstrap configuration,
caused by `invalid type: integer 3, expected struct AgentRoleToml in agents `),
unlike a bad agent file, which is only skipped.

Writing the Prompt (developer_instructions)

The agent sees this text plus whatever the spawn request passes it. It does not see the parent conversation. Write it so it works from a delegation message alone:

  1. Role in one sentence.
  2. Scope: what it reads, what it may change, what it must not touch.
  3. Method: the steps or checks, in order of importance.
  4. Return format: exactly what the parent needs back (findings with path:line, a diff

summary, pass/fail).

  1. Stop conditions: when to return instead of continuing.

Narrow, opinionated agents work best. Split a "does everything" agent into a reader and a writer. Load references/agent-examples.md for complete files.


Creating an Agent: Step-by-Step

Step 1: Plan
  1. One sentence for the role, and what it does not do.
  2. Scope: project (.codex/agents/, committed for the team) or personal (~/.codex/agents/).
  3. Model and effort (cheaper and lower for read-heavy exploration; stronger for design and

review), then what the parent session must provide: sandbox policy and MCP servers.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/cowboylogic/ai-dev/agent-creator-codex/badge)](https://verified-skill.com/skills/cowboylogic/ai-dev/agent-creator-codex)

Something wrong with this skill or its page? Tell us.