Back to all articles
TutorialDecember 1, 2026·10 min read

Codex Cloud vs Local - Where Each Task Runs and What It Keeps Afterward (2026)

You've been running Codex on your laptop for a few weeks. It edits files in your repository, runs your tests, and you watch it work. Then you notice the option to run a task in the cloud instead, so it keeps going after you close the lid. You're not sure what changes: whether the cloud task sees your local files, what happens to its changes after it finishes, whether it remembers what you told Codex locally, and whether it uses your plan faster.

The short answer: a local Codex task runs on your computer, in your folders, with your tools. A cloud task runs on OpenAI's machines in a prepared environment. OpenAI's help article says: "Codex Cloud runs coding tasks on OpenAI-managed computers." Each cloud task gets its own isolated workspace, keeps going while your computer sleeps, and keeps its saved state for a limited time. Both draw from the same plan allowance, and OpenAI says cloud tasks may use more of it than local messages.

This guide covers what each mode is, where the work happens, what a cloud task can see, what each keeps after the task, how memory and instructions fit in, how usage compares, how remote access differs from the cloud, and how to choose.

What local Codex is

Local Codex runs on your machine. That includes the Codex view in the ChatGPT desktop app, the Codex CLI, and the IDE extension. OpenAI's article on Work and Codex says: "Codex can work with local folders, repositories, terminals, and developer tools."

Because the work happens on your computer, local Codex uses your files as they are right now, including uncommitted changes, local configuration, and tools you've installed. If your computer sleeps or you close the app, local work stops with it.

What Codex Cloud is

Codex Cloud runs the same kind of coding task somewhere else. OpenAI's developer page describes the benefit plainly: "Each task has its own workspace and can keep working while your computer is asleep."

You start a cloud task from the web, the desktop app, or mobile. OpenAI's developer docs say to start a chat and choose Work in, then Cloud, on the web or desktop, or to open Codex on mobile. You pick an environment, describe the task, and review the results when it's done.

The environment is the key idea. OpenAI's help article says: "A cloud environment brings together the repositories, tools, dependencies, and access settings Codex needs for your project." Once someone prepares and publishes an environment, new tasks can start from it.

Where the work happens

The practical difference is where the files live.

Local: your working directory. Codex reads and writes the files you see in your editor.

Cloud: a separate workspace on an OpenAI-managed computer. OpenAI's help article says: "Each task starts from the prepared setup in its own isolated workspace, with separate working files and changes."

That isolation works in both directions. A cloud task works on its own copy rather than the files on your laptop, and two cloud tasks don't share uncommitted work. The help article says: "Starting a new task creates a separate workspace and does not recover another task's uncommitted changes."

What a cloud task can see

A cloud task works with what's in its environment: the repositories, dependencies, tools, and access settings someone set up for it. If the default environment is available, OpenAI's developer page says you can start without choosing a repository, and Codex can check out repositories available through your connected GitHub or GitLab account.

Access to outside services is configured in the environment, not on your laptop. OpenAI's environment docs describe internet access settings, environment variables, and network secrets, including a personal vault for your own values. For network secrets, the docs say programs receive a placeholder and a proxy substitutes the real value for allowed destinations.

Each person also uses their own GitHub connection. OpenAI's help article says: "Each person uses their own GitHub connection." Access to an environment doesn't replace your repository permissions.

What each keeps after the task

Local tasks leave their changes in your working directory. They're as permanent as any other file on your machine until you commit, change, or delete them.

Cloud tasks keep their own saved state, for a while. OpenAI's help article gives the window: "By default, saved virtual machine (VM) state is recoverable for up to 7 days after the last start of a turn or task resume." It adds what that window isn't: "This recovery window describes saved VM state; it is not a conversation-history retention period."

So the conversation and the task's saved files are different things. To keep going, OpenAI's article says to return to the original task, since a new task won't have the old one's uncommitted changes. Its advice is simple: "Commit important work to source control."

OpenAI's environment docs repeat the point: "Saved state doesn't replace source control."

When the environment changes

If you update the environment, existing tasks don't change. OpenAI's help article says: "Changes to an environment's published setup apply to new tasks. Existing tasks keep their own state."

The environment docs describe the same split. A new task in a published environment starts from the environment's prepared files, while an existing task continues with its own saved files, including uncommitted changes and installed tools. Updating the setup means editing the environment, saving it, and publishing it again, then starting a new task to use the update.

How memory and instructions fit in

Codex's local memories belong to the machine. OpenAI's memories page says local Codex clients use a separate local memory store, and the feature is off by default until you enable it for a machine. The documentation describes that store as part of local Codex; it doesn't describe cloud tasks reading it.

For guidance that every task should follow, OpenAI points to files instead. Its memories page says: "Keep required team guidance in AGENTS.md or checked-in documentation." An AGENTS.md committed to your repository is part of the repository a cloud task checks out, while notes that exist only on your laptop aren't part of a cloud environment unless you add them.

History is separate too. OpenAI's article on Work and Codex says Codex is a separate view in the desktop app, and "Its history remains separate from ChatGPT history."

How usage compares

Local and cloud work come from the same plan. OpenAI's pricing page says: "Local messages and cloud chats share your plan's usage allowance."

They don't cost the same, though. The same page says: "Cloud tasks may use more of your allowance than local messages." It also notes that usage depends on the model, the size and complexity of the task, and whether you run it locally or in the cloud.

You can check your usage and reset times in the usage dashboard the pricing page links to.

If your workspace used the older cloud experience

Some teams still see a legacy version. OpenAI's help article says Code Review, Security Review, and the existing Linear and GitHub integration workflows continue to use Codex Cloud (Legacy) during the transition. Moving a supported legacy environment to the new experience is something you start yourself. The article says: "Migration is something you initiate; it leaves the original environment unchanged, and existing legacy task history remains viewable."

