Why I Moved My AI Coding Agents From Git Worktrees to the Cloud
Git worktrees maxed out my M4 Max and only worked while my laptop was open. Running coding agents in the cloud changed how I start work and review it.
I used to run coding agents in parallel on my laptop with git worktrees. It worked, but it put a lot of strain on the machine.
Even with an M4 Max and 48 GB of RAM, I could only run about 8 to 15 active worktrees at once, depending on the work. A Next.js dev server alone takes about 3 GB of RAM per tree. Do the maths.
And all of that only worked while my laptop was open.
The real unlock
So I moved my agents to the cloud. I now run about 10 to 20 at a time. But the parallelism isn't the big unlock.
The big unlock is that my agents don't need my laptop anymore. And they don't really need me sitting at it either.
Why I put it off
I'd put the move off for a while, for three reasons:
- I didn't want to reconfigure my whole dev environment in the cloud.
- I thought testing would be slower without localhost.
- I thought I wouldn't be able to see the logs.
What I got wrong
Turns out I was wrong on all three.
- Setup is a one-time effort. Yes, you have to sort out env vars for every project. A secrets manager like Doppler or Infisical makes that a lot easier, and it's actually one of the good practices that came out of the whole migration.
- Testing parity is a myth. The dev servers run in the cloud and you create public URLs that you open in your browser. You can do it yourself with Tailscale or a Cloudflare reverse proxy, or tools like Tembo, Amp or Devin do it for you. If you build for web, it works pretty much the same as localhost.
- Logs are easier, not harder. It's actually easier to ask the agent to read the logs and figure out what's going on than to scroll through them myself. Agents are far more efficient at it than I am.
On top of that, it's just a Linux VM. If I need an extra library, I pop in and install it. And no more thinking about storage, resource management or archiving old worktrees.
Agents that start without me
Once the agents weren't tied to my laptop, two things changed.
- Start from anywhere. Slack, Teams, my phone.
- Start on events. When a user hits a bug or reports an edge case, the agent pulls what it needs from the logs and Sentry, builds the app, tries to reproduce it with the browser or scripts, and tries to fix it. I don't need to be at my laptop for any of that.
Review the proof, not the code
And if I'm not at my laptop, I'm not reading diffs either. So I stopped reviewing the code first and started reviewing the proof. I ask agents to always give me irrefutable evidence that it works:
- Screenshots
- Videos
- Logs
- A reproduction
- Before and after benchmarks
If it looks good, I check it quickly on my phone and ship it.
What it costs
So how much does all this cost? Less than you'd think.
You've got two options:
- Use your existing subscription's cloud. If you already have an OpenAI or Claude subscription, you can use their cloud VMs basically for free. The experience isn't great though. Boot is very slow.
- Bring your subscription to another tool. Amp, Devin, Tembo or Capy let you connect your existing subscription and run on their cloud. A $20 plan on Tembo, Amp or Capy gives you 4 CPU and 8 GB of RAM, and that'll probably last you unless you spawn around 30 agents at once. They sleep when they're not in use.
The one downside
The only real downside so far comes with those smaller VMs. Sometimes I run out of memory or CPU, and I can't easily resize the VM.
It doesn't happen often though. And compared to a maxed-out laptop that only works while it's open, it's not even close.
What my day looks like now
So these days, I start work from my phone, the agents run while my laptop is closed, and I check the proof when it comes back.
My laptop used to be the limit. Now it's optional.
Related reading: I wrote about the workflow that makes agents worth running in The Coding-Agent Loop That Made Me Faster, and about agents acting on our behalf in The Computer Starts With What You Want.