24/7

Running coding agents 24/7 on your own server

An always-on coding agent needs three things: a machine that doesn't sleep, a process that outlives your connection, and a way to notice when it needs you. Here are the ways to get each, from tmux to systemd to a session daemon, plus the limits your subscription sets.

Running coding agents 24/7 on your own server

Quick answer

Put the agent on a machine that never sleeps (a VPS or an always-on home box). Run it under something that outlives your SSH session: tmux for interactive use, a systemd user service (with lingering on) to bring tmux back at boot, or a daemon that owns the sessions. Give each parallel session its own git worktree. Your plan's usage limits, not the hardware, are what usually stop a 24/7 agent: Claude plans reset every five hours and also have weekly limits.

A coding agent on your laptop stops when the lid closes. Moving it to a machine that stays on is the easy part. The parts people skip are supervision (what keeps the process alive, and what brings it back after a reboot), isolation between parallel sessions, and the usage limits that will stop the agent long before the hardware does. This guide covers each, for Claude Code, Codex and the other terminal agents.

Cloud vs your own box

First decide whether you need a machine at all. The vendors now run agents for you:

Vendor cloud (e.g. Claude Code cloud sessions, Codex cloud tasks)Your own server or home machine
SetupConnect GitHub (Claude can also upload a local repo bundle)A VPS or always-on machine, plus install and auth
EnvironmentAn isolated VM per session, set up by a script; reclaimed after inactivityYour toolchain, your databases, your secrets, persistent
Network and private servicesLimited by default (domain allowlist); your private network is out of reachAnything the box can reach: VPN, tailnet, staging DBs
AgentsOne vendor'sAny CLI: Claude Code, Codex, OpenCode, Grok Build, agy
CostYour plan's usage (Anthropic: no separate compute charge)Your plan's usage plus a few euros a month for the box

If your project lives on GitHub and builds from a setup script, the vendor cloud is the least work. Anthropic's cloud sessions docs are the place to start; claude --cloud "…" starts one from your terminal. Choose your own box when the agent needs things only your machine has, or when you want several vendors' agents side by side. The VPS buyer's guide covers sizing and current prices. A Mac mini at home works too, as long as you turn off sleep.

Process supervision

Interactive agents are terminal programs. They die with the terminal unless something else holds it. You have four options, from simplest to most robust.

1. tmux

tmux new -A -s main
cd ~/src/api && claude        # detach: Ctrl-b d · re-attach: tmux attach -t main

tmux survives disconnects, not reboots. It's the right tool for interactive work, and it's what Anthropic's docs suggest for keeping a Remote Control session alive on a remote machine. Our tmux, mosh and Tailscale guide has the config agents need.

2. systemd + tmux, so it comes back after a reboot

You can't run an interactive TUI directly as a service, because it needs a terminal. You can have systemd start a detached tmux session at boot. As your normal user, create ~/.config/systemd/user/agents.service:

[Unit]
Description=tmux session for coding agents

[Service]
Type=forking
ExecStart=/usr/bin/tmux new-session -d -s main
ExecStop=/usr/bin/tmux kill-session -t main

[Install]
WantedBy=default.target
systemctl --user daemon-reload
systemctl --user enable --now agents.service
sudo loginctl enable-linger "$USER"     # start user services at boot, without a login

That brings back an empty session, not your conversations. Resuming them is a separate step (see What happens on reboot below).

3. Headless runs on a schedule

For recurring jobs, such as nightly dependency bumps, triaging new issues or regenerating docs, skip the TUI. Run claude -p "…" or codex exec "…" from cron or a systemd timer. There's nobody there to approve anything, so set the permission mode and allow-list on purpose. Running agents with full permissions, safely covers how.

4. A session daemon

The most robust option is a process that owns the agent sessions: it starts them, keeps their transcripts, and lets you attach from anywhere. Claude Code's Remote Control server mode (claude remote-control) is one. It serves up to 32 concurrent sessions by default, configurable with --capacity, but you still run it inside tmux or a service. agy remote-control start registers Antigravity's daemon as an OS service. Third-party tools, Maude among them, deploy their own daemon that handles several agents.

Parallel sessions and worktrees

Two agents editing the same checkout will overwrite each other's changes. Give each session its own git worktree, a separate working directory and branch that shares the repository's history:

