# 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.

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.

November 28, 2026 · 6 min read · The Sandscale team

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](https://sandscale.dev/docs/reference/cli/workspace) and the [workspaces guide](https://sandscale.dev/docs/guides/workspaces). The Codex side follows OpenAI’s [non-interactive mode](https://developers.openai.com/codex/noninteractive) page, read in November 2026. If you have not run Codex in a workspace before, start with [running codex exec in a cloud workspace](https://sandscale.dev/blog/codex-exec-in-a-cloud-workspace), which covers sandbox modes and output in more detail.

## What a workspace is, briefly

A Sandscale [workspace](https://sandscale.dev/workspaces) 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

```sh
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:

```sh
# 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:

```sh
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`:

```sh
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:

```sh
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:

```sh
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:

```sh
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:

```sh
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.

## Related

- [Running codex exec in a cloud workspace](https://sandscale.dev/blog/codex-exec-in-a-cloud-workspace)
- [Adding the Sandscale MCP server to Codex](https://sandscale.dev/blog/sandscale-mcp-server-in-codex)
- [Use case: a coding agent that keeps working after you close the laptop](https://sandscale.dev/blog/use-case-long-running-agent-in-a-workspace)

**On this page**

1. What a workspace is, briefly
2. 1. Create the workspace
3. 2. Start it with your workday
4. 3. Put Codex’s config in your dotfiles
5. 4. Leave a run going overnight
6. 5. Read the result in the morning
7. 6. Checking the connection from where you are
8. Things that catch people out
9. FAQ
10. Related

**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](https://cloud.sandscale.dev/auth/signup)

## Keep reading

- [November 28, 2026 · **A Cursor project rule that sends installs and tests to a Sandscale sandbox** · Use a .cursor/rules file (or AGENTS.md) so Cursor's agent runs dependency installs and test suites with sandscale sandbox run instead of on your laptop. What the rule can and cannot enforce, and how to check what gets sent.](https://sandscale.dev/blog/cursor-rule-run-tests-in-a-sandbox)
- [November 27, 2026 · **A LlamaIndex.TS data agent that runs its Python in a Sandscale sandbox** · Use LlamaIndex.TS's agent workflow with tools that write and run Python in a Firecracker sandbox, built per sandbox so a run can only reach its own box. Upload data files, answer with the numbers, clean up. Type-checked.](https://sandscale.dev/blog/llamaindex-ts-agent-with-sandscale)

---
Source: https://sandscale.dev/blog/codex-workspace-on-your-time-zone
