Blog

How Codexia Cloud moves a Claude Code or Codex session to a sandbox and back

Moving a coding agent session between your Mac and a cloud sandbox without losing the conversation: the session file is the transcript, the repo travels as a git bundle, and only new lines come back.

“Continue in cloud” sounds like one click, and it is. Underneath, it has to answer two questions: how does the agent remember the conversation, and how does it see your code? Codexia Cloud is in development, and this is how those two parts work today.

The session file is the transcript

Claude Code and Codex both keep a session as an append-only JSONL file on disk. Resuming a session means giving the agent that file and its id. So Codexia Cloud doesn’t summarize your conversation or replay it. It copies the file into the sandbox and resumes the same session there:

  • Claude Code runs through the Claude Agent SDK, resumed with the same session id.
  • Codex runs through codex app-server, with thread/resume on the same thread id.

The file records absolute paths, such as /Users/you/project, and the sandbox has a different home folder. Codexia rewrites them on the way in and reverses the rewrite on the way back. In our largest test, the sandbox copy had 2,169 paths in the sandbox’s layout and none in the Mac’s.

The server doesn’t keep a second copy of the conversation. It stores what the agents don’t know: who sent a prompt, who approved a command, and which rooms exist.

Big sessions

Real sessions get large. On the machine we tested, Claude Code sessions had a median of 0.9 MB and a maximum of 74 MB, mostly from pasted screenshots stored as base64. Codex rollouts are small (median 140 KB), and Codex itself stores rollouts older than 7 days as .jsonl.zst.

Codexia compresses a session with zstd before sending it. The 74 MB session became 20.3 MB in about 0.07 seconds. On a local container, moving it took 1.5 seconds end to end. On E2B, it went up as 11 parts of 8 MB.

Codex can resume a .zst rollout in place and writes the plain file back when it next appends, so those move as they are.

Your code travels by git

The agent also needs your repo, and a tarball would lose what makes it a repo. Codexia sends a git bundle instead:

  • Your uncommitted work is captured in a snapshot, and restored as uncommitted work in the sandbox. Ignored files such as .env and node_modules aren’t sent.
  • Commits the agent makes in the cloud stay on their own branch, ccx/<session>.
  • Nothing needs to reach your machine from the sandbox, and no git credentials are placed in the sandbox for this.

The bundles for our small test repo were under 1 KB.

Bringing it back

Both session files only ever grow, so “back” doesn’t send the whole file. Codexia records the number of lines at the move and brings back the new ones. For a real 1.4 MB Claude session, that was 481 lines at the move and 537 after, so 56 lines came back. If nothing happened in the cloud, nothing is downloaded.

The cloud’s changes to your files are applied as uncommitted changes, and the agent’s commits are kept. Then the session resumes on your Mac with the same id, and the agent knows what it did in the cloud. In our runs, Claude on the Mac correctly said that part of the work had run on a Linux machine.

Credentials stay put

  • A sandbox gets only the agent’s own credentials. Your other environment variables don’t go with it.
  • Codex signs in once in a sandbox, and the server keeps that sign-in for new ones. Your Mac’s ~/.codex/auth.json is never uploaded, because a sandbox refreshing a copied token could invalidate the one on your Mac.
  • A Codex thread on a model provider other than OpenAI, such as a local Ollama, can’t continue in the cloud, and Codexia refuses it.

Pausing

An idle sandbox pauses and resumes on your next prompt. On E2B, a pause took 345 ms and the resume 343 ms. A paused sandbox doesn’t use sandbox hours.

What we measured

These numbers come from our own development machine, a local container and E2B, not from a customer environment. Plugins and user-level skills and MCP servers don’t travel yet. Project-level ones do, through git.

To see where the cloud is going next, read about multiplayer sessions and agents that run commands on your Mac. To get early access, leave your email on the Codexia page.

Written by Claude, an AI model, from Codexia's source code and public sources. Spot a mistake? Email help@milisp.dev.