Running Codex around the clock on a dedicated Mac
Codex, OpenAI's coding agent, runs as a command-line tool on your own machine and signs in with a ChatGPT account. That makes it a natural fit for a dedicated Mac that stays on. The agent gets a real computer with a real browser. And you are not paying per token on top of your plan. Here is how to set it up so it keeps running.
Sign in with ChatGPT, not an API key
Run the Codex CLI and choose "Sign in with ChatGPT". Codex is included with ChatGPT accounts, including the free tier, and paid plans raise the limits rather than unlock the tool. The sign-in opens a browser window on the Mac, so you complete it either at the keyboard or through screen sharing. It persists afterward.
What the Mac needs
- A logged-in desktop session. Codex's browser login and any app it drives run inside the signed-in user's session. Automatic login after reboot keeps that session present.
- Never sleep, restart after power loss. The same energy settings as any always-on machine.
- A supervised process. A launch agent with keep-alive so a crashed Codex session comes back without you.
- Screen Sharing. For the login, the occasional two-factor prompt, and anything that stalls waiting for a click.
Running it alongside Claude Code
Nothing stops one Mac from running both. Each signs in with its own subscription, each keeps its own session, and you pick whichever suits the task. On a 16 GB Mac mini both fit comfortably, since the heavy lifting happens in the cloud models, not on the machine.
Limits to know before you rely on it
- Your ChatGPT plan's usage limits apply. A long-running agent can reach them; check them in the app before leaving it unattended.
- Logins expire. When Codex asks to sign in again, someone has to see the screen. Keep screen sharing reachable.
- A datacenter address will sometimes trip anti-automation checks on sites the agent visits.
The short version
Codex wants a Mac that is on, logged in, supervised and reachable. MacRun's agent plan is that machine. Codex and Claude Code are installed, and a browser button opens its screen. The only step left is your sign-in.
Frequently asked questions
Do I need an OpenAI API key to run Codex?
+
No. The Codex CLI signs in with a ChatGPT account. Codex is included with ChatGPT, including the free plan; paid plans raise the usage limits.
Can Codex run unattended on a Mac?
+
Yes, given a machine that never sleeps, logs itself in after reboot, and restarts the Codex process if it exits. It still needs a person occasionally, for a re-login or a two-factor prompt, which is why screen access matters.
Can I run Codex and Claude Code on the same Mac?
+
Yes. They are independent tools with independent sign-ins and fit together on a 16 GB Mac mini, since the models run in the cloud.
Why a Mac rather than a Linux server for Codex?
+
Codex itself runs anywhere. The Mac earns its place when the agent needs a real desktop. That means a browser you can log into once, native apps, and a screen you can step into when it stalls.