This is more like agentic engineering 102/103.
Once you get past the basics and start working on more complex or very long-running problems, another issue starts showing up: context pollution and context rot.
Subagents are one way to get around that.
(1) Typically, the workflow starts with the human giving requirements, constraints, and decisions to the main agent.

(2) Then the main agent tries to handle the exploration, testing, and analysis needed to get the task done.

(3) Logs, notes, errors, and results all start flowing back into the same main thread.

(4) That is where context pollution and context rot start to show up.
- Context pollution: useful instructions get buried under noisy intermediate output.
- Context rot: as less relevant detail accumulates, performance drops and the session becomes less reliable over time.

(5) Subagents move noisy intermediate work off the main thread.

(6) They do the messy work separately and return summaries instead of raw output.

(7) That lets the main agent stay focused on requirements, constraints, decisions, and final outputs.

(8) It can keep going as new requirements come in without losing clarity.

(9) In Codex, you can do this with built-in subagents or define custom ones.

(10) And in practice, custom agents in Codex can be defined with a small TOML file.

Although I wrote this with Codex in mind, because that is where I live and where I have already started implementing it, only items (9) and (10) are Codex-specific.
The principles from (1) to (8) should apply to any other basic agent workflow too.