Here’s a full step-by-step guide on how to turn your spare Mac into an always-on machine Claude Code can fully control, with computer use enabled. You’ll be able to talk to it from your phone through the Claude app, or from your main Mac over SSH.
In case you’re reading this on GitHub Pages, here’s the repo version:https://github.com/ykdojo/claude-controls-mac.
I wanted to create a separate environment Claude Code can control on its own, so I can delegate tasks I don’t necessarily want to run on my own machine - certain types of research tasks, and development tasks.
Claude Code, especially with the --dangerously-skip-permissions flag on, carries inherent risk when run on your main machine. You can eliminate / mitigate these risks by creating a separate environment on your spare Mac with everything it needs to have access to.
It has an added bonus of being able to talk to Claude Code anytime, anywhere from your phone. I’ve personally found it really useful because I often prefer to talk to Claude Code instead of regular Claude on the mobile app - Claude Code is often more capable.
The following guide assumes you have your main Mac as well as a spare Mac you can set up for this, but you should be able to take inspiration from it and apply it to any combination of two machines.
First, let’s quickly address a few questions you might have.
I’m a big proponent of running it in a container - I even built an entire environment for doing so conveniently:https://github.com/ykdojo/safeclaw. However, I’ve found it has a few limitations. First, it still runs on your main machine, so it’s not completely separated. For example, network requests it sends still go through your main machine.
Second, there are limitations to the container’s capabilities. For example, I wanted my agent to be able to run Unity for game development, and there’s no easy way to do that in a container. The same goes for any other app that’s only available on a Mac - you won’t have access to it. That’s especially relevant if you want Claude Code to control these apps through computer use - clicking, dragging, and so on.
I personally like having access to the full, latest features of Claude Code. I also like being able to control it from the Claude app - I’ve found it really convenient. And you get to use your Claude subscription usage if you happen to have one, which is an added bonus.
At the end of the day, running an agent with broad permissions is safer on a machine that has nothing to lose - but you get the benefit of being able to use a full Mac instead of a container. The approach here:
You’ll be giving the agent full access to this machine, so it can reach anything stored on it. If there’s existing data you don’t want it to have access to, erase the machine first:
Optionally update to the latest macOS afterward (System Settings -> General -> Software Update).
The account needs admin rights or sudo will refuse to run.
On the target , turn on SSH so the source Mac can connect:
If the command fails with Turning Remote Login on or off requires Full Disk Access privileges , give your terminal app Full Disk Access first:
This is so the agent (and your SSH commands) can run admin tasks without a password prompt each time. Run this once on the target. It asks for the login password this one time:
This creates a small rule file telling the Mac that can run sudo without a password prompt:
After this, sudo runs with no prompt - test with sudo -n true , which succeeds silently if passwordless sudo works.
You can reach the target by either a hostname or an IP. I recommend using the hostname: it stays the same, while the IP can change.
Hostname (recommended). Run on the target:
Add .local to form the address: .local . You can also read it from System Settings -> General -> Sharing, shown as Local hostname .
Give the target a unique name. Each Mac needs a .local name that’s unique on your network. If two machines share a name, the address can point to the wrong Mac. Make sure the target’s name is unique - rename it if needed:
IP address (not recommended). Run on the target:
Note that the IP can change after a reboot or after a certain amount of time.
Throughout the rest of this guide, replace with the target account name and with the hostname from above, so the address is @ .local . You could also instead use an IP in place of .local .
On the source Mac, create an SSH key (skip if you already have one):
Install your public key on the target. This asks for the target account’s login password once:
Test it - this should print the target username with no password prompt:
By default macOS sleeps after ~10 minutes idle, even when plugged in, which takes it off the network. To make it never sleep, run this on the target (or over SSH from the source):
sleep 0 , SleepDisabled 1 , and displaysleep 0 in the output confirm it worked.
If the machine runs on battery sometimes, use -a instead of -c to apply to all power sources (at the cost of battery drain).
The screen can still lock when the screen saver kicks in. Stop the screen saver from ever starting so it never locks on its own:
macOS ships pbcopy (write clipboard) and pbpaste (read clipboard). Piped over SSH, they can move the clipboard between machines - encrypted, peer-to-peer, no Apple ID or third-party service.
clip.sh :/claude-controls-mac/clip.sh wraps this into one command with two subcommands, and adds image support on top of pbcopy / pbpaste (which are text-only). Install it as a script on your PATH on the source Mac, and point it at the target host with IC_BOX (“ic” standing for “isolated claude”):
Send the install command over and run it. From the source Mac you can push it straight to the target’s clipboard, or run it remotely. The following command installs a specific version, but you can also install latest or stable if you’d like:
The native installer may warn that ~/.local/bin is not on PATH. Fix it on the target by adding it to ~/.zshenv (not ~/.zshrc ) - .zshenv is read by every zsh, including non-interactive ones:
This optional step applies a set of opinionated defaults via setup-claude-env.sh :/claude-controls-mac/setup-claude-env.sh - shell aliases, the DX plugin, settings.json tweaks, the GitHub CLI, and (opt-in) Playwright MCP and yt-dlp. Every item is toggleable; see the full list in claude-env-components.md :/claude-controls-mac/claude-env-components.html.
Interactively on the target - shows a checklist of every item (core pre-checked, opt-ins unchecked) so you can pick any combination. Download the script onto the target and run it:
Non-interactively - the script goes into this mode if it detects a non-interactive environment or you supply at least one flag. No prompt; installs core only by default, or pick what you want with flags ( --yt-dlp , --playwright , --all , --core ):
The script is idempotent (OK to re-run).
Both logins are interactive, so SSH in:
Then run claude on the target - it drops into the login for your Anthropic account. Follow the prompts (a browser/device-code flow you can finish from a browser on your main Mac).
GitHub - optional, but highly recommended so the agent can work with repos:
If you haven’t installed the GitHub CLI from the previous step:#9-set-up-an-opinionated-claude-code-friendly-environment-optional, make sure to do so first.
I personally recommend using a separate GitHub account, not your main one, so it doesn’t mess up your main account.
This lets an interactive claude session on the target see (screenshots) and control (mouse/keyboard) its own desktop, driven over SSH.
This doesn’t work out of the box - SSH and macOS’s permission model get in the way, so the setup below exists to route around that.
Why it needs a workaround: macOS gates screen capture and input behind Screen Recording and Accessibility permissions that are tied to the GUI login session, so an SSH process can’t reach the display. Fix: a LaunchAgent keeps a tmux server alive inside the GUI session on a fixed socket; every claude session created there lands on that server and inherits the GUI session, so it can reach the display. You attach over SSH.
Run setup-computer-use.sh :/claude-controls-mac/setup-computer-use.sh on the target:
This installs the LaunchAgent (persistent tmux server with anchor session cc ) and enables the built-in computer-use tool in ~/.claude.json . Requires tmux ( brew install tmux ) and a Claude Pro or Max plan. Re-runnable; --uninstall to remove.
Install ic.sh :/claude-controls-mac/ic.sh ( ic = “isolated claude”) on the source Mac:
Each ic spawns its own claude session on the box (run several at once) and attaches. Flags mirror claude , and it adds several more subcommands:
All ic sessions run with --dangerously-skip-permissions (and ic rc uses --permission-mode bypassPermissions ).
Copying text out: sessions run in tmux, and Terminal.app can’t receive the clipboard escape sequences (OSC52) that claude emits, so mouse-selecting a snippet won’t reliably reach your Mac clipboard. Quick workaround: Cmd-A then Cmd-C copies the whole visible screen.
Because every ic session lives on the box’s tmux server at a fixed socket, a Claude Code session on your source Mac can prompt one directly over SSH - useful for delegating work to the box and checking on it, agent to agent:
Screen Recording and Accessibility can only be granted in the GUI, and a human has to do it at the machine (in person or via Screen Sharing) - macOS blocks synthetic clicks on these prompts. On first capture you’ll also Allow a “bypass the window picker” prompt (recurs ~monthly).
The grants go on tmux , not claude . macOS attributes capture/control to the responsible process in the chain, which here is the tmux server (claude runs as its child). So:
To make the entries appear in System Settings in the first place, trigger a computer-use action ( ic , then ask Claude to “take a screenshot”) - macOS adds tmux to the list (toggled off) so you can switch it on.
I personally like to run a VPN on the box so its traffic goes out separately from my local IP. I use Proton VPN - it has a free option and I’ve been using them for a long time - but of course there are other options.
