Skip to content
Fluf
Beta

We are actively shipping every day for Fluf.

New things land daily and the product keeps getting better. Tell us what to fix or build next: we read every message.

Codex agents: subagents, codex exec and agents that keep working

Codex agents run in the CLI, IDE, ChatGPT app and cloud. How subagents, codex exec and scheduled tasks work, and how to make Codex agents persistent.

A blue Fluf wearing a headset between a cobalt Fluf and a coral Fluf, under a lilac sky.
On this page

Part of How Fluf runs Claude Code with your own login (2026 rules)

Codex agents are OpenAI's coding agents, and in 2026 they run in five places: the Codex CLI in your terminal, the IDE extension, the Codex mode of the ChatGPT desktop app, ChatGPT on the web, and Codex cloud. Inside any of them, Codex can split work across subagents, which are on by default. Outside them, codex exec runs an agent in a script or CI, and scheduled tasks run one on a timer. This guide covers each, with the real flags and config keys, then the piece Codex leaves to you: an agent with a name, a memory and a schedule that outlives any single chat.

What a Codex agent is in 2026

The CLI is the open part. It is "a coding agent from OpenAI that runs locally on your computer", licensed Apache-2.0 and written mostly in Rust (openai/codex). Install it with npm install -g @openai/codex or brew install --cask codex. The IDE extension and Codex cloud are not open source.

SurfaceWhere it runsGood for
Codex CLIYour machinePairing on code in a terminal
IDE extensionYour editor (VS Code, Cursor, JetBrains, Xcode)Changes next to the file you have open
ChatGPT desktop app, Codex modeYour machine, parallel chats in worktreesSeveral tasks in one repo at once
Codex cloudOpenAI's machinesTasks that keep going while your laptop sleeps
codex exec and the GitHub ActionScripts and CIOne-shot jobs on a trigger

All of them read AGENTS.md before they start work: a global file in your Codex home, then one per directory from the project root down to where you are, capped at 32 KiB by default (AGENTS.md docs). Configuration lives in ~/.codex/config.toml, with a project-level .codex/config.toml in trusted projects.

Codex subagents

A subagent is "a delegated agent that Codex starts to handle a specific task" (subagents docs). They are enabled by default and show up in the desktop app, the CLI and the IDE extension. The knobs sit in config.toml:

[agents]
enabled = true
max_concurrent_threads_per_session = 4
default_subagent_model = "gpt-6.1-terra"
default_subagent_reasoning_effort = "medium"

The pattern that pays: a strong model on the main thread, a fast cheap one for subagents that search, read logs or run tests. The Ultra reasoning level uses subagents on its own, so you get fan-out without writing config.

Apache-2.0Licence of the Codex CLI
32 KiBDefault AGENTS.md size cap
15Codex-managed worktrees kept by default

From OpenAI's Codex docs and the openai/codex repository, checked 27 November 2026.

Running Codex agents unattended

codex exec. The non-interactive mode. The final message goes to stdout, progress to stderr. Add --json and stdout becomes a JSON Lines stream of every event. codex exec resume <SESSION_ID> picks a run back up with the same working directory and permissions (non-interactive docs).

codex exec --sandbox workspace-write --json \
  "Run the test suite, fix the failing snapshot tests, summarise what changed"

Two things trip people up. codex exec "runs in a read-only sandbox" by default, so it cannot edit anything until you widen it. And --full-auto "is no longer supported": use --sandbox workspace-write.

The GitHub Action. openai/codex-action@v1 runs codex exec inside a workflow with the sandbox you choose. OpenAI recommends API keys for CI and warns against setting OPENAI_API_KEY as a job-level environment variable.

Scheduled tasks. Formerly called automations, they "run tasks on a schedule or from supported app events", including Gmail, Slack and GitHub events on eligible plans. You manage them in the desktop app; the CLI has no scheduling interface. Tasks that need local files require you to "keep the computer on and the app running" (scheduled tasks).

Codex cloud. Each cloud task has its own workspace and keeps working while your computer sleeps. It requires signing in with ChatGPT and is not included with Free or Go.

Sandbox modes and approvals

Codex separates what the agent can touch (the sandbox) from when it asks (the approval policy). Per the sandboxing docs:

  • read-only: inspects files, cannot edit or run commands without approval.
  • workspace-write: "the default low-friction mode for local work."
  • danger-full-access: no sandbox restrictions.

In the app these surface as Ask for approval, Approve for me (an automatic reviewer approves on your behalf inside the same workspace-write sandbox) and Full access. The untrusted approval policy is gone. Our rule of thumb: workspace-write with approvals for anything you would review in a pull request, and danger-full-access only inside a container you can throw away.

Plans and limits

