The Small File That Controls Big Codex Work

The Small File That Controls Big Codex Work

TL;DR: A Codex sub-agent TOML file tells Codex what specialist role an agent should play, what model it should use, and how much reasoning effort it should apply. That matters because planning, implementation, and review are not the same kind of work. Good delegation matches model strength to task complexity, which improves plan quality and keeps token usage from drifting.

A Codex sub-agent is usually defined in a small TOML file under a path such as `.codex/agents/feature-planner.toml`.

That file can look simple at first glance. It has a name. It has a description. It has instructions. But the important part is that it can also name the model and reasoning level for that agent.

In pm_bot, the feature planner is configured with fields like:

```toml
model = "gpt-5.5"
model_reasoning_effort = "medium"
```

The implementation engineer uses a different model:

```toml
model = "gpt-5.4"
model_reasoning_effort = "medium"
```

That is not decorative configuration. It is a way to say, "This kind of task deserves this kind of thinking."

Planning is usually ambiguity-heavy. The planner has to understand current behavior, find invariants, map affected files, identify risks, and sequence the work. If that step is shallow, the rest of the build becomes more expensive. You may save tokens at the start, but you spend them later through rework, confused implementation, missed tests, or bad assumptions.

That is why a stronger planning model can be worth it. It is not about using the largest model everywhere. It is about using enough capability where the cost of a weak answer is high.

Execution is different. Once the plan is clear, the implementer often needs to make scoped changes, follow existing patterns, update types and tests, and avoid unrelated refactors. That work still needs competence, but it may not need the same model choice as broad architecture planning. A well-scoped implementation agent can run on a more cost-efficient model because the expensive thinking has already narrowed the problem.

Review is different again. A reviewer needs judgment: what could break, what boundary was crossed, where validation is weak, and whether the implementation drifted from the plan. In pm_bot, the senior reviewer is configured as a separate specialist because final judgment should not be blurred into the same role that wrote the code.

The practical point is this: the TOML file lets you turn delegation into an operating system.

The `name` and `description` explain when the agent should be used. The `developer_instructions` define the role, guardrails, and expected output. The `model` and `model_reasoning_effort` fields define the compute profile for that work.

This gives you a simple decision rule.

Use higher-capability planning when the task is ambiguous, stateful, cross-cutting, or risky. Use a focused execution agent when the plan is already clear. Use a reviewer when correctness matters enough that the work should be challenged by a separate role. Avoid sending every task to the same agent with the same model just because it is convenient.

That discipline helps with token cost in two ways.

First, it prevents underpowered planning. A weak plan can cause long loops: rereading files, changing direction, fixing avoidable mistakes, and explaining the same context repeatedly. Those loops burn tokens.

Second, it prevents overpowered execution. Not every narrow code edit needs the highest-capability model. If the role is constrained and the assignment is precise, a cheaper execution path can often do the work cleanly.

The deeper lesson is that model choice is part of workflow design.

A sub-agent TOML file is not just a place to store prompts. It is a place to encode judgment: which jobs need deeper reasoning, which jobs need disciplined execution, and which jobs need independent review.

When that mapping is done well, Codex becomes easier to manage. Plans get more accurate. Execution gets more efficient. Reviews get more focused. And token usage becomes an intentional tradeoff instead of an accidental bill.

-----------
If you find this content useful, please share it with this link: [https://patrickmichael.co.za/subscribe](https://patrickmichael.co.za/subscribe)

Classification