← Blog

A Codex workspace that keeps your hours: schedules, time zones and overnight codex exec runs

Set a Sandscale workspace to start with your workday in Tokyo, Taipei or Singapore, keep Codex's config in your dotfiles, and leave a codex exec run going in tmux overnight. Every command is from the CLI reference.

If you work from Tokyo, Taipei, Seoul or Singapore, most “run your agent in the cloud” guides quietly assume someone else’s clock. The workspace schedule in the Sandscale CLI takes a time zone, so you can have a Codex workspace that is running when you sit down, stops after your day, and still lets a long codex exec run finish while you sleep.

This post builds that setup. The Sandscale commands come from the workspace CLI reference and the workspaces guide. The Codex side follows OpenAI’s non-interactive mode page, read in November 2026. If you have not run Codex in a workspace before, start with running codex exec in a cloud workspace, which covers sandbox modes and output in more detail.

What a workspace is, briefly

A Sandscale workspace is a persistent cloud computer: a Firecracker microVM with its own kernel and a disk that is kept when it stops. Codex, your clone and Codex’s sign-in live on that disk, so you set them up once. Commands Codex runs land on the workspace, not on your laptop.

One thing to be clear about up front: Sandscale runs in its United States region (us-east) today. The time zone below only changes when the schedule fires. It does not move the machine.

1. Create the workspace

curl -fsSL https://sandscale.dev/install | sh
sandscale login
sandscale workspace templates list
sandscale workspace create codex-box --template TEMPLATE
sandscale workspace open codex-box

TEMPLATE is one of the names templates list prints. Inside the workspace, install Codex the way OpenAI’s docs describe, sign in, and clone your repository. Codex calls OpenAI’s API, so the workspace needs network access; network follows your plan and your organization’s policy, so check that yours allows it.

If you are signing in from a machine without a browser, sandscale login --device gives you a code to enter on another device.

2. Start it with your workday

schedule start takes a five-field cron expression (minute, hour, day of month, month, weekday) and an optional --timezone. Without --timezone, the CLI uses the time zone of the machine you run it on, which is easy to get wrong if that machine is a CI runner or a remote box set to UTC. Say it explicitly:

# 09:00 on weekdays, Tokyo time
sandscale workspace schedule start codex-box "0 9 * * 1-5" --timezone Asia/Tokyo

The same line for other cities is only a different zone name, for example Asia/Taipei, Asia/Seoul, Asia/Singapore or Asia/Hong_Kong. These are standard IANA zone names.

Then decide how it stops:

sandscale workspace schedule stop codex-box 10h     # 10 hours after each start
sandscale workspace schedule idle codex-box 1h      # or after an hour with nothing going on
sandscale workspace schedule show codex-box

Your organization’s policy can shorten what you set, and schedule show prints the values actually in force. Check it once after setting, rather than assuming your numbers won.

3. Put Codex’s config in your dotfiles

A workspace can apply a dotfiles repository for you. That is a clean place for ~/.codex/config.toml, your shell setup and a tmux.conf:

sandscale workspace dotfiles set https://github.com/you/dotfiles
sandscale workspace dotfiles sync codex-box

Per the reference, the URL is https://, ssh:// or git@host:path, with no user name, password or token in it. Keep it that way in the repository too: config only, never API keys or Codex’s stored credentials. Sign in to Codex on the workspace itself; the disk keeps that sign-in.

4. Leave a run going overnight

The pattern: start codex exec inside tmux on the workspace near the end of your day, detach, and read the result in the morning. From your laptop:

sandscale workspace ssh codex-box -- 'tmux new-session -d -s nightly "cd ~/src/my-service && codex exec --sandbox workspace-write --json \"upgrade the test dependencies, run the suite, and fix what breaks\" > ~/nightly.jsonl 2> ~/nightly.err"'

A few things in that line are worth knowing:

  • sandscale workspace ssh NAME -- COMMAND joins the words after -- with spaces, as ssh does, so quote the remote command as one string.
  • tmux new-session -d starts the session detached, so the run does not depend on your SSH connection.
  • --sandbox workspace-write lets Codex edit files in the working directory. By OpenAI’s docs the default for codex exec is read-only.
  • --json makes standard output a JSON Lines stream of events (thread.started, turn.completed, turn.failed, item.* and so on). Progress goes to standard error, which here goes to its own file.

Your stop schedule still applies. If the run might go past it, either start it earlier, set a longer schedule stop for that day, or turn the stop off with schedule stop codex-box off and set it back afterwards. A run that is cut off by a stop leaves its partial work on the disk, because stopping keeps the disk, but Codex itself will not continue on its own after the workspace starts again.

5. Read the result in the morning

When the schedule starts the workspace, check how the run ended without opening a full session:

sandscale workspace ssh codex-box -- 'grep -E "turn.(completed|failed)" ~/nightly.jsonl | tail -n 3'
sandscale workspace ssh codex-box -- 'cd ~/src/my-service && git status --short && git diff --stat'

Then open the workspace and review the diff properly before you push anything:

sandscale workspace open codex-box

sandscale workspace open codex-box --ide browser opens it in the browser instead. Editors that connect over SSH use sandscale workspace ssh.

6. Checking the connection from where you are

You are connecting to a US region from Asia, so it is worth looking at the connection once rather than guessing. ping reports round trips to Sandscale and the state of the workspace agent:

sandscale workspace ping codex-box --count 5

What you see depends on your network and where you are. Interactive typing over SSH is where distance shows most; overnight codex exec runs, where nobody is typing, are where it matters least, which is one reason the overnight pattern above suits a workspace far from you.

Things that catch people out

  • The schedule’s zone is not the workspace’s clock. The workspace’s own system clock zone comes from its template, not from the schedule. Check it with date on the workspace, and if your scripts print times, set TZ in your dotfiles.
  • A stopped workspace is still there. Stopping keeps the disk; sandscale workspace delete deletes the workspace and its disks.
  • Codex’s sandbox and the workspace are separate layers. Codex’s --sandbox mode limits what Codex may do on its host. The workspace is the host, its own microVM, so even a run with broad access lands on the workspace’s disk and not on your laptop.

FAQ

Can a Sandscale workspace start on a schedule in my local time zone?

Yes. sandscale workspace schedule start NAME "CRON" --timezone ZONE takes a five-field cron expression and an IANA zone name such as Asia/Tokyo. Without --timezone it uses the time zone of the machine you run the command on.

Does the time zone change where the workspace runs?

No. It only changes when the schedule fires. Sandscale runs in its United States region today.

How do I keep a codex exec run going after I disconnect?

Start it inside tmux on the workspace, for example with sandscale workspace ssh NAME -- 'tmux new-session -d -s nightly "codex exec ..."', and keep the stop schedule long enough for the run.

Run your agents in a box of their own

Each sandbox is a Firecracker microVM. Free includes 100 awake vCPU-hours a month.

Start free

Keep reading