Codex is "included in your ChatGPT Free, Go, Plus, Pro, Business, Edu, or Enterprise plan" (pricing). Local messages and cloud chats share your plan's allowance, measured in five-hour windows, and "weekly limits may also apply." Pro "currently" has no five-hour limit. How far a window goes depends heavily on the model: OpenAI's own Plus estimates range from a handful of messages on the heaviest model to thousands on the lightest. An API key works too, at "separate API pricing, not your ChatGPT allowance."

That variance is the practical problem for agents. A long agent run on a heavy model can empty a Plus window before lunch.

Where Codex agents stop

Codex is an excellent coding agent. Its agents still end where a chat, a run or a task ends:

  • Memory is AGENTS.md. Instructions you write, per directory. No per-agent memory that learns from corrections and lets you review each fact.
  • No standing identity. A subagent is a thread, not a colleague with a history and an inbox.
  • Local schedules need an open app. Cloud tasks need a paid plan and run on OpenAI's machines, away from your local tools and network.
  • Approvals wait where the session is. In the terminal, or in the ChatGPT app.

Run Codex as persistent agents in Fluf

Fluf is a desktop app for Mac, Windows and Linux where you hire AI agents that keep their name, memory and schedule. Point an agent at Codex and it runs the Codex you installed, signed in with your own ChatGPT or OpenAI login. OpenAI's terms and your plan's limits apply, exactly as they do in your terminal.

Every Monday at 08:00, check our dependencies for releases with breaking changes and tell me what our code would need.
Otto
Routine set: Mondays 08:00. I'll read changelogs for anything we pin, then grep our code for affected calls.
Monday 08:00
Otto
2 of 31 dependencies have breaking releases. The payments SDK renames createIntent in 4 files; the diff is drafted on otto/payments-sdk-7. The date library change does not touch our code.
Otto wants to open a pull requestchore(deps): payments SDK 7 with renamed callsApproveDecline

What Fluf adds:

  • Agents that stay. Otto keeps his chat, results and decisions week after week.
  • Memory you can edit. Scoped to one agent, a team, a business or you. Correct it once and it sticks. See Memory.
  • Routines that run where you want. Cron, webhooks, heartbeats, "after another agent finishes". On your laptop, or on an always-on server so they run with the lid closed (run AI agents 24/7).
  • Approvals on your phone. Gated steps arrive as cards with Approve and Decline, in the app, on your paired phone or in Telegram.
  • Codex's own levels. Fluf lists the reasoning levels and service tiers your Codex install reports, including Fast where your account has it (Models, effort and speed).
  • Usage you can see. App settings › AI accounts shows each Codex login's windows and reset times. When one runs out, agents can continue on an API key you allowed and switch back when it resets. Fluf never switches between ChatGPT accounts: OpenAI's rules forbid it.
  1. 1Install Codexnpm or Homebrew, then sign in
  2. 2Connect it in FlufApp settings › AI accounts
  3. 3Hire an agentA name, a job, a model
  4. 4Give it a routineMondays at 08:00
Choosing a Codex model for a Fluf agent in the model picker
Put one agent on Codex and another on Claude Code or a local model.

Codex or Claude Code?

Many developers run both: Codex on the ChatGPT plan they already have, Claude Code on a Claude plan, each agent on whichever fits its job. We compare them directly in Claude Code vs Codex, and cover Anthropic's side in Claude Code agents. For the rules on using your own plans, start with our pillar on running AI employees on your subscription.

Download Fluf, connect the Codex you already use, and give your first agent a Monday routine.

Questions people ask

Does Codex support subagents?
Yes. Subagents are on by default in the ChatGPT desktop app, the Codex CLI and the IDE extension. You cap them with agents.max_concurrent_threads_per_session and can set a default model and reasoning effort for them in config.toml.
How do I run Codex without the interactive terminal?
Use codex exec. It prints the final message to stdout, streams JSON Lines events with --json, and runs in a read-only sandbox unless you pass --sandbox workspace-write. Resume a run later with codex exec resume and the session ID.
Is Codex included in ChatGPT Plus?
Yes. OpenAI's docs say Codex is included in ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise. Codex cloud is not included with Free or Go, and usage follows five-hour and weekly windows, except that Pro currently has no five-hour limit.
Can Codex agents run while my computer is asleep?
Codex cloud tasks can, because they run on OpenAI's machines. Scheduled tasks that touch local files need the computer on and the app running. To keep local Codex agents working around the clock, run them on an always-on machine you own.

Sources

  1. Codex: Subagents, checked 27 November 2026
  2. Codex: Non-interactive mode, checked 27 November 2026
  3. Codex: Sandboxing, checked 27 November 2026
  4. Codex: Pricing and usage, checked 27 November 2026
  5. Codex: Scheduled tasks, checked 27 November 2026
  6. Codex: AGENTS.md, checked 27 November 2026
  7. openai/codex on GitHub, checked 27 November 2026

TopicsCodexOpenAIDevelopersSubscriptions

    Search every docs page: setup, agents, models, memory, routines, chat apps and reference.