Building My "Agent Machine": 24/7 AI Agents You Can Control from Your Phone

How tmux + Tailscale + Termius turned a cheap VPS into a powerful, always-on AI coding & research team.

← Part of the AI Agents knowledge base

Related: Grok Build + Worktrees Best Practices →

Introduction

In late 2025 I got tired of AI coding sessions dying every time I closed my laptop. I wanted agents that could run for hours or days — reviewing code, building features, researching topics — without me babysitting them.

The solution? I built what I now call my Agent Machine.

It’s a simple but incredibly effective setup using just three tools:

tmux

For persistent terminal sessions that keep running even when you disconnect.

Tailscale

For secure private networking across all your devices and servers (your personal tailnet).

Termius

A beautiful, reliable SSH client that works great on both mobile and desktop.

Together, these three create a reliable, pocket-accessible remote AI agent environment that costs under $10–15 per month.

Why I Needed an Agent Machine

Most people run AI agents (Claude Code, Aider, custom scripts, etc.) locally or in short ChatGPT/Claude sessions. But real agentic workflows need:

  • Long-running processes that survive laptop sleeps, network drops, and closed terminals.
  • Multiple specialized agents (researcher, coder, reviewer, orchestrator) working in parallel.
  • Ability to check in from anywhere — phone, café, airport, while traveling.
  • Rock-solid persistence so your agents keep making progress even when you're offline.

This trifecta solves all of that.

The Three Tools

1. tmux — The Heart of Persistence

tmux lets you run multiple terminal sessions inside one window. You can detach and the agents keep working in the background. Reattach later from anywhere.

Key commands I use daily:

tmux new -s claude_researcher
tmux ls                    # see all your agents
tmux attach -t main_orchestrator
# Ctrl+b then d to detach safely

In my setup I have dedicated sessions like:

  • claude_stars
  • grok_build
  • reviewer
  • hermes_orchestrator

Each one runs its own persistent AI agent or script.

2. Tailscale — Your Private Tailnet

Tailscale creates a secure mesh VPN between all your devices and the server. No port forwarding. No exposing SSH to the internet.

Once everything is on the same tailnet, I can SSH into my server using its private IP from anywhere in the world — safely and privately.

3. Termius — The Mobile Terminal That Doesn’t Suck

A polished SSH client that works great on iOS and Android. It handles tmux beautifully and syncs your hosts across devices.

Now I can hop into any tmux session from my phone while waiting in line or during dinner. The experience is smooth enough that I often do real work from my phone.

How the Full Setup Works

  1. Rent a cheap Linux VPS (Hetzner, Contabo, DigitalOcean, etc. — $5–12/month is plenty).
  2. Install Tailscale and join your tailnet (takes 2 minutes).
  3. Install tmux on the VPS.
  4. Launch multiple tmux sessions with your AI agents (Claude Code, Aider, custom Python scripts, etc.).
  5. Connect via Termius from your laptop or phone anytime.

The result: A powerful always-on machine that runs my AI team 24/7 while I live my life.

Cost Breakdown

  • VPS: $5–12/month (even a basic 2–4 core box with 4–8GB RAM handles multiple agents fine)
  • Tailscale: Free for personal use (unlimited devices on the personal plan)
  • tmux: Free (comes pre-installed on most Linux distros)
  • Termius: Free tier is excellent; Pro is optional (~$10/month if you want sync + more features)

Total: Usually under $10–15/month for a very capable always-on AI team.

Tips from Running It for Months

  • Give each major agent its own tmux session — keeps things organized and easy to monitor.
  • Use scripts that auto-restart if they crash (simple bash wrappers or tools like supervisor).
  • Name sessions clearly — tmux ls becomes your personal agent dashboard.
  • Combine with tools like tmuxinator for faster setup of common session layouts.
  • Monitor with simple status scripts (e.g., a cron job that pings you if an agent is idle too long).
  • Use the same tailnet on your phone, laptop, and any other devices you want to control from.

Alternatives & Evolutions

You can swap tools depending on your preferences:

  • Zellij instead of tmux (more modern, but tmux is more universal)
  • Headscale (self-hosted) instead of Tailscale for full control
  • Blink Shell or Termux on Android as alternatives to Termius
  • Add tools like tmux-resurrect or tmux-continuum for even better session persistence

But this particular combination (tmux + Tailscale + Termius) is the sweet spot for simplicity, reliability, and cross-platform mobile support.

Conclusion

My Agent Machine completely changed how I work with AI. Instead of fragile one-off chats that die when I close my laptop, I now have a persistent team of agents that keep working even when I’m offline, traveling, or sleeping.

If you’re serious about agentic workflows — especially the kind of persistent “Chief of Staff” style orchestration we talk about in other posts on this site — I highly recommend building your own version.

It’s cheap, surprisingly simple, and incredibly powerful.

Related Reading

Inspired by real-world agent infrastructure discussions, including this tweet thread.