Vibe Coding 24/7 On A Screen For Ants

Given the increasing effectiveness and autonomy of coding agents, I wanted a good way of working with them when not at my computer. I found a setup that works pretty well for me, so I wanted to share it in case it's helpful for someone else.

I've been using Claude Code as my primary agentic coding tool for about 6 months now, so all examples here will use that, although I'm guessing it could be used with others. Claude Code has been solid and continually improving, especially with Opus 4.5. (But I guess ask me in a few months… :D)

Tailscale

The key part of a setup like this is having some computer that has Claude Code set up, and then being able to securely connect to it.

My current overall approach is to set up a secure network through Tailscale so I can SSH to it.

flowchart LR
    Phone["📱 Phone
(Termius)"] TS["🔒 Tailscale"] Mac["💻 Mac
(Claude Code)"] Phone --> TS --> Mac

I set up my main computer (currently M3 Max Macbook Pro) to run Tailscale. First, run the Tailscale daemon with $ sudo tailscaled. (This changed my computer's hostname for some reason, which was not super desirable.)

Then configure your computer to accept SSH connections from anyone in your tailnet (basically your authenticated devices):

$ tailscale set --ssh

It seems like Tailscale has two (three!) Mac interfaces:

  • a native Mac app (used for connecting to the Tailscale network)
  • the same, but installable through the app store
  • and one that's a CLI interface.

You need the CLI version to be able to run the tailscale ssh command, and the versions seem to need to agree with one another or you get warnings and possibly issues:

Warning: client version "1.90.8-tccf4f3c7c" != tailscaled server version "1.86.4-t3149aad97-g60158502b"
The Tailscale SSH server does not run in sandboxed Tailscale GUI builds.

For overall stability, it would probably be a good idea to have the main computer be some server instead of a laptop to be able to connect when the laptop is closed or sleeping. Until I get one set up, I have been using Amphetamine to keep my Macbook Pro awake. One thing I like about Amphetamine is that it has the ability to keep the Mac awake sometimes when in clamshell mode. This is similar to the Caffeine app I previously used. I think I ran into some issue with using that on Apple silicon mac, but maybe I was looking at the wrong site.

I'm guessing that there are other similar services, but for my needs, Tailscale seems to work consistently well and has a generous free tier. This is a pretty simple use case, so might play around with it for having some file servers or media servers or other things in the future.

SSHing from your phone

First, you need to install Tailscale on your phone and connect to the tailnet.

I have an Android phone, so I'm running the Termius app on my phone for SSH. You can enter your computer's tailnet address into the client configuration so it is a one-button startup the next time.

I don't totally love the Termius app, but it's pretty decent. Small shortcomings in this context:

  • keyboard shortcuts are a bit finicky and some aren't supported (shift+enter for newline, for example)
  • font doesn't support certain characters like emojis, and Claude likes to use emojis
  • the (beta) voice dictation integration stops after like a second of inactivity, which makes it difficult to use
  • autocorrect is off by default, and turning it on generally gives better results but sometimes it garbles the text

Usually I'll issue a prompt and then want to be notified when Claude has finished/responded. To hear beep noises from your SSH session, you can type /config, then set Notifications to Terminal Bell (\a) and be sure your phone volume is up.

Session persistence with tmux

One challenge with this setup is that if you get disconnected, you lose your current session and have to get back to it. To fix this, I like to use tmux for session persistence. (This random blog post has a decent overview of how to use tmux for this purpose) I haven't really dialed in the tmux config, but with so little screen real estate, I'm mostly only running one window at a time anyway.

Sometimes the terminal will reprint your entire buffer, which is not ideal, as it is slow and you can't read the current output while it's happening. I think this is a scroll bug in Claude Code. For me it seems to happen more when in a tmux session, but maybe that's because it's a longer session?

It will disconnect when you switch from home wi-fi to cell network (or vice versa), but you can just reconnect your SSH session.

Viewing websites

When developing websites, it's useful to view the website. To do this, you can run $ tailscale serve <port> on the host machine. This will expose the service running on that port to your tailnet. Then you can connect by typing in the URL to your mobile browser. (Example: https:​//my-computer.tail123455.ts.net)

One nice thing is that this is effectively a mobile view of your site, so you can test how it works on a real device pretty easily. It's slightly slower than a normal connection, which is actually a benefit in my opinion to optimize your site. (I believe you can do this on your computer with Chrome devtools and on your phone in the same manner, but it's nice to have this option.)

Claude Code niceties

I added the following to my global CLAUDE.md file, which are good for less typing on the computer or especially on the phone:

If I type just:
  "c", I mean "continue"
  "ss", I mean "restate current state as short summary"
  "dnmac", I mean "do not make any changes"
  "UR" (sometimes "ur") -> "update requirements files accordingly"

I also made the following custom command (/phone-mode). This is a bit newer and less vetted than the other commands but it seems directionally useful.

# Phone Mode Instructions

This is a shortcut for when I'm on my phone (possibly biking) or have a bad
connection and need quick, concise information.

Attempt to make solid progress with minimal back-and-forth. You are agentic and
can make progress autonomously.

If you need more details, ask specific, targeted questions rather than
open-ended ones. Ideally I could respond with a number or minimal words.

Prefer short answers, bullet points, or numbered lists.

Ideally keep responses under ten lines.

At the beginning of each response, write `[PHONE MODE]` to indicate and
remember you're in phone mode. If I want to exit phone mode, I'll explicitly
say so.

Best kinds of tasks

I have found that something that the agent can make meaningful progress on mostly unassisted is best. So something where there is heavy lifting but there are good tests or automated ways of determining goodness. I have had some good success with:

  • adding tests, especially when paired with code coverage metrics
  • fixing flaky tests
  • adding features, with tests

For some specific small projects:

  • improving recipes in my recipes repo
  • getting organized with set of Markdown files for life tasks
  • fixing things on my blog

Categories: main

« Avoid Losing Work with Jujutsu (jj) for AI Coding Agents

Comments