Remote access isn't the cloud

There's a third option that looks like the cloud but isn't. The ChatGPT mobile app has a Remote tab for following desktop Codex chats from your phone. OpenAI's article says remote access to a desktop task "is separate from running a task in a cloud environment, and it does not add those desktop chats to your web or mobile chat history."

With remote access, the work still runs on your computer, so your computer has to be on. With Codex Cloud, it runs on OpenAI's machines.

Which one to use

Use local Codex when you want to watch the work, use files and tools that only exist on your machine, iterate quickly on uncommitted changes, or keep usage lower.

Use Codex Cloud when the task is long and should keep running after you close your laptop, when several tasks should start from the same prepared setup, or when you want to start or check work from your phone.

Use both by keeping shared guidance in a committed AGENTS.md, so local and cloud tasks start from the same instructions.

What people try first

Expecting a cloud task to see local files. It works in its own environment, not on your laptop.

Starting a new cloud task to continue old work. A new task doesn't recover another task's uncommitted changes; go back to the original.

Treating saved state as storage. It's recoverable for a limited time; commit important work.

Updating the environment mid-task. Existing tasks keep their own state; start a new task to use the update.

Assuming local memories follow you to the cloud. OpenAI describes them as a local store on each machine.

Confusing remote access with cloud tasks. Remote access still runs on your computer.

The Fix: Choose the right mode for each task

Step 1: Decide where the files need to be

If the task needs your uncommitted local work, run it locally. If it can start from the repository, the cloud works.

Step 2: Put shared guidance in AGENTS.md

Commit the rules both modes should follow.

Step 3: Commit important work

Don't rely on a cloud task's saved state as long-term storage.

Step 4: Write down the context that lives only in your head

Note project decisions and conventions in your own words, so they're available to any task in any mode.

Setting this up in MemoryLake

Local Codex can keep notes on your machine, cloud tasks start from an environment, and each task's saved state expires. The context that should guide every task, such as why a service is structured the way it is, is worth keeping in one place you control, outside any single machine or workspace.

MemoryLake is a memory layer for that kind of context, kept in one place you maintain and available to the assistants you connect, such as ChatGPT, Claude Code, and Codex.

You write the entries yourself, in your own words. Nothing is read out of, written to, or deleted from your cloud environments, your tasks' saved state, your local Codex memories, your repositories, or any vendor's store. Codex Cloud and local Codex work the way OpenAI describes them.

Step 1: Create an API key

Sign in and generate a key from the dashboard. Keep it somewhere private.

The MemoryLake console showing the API keys screen, where a new key is created and copied for use in an agent
The MemoryLake console showing the API keys screen, where a new key is created and copied for use in an agent

Step 2: Upload your first memories

Start with what you wrote in Step 4 of the fix: project decisions and conventions. One topic per entry.

The MemoryLake workspace with the first documents uploaded, listing each file as it becomes searchable memory
The MemoryLake workspace with the first documents uploaded, listing each file as it becomes searchable memory

Step 3: Connect your AI & agents

Connect ChatGPT, Claude Code, Codex, and the other assistants you use, so the same context is there in each.

The MemoryLake integrations screen listing the AI clients and agent frameworks that can be connected to the memory layer
The MemoryLake integrations screen listing the AI clients and agent frameworks that can be connected to the memory layer

What this changes in practice

The first difference is portability. Your notes don't live on one laptop or in one cloud workspace.

The second is consistency. The same context is available whether a task runs locally or elsewhere.

The third is control. You decide what each entry says, separately from any saved state.

Best practices for Codex Cloud and local

Run quick, hands-on work locally. It uses your files and tools directly.

Send long tasks to the cloud. They keep going while your computer sleeps.

Keep instructions in a committed AGENTS.md. Both modes start from the repository.

Return to the original cloud task. New tasks don't inherit uncommitted changes.

Commit before the recovery window ends. Saved state is time-limited.

Watch usage. Cloud tasks may use more of your allowance.

Conclusion

Local Codex runs on your computer, in your working directory, with your tools and uncommitted changes, and stops when your computer does. Codex Cloud runs on OpenAI-managed computers, starts each task from a prepared environment in its own isolated workspace, and keeps going while your computer sleeps. A cloud task's saved state is recoverable for a limited time after its last activity, and new tasks don't inherit another task's uncommitted work.

Both share one plan allowance, and cloud tasks may use more of it. Local memories belong to a machine, so guidance every task should follow belongs in a committed AGENTS.md. Writing down your project context in your own words keeps it available to every task, whichever mode it runs in.

Frequently asked questions

What's the difference between Codex Cloud and local Codex?

Local Codex runs on your computer with your files. Codex Cloud runs on OpenAI-managed computers in a prepared environment.

Does a Codex Cloud task see my local files?

Not directly. Each cloud task works in its own isolated workspace, built from its environment's repositories and setup.

How long does Codex Cloud keep a task's files?

OpenAI says saved VM state is recoverable for up to 7 days after the last start of a turn or task resume.

Does a new cloud task continue where another left off?

No. A new task doesn't recover another task's uncommitted changes. Return to the original task.

Do cloud tasks use more of my Codex usage?

They may. OpenAI says cloud tasks may use more of your allowance than local messages, and both share one allowance.

Do Codex memories work in the cloud?

OpenAI describes local memories as a store on each machine. Put guidance every task needs in AGENTS.md.

Is the mobile Remote tab the same as Codex Cloud?

No. Remote access follows a task running on your computer; Codex Cloud runs on OpenAI's machines.