Definition
A Codex cloud environment is the saved configuration Codex uses to build the container a cloud task runs in: which repository, which image, which setup commands, and what variables and internet access the agent gets.
Also called: Codex environment, cloud environment.
You create environments in Codex's settings on chatgpt.com. Each one has an id, which is what codex cloud exec --env <ENV_ID> expects.
| Part | What it does |
|---|---|
| Repository | checked out at the chosen branch or commit |
| Image | the default universal image has common languages and tools; versions can be pinned |
| Setup script | installs dependencies; internet is available while it runs |
| Maintenance script | optional; runs when a cached container is resumed |
| Environment variables | available for the whole task |
| Secrets | encrypted and available only to the setup script |
| Agent internet access | off by default during the agent phase; can be allowed |
Codex caches a prepared container for up to 12 hours so later tasks start faster, and throws the cache away when the setup script, maintenance script, variables or secrets change. Claude Code has a similar idea for its cloud sessions, also called a cloud environment.
In Pairbar
Pairbar can send a new chat straight to Codex Cloud once it knows which environment to use. In the composer, Cloud → Set environment saves an environment id for the repo; after that, choosing Cloud runs codex cloud exec from the repo on its current branch and opens the task's page. Without one, Codex's own new chat opens with your text typed, and a guide card explains what's left. See the composer and the setup guide.
Frequently asked questions
- Does a Codex cloud task have internet access?
- During the setup script, yes, so dependencies can install. During the agent phase it's off by default unless you allow it in the environment's settings.
- Where do I find a Codex environment id?
- In Codex's environment settings on chatgpt.com. Pairbar asks for it once per repo under Cloud → Set environment.
- Why did my cached container get rebuilt?
- Codex drops the cache after 12 hours or when the setup script, maintenance script, environment variables or secrets change.
Related
- GuideSet up a Codex Cloud environment and start cloud tasks from PairbarCreate a Codex Cloud environment, save its id per repo in Pairbar, start cloud tasks from the composer and follow them in the list.
- GlossaryCodex cloud taskA job Codex runs in an OpenAI-hosted container set up from one of your cloud environments, returning a summary and a diff.
- Use caseTrack Codex cloud tasks and Claude Code cloud sessions next to your local chatsClaude Code cloud sessions and Codex cloud tasks in the same list as local chats, grouped by repo, with needs-you and working status.
- DocsNew chatsThe composer: app, folder, branch, worktree, agent, skills, model, effort, mode, cloud; searchable pickers, remembered choices, and the Claude-or-Codex suggestion