Codex: cloud, subagents, skills and MCP to delegate
The short answer. Four mechanisms let you do with Codex more than you can follow by hand. Codex Cloud runs a task in a remote environment with its own workspace and carries on even with your computer off; it costs setup, forces you to send the code elsewhere, and is not available with only an API key. Subagents launch several agents in parallel from the same session: they speed up read-only investigations, but consume more tokens and are not suited to simultaneous writes. Skills package repeatable instructions, callable with a $ mention. MCP connects the agent to external tools, and every MCP server is third-party code entering your workflow. The common discriminator: delegate what you can verify afterwards, keep by hand what you cannot undo. Part 7 of the OpenAI Codex series; data from the documentation of 30 October 2026.
Note. I read the pages on cloud, subagents, skills and plugins; I did not try them. The "Build skills" page and the detailed MCP configuration were not reachable from my tool, and where data is missing I say so. I am not affiliated with OpenAI.
Codex Cloud: work that does not occupy your laptop
The documentation describes it like this: you give Codex a task, which works in the cloud; "each task has its own workspace and can keep working while your computer is asleep". You can review results and continue from the web, the phone or the desktop app. You can also start cloud work from the CLI with codex cloud, which browses and submits tasks and then applies the results to your local repository.
Environments
An environment holds the repositories, tools and access a project needs. To create one you choose GitHub repositories; Codex "inspects the project, works through setup, and asks you for missing details or access". Then you review the setup and the test results, save and publish: tasks start from a published environment. Dependencies and tools carry across tasks and you can update the setup as the project changes.
Network, secrets, known limits
Network settings include public internet access, package-manager domains and additional allowed domains. For services that need credentials you can add HTTP secrets; the page warns that saving an HTTP secret also allows access to its domains. Environment variables are also set in the environment. These are two real security choices: every allowed domain is a possible exit channel, every saved secret is a credential living off your machine. Cautious rule: give the cloud environment credentials with least privilege, read-only if the task is an investigation.
What the page does not say: no usage or resource limits for the cloud, and nothing on how much quota it consumes (check your account dashboard). It does say that VPN access is not available for an environment.
When the cloud pays off, and when not
- It pays off: long, independent tasks (a mechanical migration, a set of tests to write, a bug investigation), several tasks in parallel, work to start from the phone, results that arrive as changes to review or as pull requests.
- It does not: tasks that depend on your local environment (a local database, hardware, data that cannot leave), exploratory work where you want to correct course every minute, repositories not on GitHub (environment creation starts from GitHub repositories).
- Not available: with only an API key. The Pricing table excludes cloud features from key-based access.
The trade-off is the same as any delegation: you gain waiting time, you lose the ability to stop the agent halfway with one word. Compensate with well-bounded tasks and a definition of done written into the prompt (part 2).
Subagents: parallelism of reading, not of writing
A subagent is a delegated agent that Codex starts for a specific task. Codex runs them in parallel and combines their results in one response. The built-in ones are default, worker and explorer. You do not "launch" them from a file: you ask for them in the prompt ("spawn one agent per point and wait for all of them"), and Codex handles spawning, routing follow-ups, waiting and closing threads. They can also be requested by instructions in AGENTS.md or in a skill.
Custom agents
Each custom agent is a TOML file: personal ones in ~/.codex/agents/, project ones in .codex/agents/. The file must define name, description and developer_instructions; it can set model and model_reasoning_effort and disable some capabilities (for example features.shell_tool or specific skills). A custom agent with the same name as a built-in one, such as explorer, takes precedence. Global values live under [agents], with keys such as enabled, max_concurrent_threads_per_session (a cap on open threads, excluding the primary), default_subagent_model and default_subagent_reasoning_effort.
The constraint that matters for security: subagents inherit sandbox and approvals from the parent turn and cannot override sandbox_mode, approval_policy, model_provider or mcp_servers. Delegating does not widen permissions (part 3).
Cost and sensible use
Each subagent does its own model and tool work, so a run with subagents uses more tokens than a single-agent one; higher reasoning also increases time and consumption. If you do not configure the subagent's model and effort, it inherits the parent's. The documentation recommends them for read-only, independent work such as exploration, tests, triage and summarisation, and for keeping noisy intermediate output off the main thread; it warns about parallel write-heavy work, because agents editing code together can conflict. For models it suggests gpt-6-luna for fast, narrow agents and gpt-6.1-sol for demanding multi-step work (cost comparison in part 5).
An example prompt consistent with this guidance: "Spawn three read-only agents: the first lists where the function calcDiscount is used, the second looks for tests covering it, the third looks for documentation citing it. Wait for all and summarise in a table". Three independent investigations, no writes, one summary. The opposite, "spawn three agents that modify the same module", is the recipe for a conflict.
Skills and plugins: instructions you can call
A skill, per the documentation, "packages instructions and supporting resources for a specific task or workflow": a name and description (with which the product recognises when it applies), working instructions, and resources such as templates, examples, schemas or connected tools. Codex can pick one on its own when the request matches, or you select it with a $ mention (in ChatGPT it is @). The example for creating one is $skill-creator. A plugin is an installable bundle that can include skills and MCP servers, and also lifecycle hooks for the Codex runtime; ChatGPT and Codex share the same plugin directory.
I cannot tell you where a skill's files live or how its manifest is written: the page that explains it ("Build skills") was not reachable. For the Claude Code analogue, where the mechanism is different, I wrote this guide, and for hooks this other one: the useful comparison is between concepts (reusable instructions, event interception), not between file names.
When is a skill worth it? When a task repeats at least three times with the same pattern and the same traps ("prepare the release", "accessibility audit of a page"). For a rule that always holds, AGENTS.md (part 4); for an on-demand flow, a skill. The cost is maintenance: an old skill describing a changed procedure is worse than no skill.
MCP: other people's tools, in your workflow
The CLI offers codex mcp to add local or remote MCP servers and inspect their tools. An MCP server exposes tools to the agent: access to GitHub, a database, a ticket system. The gain is that the agent stops working blind and reads the real data. The risks are three, and I state them as my own reasoning, not as documentation pages:
- It is third-party code. A local MCP server runs on your machine with your permissions. Install only from sources you would vet like a dependency.
- Its output is untrusted context. A ticket or page read through a tool may contain hostile instructions (prompt injection). The more tools you have, the more surface there is.
- Credentials. A token with too many privileges given to an MCP server becomes the agent's privilege. Give read-only tokens until something else is needed.
A detail useful in pipelines (part 6): if a server is marked required = true and does not start, codex exec fails instead of proceeding. Use it for tools without which the result would be misleading.
A reasonable adoption sequence
- For the first two weeks, only the local CLI and
AGENTS.md(parts 2 and 4). - Then read-only subagents for investigations: high gain, low risk.
- Then one skill for your most repeated task.
- Only then an MCP server, one at a time, with least-privilege tokens.
- The cloud last, when you have a bounded task and an environment with minimal credentials.
What I did not verify
I did not try any of the four mechanisms. I did not read the page on how to write a skill nor the syntax of the MCP server table in config.toml. I do not know how much quota cloud and subagents consume compared with an equivalent local session: for subagents the source only says they use more tokens.
Sources (consulted 30 October 2026)
- Codex Cloud (workspace, environments, network, HTTP secrets, VPN).
- Subagents (built-in agents, TOML files, limits, cost).
- Skills and plugins (
$mention, plugins, MCP). - Codex CLI (
codex cloud,codex mcp). - Non-interactive mode (
required = true). - Pricing (cloud features excluded with only an API key).
← Part 6: codex exec and the SDK Part 8: the honest comparison →
Commenti
Caricamento commenti...
Sign in to comment