Appearance
Task / Agent Tools (Codex CLI)
In OpenAI Codex, what Claude users might call "Task tools" are implemented through a combination of built-in agent operations (read, write, edit, run) and Model Context Protocol (MCP) servers you configure in ~/.codex/config.toml
.
OpenAI's own documentation states clearly: "Codex agents can read, modify, and run your code", and may be extended with external servers (filesystem, fetch, memory). These are the primitives Codex uses to act on your project.
How Codex executes tasks
By default, Codex interacts cautiously with its tools, depending on the approval mode:
- Read Only: Only file reads (
read
), directory listings (ls
), searches (grep
), and MCP fetches are permitted. - Auto: Allows local file edits and command execution inside the workspace, but still blocks network access unless approved.
- Full Access: Expands permissions, but still requires explicit confirmation for out-of-workspace or network actions.
This layered approach mirrors multi-threaded programming: you can "spawn" multiple reads/searches in parallel, but actual write operations are gated to prevent conflicts.
Delegating work: CLI vs Cloud
Codex doesn't literally create sub-agents, but delegation is achieved through its two runtimes:
- Codex CLI (local): You can run interactive sessions or fire off isolated jobs with
codex exec "…"
. Each job uses the same toolset but executes independently—like lightweight threads. - Codex Cloud: Every background task gets its own container, enabling many jobs to run in parallel (e.g. generate tests, refactor modules, review PRs). You can launch these from the web app, IDE, iOS, or even GitHub mentions.
Balancing efficiency and cost
Because Codex is billed per token, spawning too many granular tasks can inflate costs. OpenAI's pricing makes this explicit: both input and output tokens are charged.
Practical strategies:
- Batch related tasks (e.g. config + docs updates).
- Reserve Cloud parallelism for independent, large jobs.
- Keep prompts minimal and structured to save tokens while guiding Codex effectively.
Example: AGENTS.md for tool orchestration
markdown
# Feature Implementation Guidelines
## Execution Rules
- APPROVAL: Start in Read Only; escalate to Auto only for file edits
- GROUP: Combine small updates (config/docs) in one task
- PARALLEL: Use Cloud for long, independent jobs
## Workflow Steps
1. Component: create component file
2. Styles: generate CSS/TS styles
3. Tests: add Jest tests
4. Integration: update imports/exports
5. Docs/Config: package.json + README
## Context Optimization
- Strip comments before analysis
- Restrict each task to its file scope
- Preserve naming conventions and structure
This pattern encodes what Codex may touch, how tasks should be grouped, and when parallelism is justified.
Engineering mindset
Think like a systems engineer:
- Queue tasks with explicit boundaries.
- Run jobs in parallel containers (Cloud) when safe.
- Gate risky operations with approval modes (CLI).
Codex's task/tool system is deliberately conservative. But with explicit orchestration in AGENTS.md
and strategic use of Cloud, you can scale from single-threaded local edits to multi-threaded, parallel AI development—without losing control.
Sources
- Codex CLI docs — approvals,
exec
, OS/runtime support. - Introducing Codex (OpenAI) — AGENTS.md as project guide; agent design.
- Codex Cloud docs — sandboxed, parallel background tasks from multiple entry points.
- OpenAI Pricing — token-based billing.