git worktree add ../api-auth -b feature/auth
git worktree add ../api-billing -b fix/billing
# one tmux window per worktree, one agent per window

Claude Code can do this for you: claude --worktree feature-auth (or -w) creates a worktree under .claude/worktrees/ on a new branch and starts the session inside it. See the worktrees docs.

How many sessions one box handles depends on what they run, not on the agents themselves. A useful rule of thumb is 4 GB for the first session plus 1–2 GB for each additional one that builds or tests, and more if each worktree runs its own dev server or database. Watch free -h during a busy hour before adding another. Disk adds up too, because every worktree gets its own node_modules.

Quotas and rate limits

A 24/7 box is only useful if your plan lets the agent keep working, so read the limits before you plan around them:

  • Claude (Pro, Max). Usage limits reset every five hours, and there's also a weekly limit, per Anthropic's usage limits article. Several parallel sessions draw from the same allowance. You can check where you stand under Settings → Usage.
  • Codex (ChatGPT plans). Plus and similar tiers use rolling five-hour windows, and weekly limits may also apply. Local CLI use and cloud tasks share one allowance. See OpenAI's Codex pricing page for your plan.
  • API keys. No plan window, but you pay per token, so a runaway loop costs money instead of stopping. Set spend limits in the provider console.

In practice, "24/7" means the agent can work whenever there's work and allowance, not that it runs flat out all day. Queue the long tasks for when you're away, and expect it to stop until the next reset.

What happens on reboot

Kernel updates, provider maintenance and out-of-memory kills all restart things. Agent conversations are saved to disk, so nothing is lost, but nothing restarts on its own:

  • Claude Code: claude --continue resumes the most recent conversation in the current directory, and claude --resume lets you pick one.
  • Codex: codex resume --last, or codex resume for a picker.
  • tmux: the server is gone, and with it your window layout. The systemd unit above recreates the session. Plugins such as tmux-resurrect can restore layouts too.

Anything in flight when the box went down, such as a half-finished edit or a running test, has to be checked by hand. That's one more reason to have the agent commit often.

Watching from your phone

An always-on agent will need you at odd moments: a permission prompt, a question, a finished task to review. Your options are an SSH app attached to tmux, which is free but has no notifications; vendor Remote Control apps, which work per agent; ntfy hooks for push, covered in approving prompts from your phone; or an app that does all of it.

Maude is built for this setup. It deploys a daemon over SSH that runs your sessions on the server 24/7, keeps them going when the app is closed, and handles Claude Code, Codex, OpenCode, Grok Build and Antigravity on as many servers as you add. You get push notifications with Allow/Deny, an inbox of what's waiting, and per-session git worktrees, a diff review and a terminal. When one agent runs out of allowance, you can hand the session to another agent along with a brief of the work so far. You still need each agent's own plan or API key. The app is $2.99 a week after a 3-day trial, or $59.99 a year after a 7-day trial.

Frequently asked questions

Will my subscription allow 24/7 use?
The hardware can run all day; your plan's limits decide how much work gets done. Claude plans reset every five hours and also have weekly limits; ChatGPT plans give Codex rolling five-hour windows with possible weekly limits. API keys have no window but bill per token.
How many agent sessions can one VPS handle?
It depends on what the sessions run. A rough starting point is 4 GB for the first session plus 1–2 GB for each extra one that builds or runs tests. Give each session its own git worktree, and watch memory with free -h before adding more.
What happens to my agents when the server reboots?
The processes and any tmux sessions are gone, but conversations are saved on disk. Resume them with claude --continue or claude --resume, and codex resume --last. A systemd user service with lingering enabled can bring your tmux session back at boot.
Can I run Claude Code on a Mac mini at home 24/7?
Yes. Disable system sleep (for example sudo pmset -a sleep 0), use wired networking, and reach it over Tailscale or an app that connects outward. Remote Control and tmux both work there; a Mac that sleeps pauses everything.
Can I run Claude Code and Codex on the same server?
Yes. They're independent CLIs with separate logins and config directories (~/.claude and ~/.codex). Run them in separate tmux windows or worktrees so they don't edit the same files.

Your agents, always on

Sessions run on your server around the clock; your phone tells you when they need you. iOS and Android.

Download Maude on the App Store Get Maude on Google Play