Claude Code kept maxing out my MacBook Pro. With several agents running Docker builds and test suites at the same time, it felt like ten employees sharing one laptop. Vercel recently published an "offload-to-sandbox" skill that moves that kind of work into Vercel Sandboxes. I wanted the same on Hetzner, since a cx53 with 16 vCPU and 32 GB costs about €0.05 an hour. So I built it.
It's a small CLI plus an agent skill. Per task it creates a server, pushes the repo, runs the job detached, pulls the results back and deletes the server. The CLI works fine without any AI agent too.
Most of the work went into the thing Hetzner doesn't have: an expiry. A forgotten ccx33 costs about €5 a day, so:
- every server gets a TTL (written into a label) and a watchdog on the Mac that deletes it at expiry, also right after the Mac wakes up
- a launchd job sweeps every 15 minutes and after reboots, in case the watchdog died
- it only ever touches servers labelled managed-by=offload-to-hetzner, never your other servers in the project
- `rm` checks that server and SSH key are really gone before it says so
Some Hetzner-specific details:
- servers get IPv4 only (--without-ipv6), so each one uses one primary IP instead of two. The IP limit was the first wall I hit with parallel servers
- one shared firewall that only allows SSH and ping, so Docker ports aren't exposed
- a fresh SSH key per server, and the host key is generated locally and injected via cloud-init, so there's no trust-on-first-use
- optional snapshots with Docker preinstalled: a new server is ready in about 45 seconds
- limits count per account across all projects. My limit increase request was approved automatically within seconds
Limitations: macOS only for now (launchd, caffeinate), billing per started hour, and if your Mac is off, nothing deletes anything.
Repo (MIT): https://github.com/pipamann/offload-to-hetzner
If you already run throwaway servers on Hetzner for CI or agents: what am I missing?