Codex subagents icon

Codex subagents

Codex subagents let Codex split work across specialized agents that run in parallel and return a consolidated response. It supports custom agents with distinct instructions and model settings, and activity is surfaced in the Codex app and CLI.

Codex subagents

Overview

Codex subagents let Codex split a task into specialized agents that can run in parallel and then return a consolidated response. The workflow is designed for work that benefits from delegation, such as codebase exploration or planning a multi-step change.

The product also supports custom agents with different model configurations and instructions, alongside built-in agents for general-purpose, execution-focused, and exploration-heavy tasks. Current releases enable subagent workflows by default, and activity is currently surfaced in the Codex app and CLI.

Features

Parallel subagent workflows

Codex can spawn specialized agents in parallel and then combine their results into one response, which is useful for tasks that can be split into independent pieces.

Built-in orchestration

Codex handles the orchestration layer for you, including spawning subagents, routing follow-up instructions, waiting for results, and closing agent threads.

Custom and built-in agents

You can define custom agents with their own instructions and model settings, or use the built-in `default`, `worker`, and `explorer` agents provided by Codex.

Current product surfaces

Subagent activity is available in the Codex app and CLI today, with IDE Extension visibility noted as coming soon.

Inherited permissions and sandboxing

Subagents inherit the current sandbox policy and live runtime overrides, including session changes such as `/permissions` or `--yolo` when spawned from an interactive session.

Configurable agent files

Custom agents can be configured with optional settings such as `model`, `model_reasoning_effort`, `sandbox_mode`, `mcp_servers`, `skills`, and `nickname_candidates`.

Use Cases

  • Parallel PR review

    Split a code review or PR audit into separate agents so each one can focus on a specific concern, such as security, bugs, race conditions, test flakiness, or maintainability.

  • Multi-step feature planning

    Break a large implementation plan into smaller subagents that work at the same time and then merge their findings into a single summary.

  • Codebase exploration

    Use an exploration-oriented agent to map a codebase, gather evidence, or inspect related files before a developer makes a change.

  • Specialized team workflows

    Create narrow custom agents for distinct jobs, such as review, implementation, or documentation lookups, when one generic prompt is too broad.

  • Thread management during active work

    Switch between active agent threads in the CLI, inspect an ongoing thread, or steer, stop, and close subagents during a session.

Pros and Cons

Pros

  • Useful for highly parallel tasks such as codebase exploration or reviewing multiple points in a PR.
  • Codex manages agent orchestration, which reduces manual thread coordination.
  • You can tailor custom agents with different instructions, models, sandbox settings, and MCP servers.
  • Subagents inherit the current sandbox policy and live runtime overrides from the parent session.

Cons

  • Each subagent performs its own model and tool work, so these workflows consume more tokens than comparable single-agent runs.
  • Subagent activity is currently surfaced in the Codex app and CLI; IDE Extension visibility is still coming soon.
  • The docs warn that deeper recursive delegation can increase token usage, latency, and local resource consumption.

FAQ

Is subagent support enabled by default?

Codex currently enables subagent workflows by default. In the app and CLI, you can ask Codex to spawn specialized agents for a task, and the IDE extension visibility is listed as coming soon.

Where can I see subagent activity?

Subagents are surfaced in the Codex app and CLI. The source notes that visibility in the IDE Extension is coming soon.

Does Codex create subagents automatically?

Codex can spawn subagents only when you explicitly ask it to. It does not automatically create child agents for every task.

Can I create custom agents in Codex?

Yes. The product page says you can define custom agents with different model configurations and instructions, and Codex also ships with built-in agents such as default, worker, and explorer.

How are custom agents configured?

Custom agents are defined as standalone TOML files under `~/.codex/agents/` for personal agents or `.codex/agents/` for project-scoped agents.

Quick Facts

Category
Developer Tool
Product
Codex subagents
Primary surfaces
Codex app and CLI
Availability
Enabled by default in current releases
Custom agent format
Standalone TOML files
Source domain
developers.openai.com

Alternative a Codex subagents