Control your AI coding agents from your phone
The best thing about agentic coding is that the agent keeps working after you stand up. You kick off a refactor, close the laptop, walk to lunch — and Claude Code is still grinding through the task. The catch is that “still working” only helps if you can still see it and steer it. An agent that hits a question you cannot answer from where you are is an agent that has quietly stalled.
So the missing piece is not more autonomy — it is reach. This post covers three layers that, stacked, let you leave your desk without leaving your agents: persistence so sessions survive you walking away, remote attach so you can reconnect from any device, and phone control so a question waiting on your screen is a question you can answer from a coffee shop.
Layer one: sessions that outlive the connection
A raw claude or codex process is tied to the terminal that started it. Close the terminal, drop the SSH link, or let the laptop sleep, and the agent goes with it. That is the first thing to fix.
mAgent (installed as magent) runs each project’s agent inside psmux on Windows, a persistent session layer. The session lives on the machine, not in your terminal window, so it keeps running whether or not anything is attached. Walk away, lose Wi-Fi, or close the lid — the work continues, and the session is still there when you come back. On Windows you get psmux through Chocolatey:
choco install psmuxThis is the same durability that makes many-session workflows practical in the first place; if you have not set that up yet, start with running multiple Claude Code sessions in parallel.
Layer two: reattach from any SSH client
Because the session persists on the host, getting back to it is just a matter of connecting and attaching. From any SSH client — your other laptop, a tablet with a terminal app, a borrowed machine — you reach the running agent by name:
# from anywhere on the tailnet
ssh you@dev-box
psmux attach -t webThe -t <project> flag picks the session for that project, so you drop straight into the live Claude Code conversation exactly where it was. Detach and the agent keeps going.
The security posture here matters and is worth being precise about. The remote bind is tailnet-only by default: it listens on loopback and your Tailscale address, and the LAN wildcard is never chosen for you — you have to ask for it explicitly with --host. Reaching your agents means being on your tailnet. That is the whole boundary; it is not a public gateway with a password bolted on.
Layer three: steer from your phone
An SSH client on a phone works, but typing into a tiny terminal is not how you want to answer an agent’s question at a bus stop. For that, mAgent leans on Happy, which gives you end-to-end-encrypted control of your Claude and Codex sessions from a browser or phone:
npm install -g happyHappy’s link between your phone and your sessions is end-to-end encrypted — the control channel is not something a relay in the middle can read. From the phone you can watch the agent, send a reply, or approve a step. Screenshots are a first-class input: the uploader runs on every platform, and on Windows the screenshot you upload lands straight in the focused session, so “here is the bug” is a photo, not a paragraph of description.
Want the uploader on your home screen? Run pip install magent-multi-ai-agents-manager[qr] and mAgent prints a QR code for the phone uploader. Scan it, add it to your home screen, and sending a screenshot into the focused session becomes a two-tap action.
Put together, the three layers cover the whole gap. The session persists in psmux, so nothing dies when you leave. You can psmux attach from any SSH client over your tailnet when you want the real terminal. And Happy handles the moments in between — the quick approval, the screenshot, the one-line answer — from whatever device is in your hand.
Knowing when the phone needs you
Remote control solves “I am away and the agent needs me,” but only if you know it needs you. That signal comes from the agents’ own lifecycle hooks, the same ones that drive the local status table. If you have not wired those up, that is the natural companion to this setup — see live status for every AI agent session with lifecycle hooks for how a needs-input state gets surfaced instead of silently waiting.
Get set up
The full walkthrough — installing magent, adding psmux and Happy, and confirming Tailscale and the upload port with magent doctor — is in the install guide. A few minutes of setup buys you the freedom to leave your desk without leaving your agents behind.