How to hand a task to Codex Cloud and review it as a pull request

Day 4, 30 minutes · beginner

Goal of this lessonPublish a Codex Cloud environment for your repository, hand it a longer task and review the result as a pull request.

Why it matters

So far Codex worked in your terminal, on your computer, while you watched. That is fine for small changes. For a longer job you want to hand it off and do something else: close the laptop, go for lunch, check back later. Codex Cloud does that. Each task runs in its own workspace on OpenAI's computers, and the docs say it keeps working while your computer is asleep.

Handing work off only pays if you can check it quickly when it comes back. The best place for that check is the one developers already use: a pull request, where every changed line is shown and nothing reaches your main branch until you say so.

Today you put the Puffinreach Kites repository on GitHub, give Codex Cloud a longer task (a kite size guide page), bring the result back to your computer on a new branch, and review it as a pull request. At the end you have a full hand-off loop you can repeat for any job.

What you need

  • A ChatGPT plan with Codex Cloud. OpenAI's help center says Codex Cloud is available to eligible Plus, Pro, Business, Enterprise and Education accounts, subject to rollout and workspace settings, and not with Free or Go. Cloud also needs sign-in with ChatGPT: an API key is not enough. In an Enterprise workspace, cloud access is off until an admin turns it on.
  • No Codex Cloud on your plan? Then do this task in the terminal instead: start codex in your repository and paste the size guide task from the guide below. The rest of the course does not need the cloud.
  • A GitHub account. Codex Cloud checks out repositories through your connected GitHub (or GitLab) account.
  • Your repository from the earlier lessons, with AGENTS.md committed. The task prompt asks Codex to follow it.

Environments in one paragraph

An environment is the prepared computer a cloud task starts from: which repositories are checked out, which tools and packages are installed, and which internet access is allowed. When you create one, Codex inspects your repository, installs what it needs, tests the setup and shows you a setup report. You review it and publish it. From then on, every new task starts from that prepared state, and each task keeps its own files. A plain HTML site needs almost nothing, so this goes quickly today.

The steps

  1. Push the repository to GitHub, as a private repository.
  2. Create and publish an environment for it, from a new chat in ChatGPT on the web or in the desktop app.
  3. Hand over the task with a clear "done when", just like in the terminal. The prompt tells Codex to follow AGENTS.md.
  4. Review in the chat first. Read the changed files and the checks Codex ran. Ask for fixes in the same chat.
  5. Bring the result home. From your terminal, codex apply copies the latest diff of a cloud task into your local repository. Do it on a new branch.
  6. Open a pull request and review it on GitHub before you merge. Then switch back to main and pull, so your computer has the merged version.

Follow the guide for Codex below for the exact commands and screen names.

Why a branch and a pull request

You could merge the change straight into main. The pull request costs one minute and buys you three things: one screen with every changed line, a place to leave comments, and a record of why the change was made. It is also where a second check can run. If you set up Codex code review for this repository in your Codex settings, a comment with @codex review on the pull request asks Codex to review the diff, and it follows the review rules in your AGENTS.md.

The cloud chat itself may also offer to commit or open a pull request for you, depending on your setup. This lesson uses codex apply because every step of it is documented, and because you see the change on your own computer before it goes anywhere.

Example: Benthe's size guide

Benthe pasted the size guide task and closed her laptop. Back an hour later, the chat listed two changed files: a new size-guide.html and a link added to index.html. Codex had also compared the prices with prices.json and reported that none had changed. She spotted one thing in the chat: the table had no heading for the wind column. She asked for it in the same chat and checked the new version. Then, in her terminal, she ran codex cloud list --json --limit 5, copied the id of her task, made the size-guide branch and ran codex apply. The pull request showed exactly two files, and she merged it.

Common mistakes

  • Vague cloud tasks. You are not there to steer, so the prompt must say what done means.
  • Applying on main. Always make a branch first, so a bad result is one git switch main away from gone.
  • Skipping the review because "it ran in the cloud". The sandbox protects your computer, not the quality of the change.
  • Putting secrets in the task prompt. If a task ever needs a key, the environment settings have a separate place for secrets. Never paste one into the chat.

Today's actions

Ticks are not saved without an account

Do it in OpenAI Codex

OpenAI Codex

  1. Create an empty private repository called puffinreach-kites on GitHub. Then push your local repository to it, replacing YOUR-NAME with your GitHub user name.
    git branch -M main
    git remote add origin https://github.com/YOUR-NAME/puffinreach-kites.git
    git push -u origin main
  2. Open chatgpt.com and start a new chat. Choose Work in > Cloud, open Select environment and select Create environment.
  3. Select the puffinreach-kites repository (connect GitHub if asked) and select Get started. Read the setup report, then select Publish.
  4. When Environment published appears, select Start a new task and paste this task.
    Add a kite size guide. Create size-guide.html with a table of our three kites: Gull Delta (wingspan 120 cm, light to medium wind), Box Lantern (80 cm, medium wind), Swift Stunt (210 cm, medium to strong wind). Use the same look as index.html and link the two pages to each other. Follow AGENTS.md. Done when both links work, no price changed, and you have listed every file you changed.
  5. Wait until Codex is done. Read the changed files and the checks it ran in the chat. If something is off, ask for the fix in the same chat.
  6. In your terminal, inside puffinreach-kites, list your latest cloud tasks. Each task in the output has a title and an id: copy the id of the size guide task.
    codex cloud list --json --limit 5
  7. Make a branch and apply the cloud result to it, replacing TASK_ID with the id you copied. Check it with git status (new files show here) and git diff (changed files), and open size-guide.html in your browser.
    git switch -c size-guide
    codex apply TASK_ID
  8. Commit, push the branch with git push -u origin size-guide and open a pull request on GitHub. Read the Files changed view before you merge. After merging, run git switch main and git pull.

Note: codex cloud is marked experimental in the CLI reference; codex apply is marked stable. codex apply prints the files it patched and stops with an error if the change does not fit your files. If you have set up Codex code review for this repository in your Codex settings, a pull request comment with @codex review asks Codex for a review as well.

Paid planCodex Cloud needs sign-in with ChatGPT on Plus, Pro, Business, Edu or Enterprise. Not on Free or Go, not with an API key. Enterprise admins must allow cloud access.

Checked on 4 December 2026 · Source: Codex docs: Cloud environments (opens in a new tab)

Create a free account to save your progress. Sign in or sign up