Skip to content
Evidence Lab
English
Esc
navigateopen⌘Jpreview
On this page

Choose Local, Worktree, or Cloud

You choose a Codex environment from where the files live, whether changes need isolation, whether hosted continuity matters, and how you will verify the result.

Result

You choose a Codex environment from where the files live, whether changes need isolation, whether hosted continuity matters, and how you will verify the result.

Selection guidance

Include when

Use this module when you choose an environment by habit or cannot explain where the task’s files and changes will exist.

Skip when

Skip it when you can independently choose an environment for representative local, parallel Git, and remote tasks and name its access and review boundary.

Prerequisites

You can navigate the Codex interface and identify a project’s primary folder. To practise Worktree, the project must be a Git repository. To use Cloud, a cloud environment must be configured and available.

Explanation

Codex offers three execution choices in the desktop app:

  • Local: Codex works directly in the current project directory on your computer. Choose it when the task needs that local state and you intend to inspect the result there.
  • Worktree: Codex creates an isolated Git worktree on your computer. Choose it when a Git task should proceed separately from unfinished local changes or another parallel chat.
  • Cloud: Codex runs remotely in a configured cloud environment. Choose it when the required project and tools exist there and hosted execution fits the task.

An environment is not only a performance choice. It determines which copy of the files the agent sees, where changes are written, which tools are available, and how you return to inspect or integrate the result.

Decision question Local Worktree Cloud
Where does the task run? Current project directory Separate Git worktree Configured remote environment
Does it use the current local checkout directly? Yes No No
Does it require Git? No Yes Depends on the configured environment
Main reason to choose it Work directly with current local state Isolate parallel changes Use hosted remote execution

Actions

  1. Describe the task and identify where its authoritative files currently live.
  2. Decide whether the task may safely change the current local project. If yes, Local may fit.
  3. If changes must remain separate and the project is in Git, consider Worktree. Identify the starting branch and how you will review or hand off the changes.
  4. If the task should run remotely, confirm that a suitable Cloud environment is configured with the required project, tools, and context.
  5. Before starting, write four statements:
    • where the task will run;
    • which files it can access;
    • where new or changed files will appear;
    • how you will review the result.
  6. Select the environment in the new-chat composer and compare the visible choice with your record.
  7. Run a read-only orientation task or one small file-creation task. Confirm that the result appears in the expected environment.

Practice

Choose an environment for each scenario:

  • summarize two documents stored in a focused local folder;
  • update a Git project without disturbing unfinished work in the local checkout;
  • run a configured remote project task that should continue away from the local computer;
  • create a presentation from local source files and inspect the generated assets and commands.

State why your choice fits and what would make you switch environments.

Deliverables

  • A completed three-environment decision table.
  • A justified environment choice for one representative task.

Check

  • You select Local when Codex should work directly in the current project directory.
  • You select Worktree only for a Git project when isolated parallel changes are useful.
  • You select Cloud only when an appropriate remote environment is configured and fits the task.
  • Before starting, you can state where files and changes will live, what access is available, and how the result will be reviewed.

If it fails

  • Worktree is unavailable. Confirm that the project is inside a Git repository.
  • A task changes the wrong checkout. Stop and verify the environment label, project, and branch before continuing.
  • Cloud cannot access a local file. Move the needed context through an approved route or choose Local; selecting Cloud does not grant access to the computer.
  • Local and Worktree are confused. Local is the current checkout; Worktree is a separate Git checkout created for isolation.

Sources and verification

Sources: openai.codex.environments, openai.chatgpt.projects, openai.codex.code-review, openai.codex.sandbox.

The Local, Worktree, and Cloud definitions were checked against official OpenAI documentation on 8 September 2026. Cloud availability and configuration are account- and workspace-dependent. The exercise has not yet been field-validated with a learner.

Next: Run the first task.