What is the difference and connection between Main Agent, SubAgent and Goal in Codex?
The Main agent is the one who is currently talking to you.
It is responsible for understanding the objectives, operating documents, running commands, communicating with you, and finally integrating the results.
By default all tasks are done by the main agent.
Subagent is a subagent explicitly dispatched by the main agent.
It is suitable for doing side tasks in parallel, such as: - A subagent checking code structure - A subagent running tests/positioning errors - A subagent implementing a certain independent module - The main agent is also doing mainline integration.
However, in the current Codex rules, you can not open subagent automatically.
It will only be enabled if you explicitly say “do it with subagent/parallel proxies/a few agents”.
Goal goal is more like a "task goal recorder/long-term task status".
It records: - whether to complete - optional token budget - the current progress status Goal itself will not perform the work, or the main agent execution, if necessary, the main agent then adjusts the subagent.
Relationship can be simplified to: Goal = Goal to be completed Main agent = Project leader/General controller Subagent = Parallel performer dispatched by main agent A typical usage is: Goal: Fix flyer Codex bridge Main agent: - Read logs - Develop protocols - Modify core code - Integration results - Reply to you Subagent A: - Dedicated analysis Codex provider Subagent B: - Dedicated analysis Feishu CardKit Subagent C: - Dedicated run test and check logs and Claude Code The biggest difference: Claude Code You may often use Task/subagent to explore; Codex here is more restrained, the default main agent single line execution, only you explicitly require "open subagent parallel" will be used.
