Setting up your spare Mac for Claude Code to control, a step-by-step guide
TL;DR Highlight
Setting up a spare Mac with SSH and tmux gives Claude Code an isolated machine you can drive from your phone.
Who Should Read
A Mac-using developer who wants to run agents with --dangerously-skip-permissions but doesn't trust their main machine.
Core Mechanics
- Isolate the agent on a spare Mac
- Create a fresh local account with no Apple ID and no personal data.
- With nothing sensitive to reach, giving broad permissions is less risky.
- Containers weren't enough
- A container still runs on your main machine, and its network requests go through it.
- Mac-only apps like Unity can't run in one, so computer use can't control them either.
- SSH and sleep prevention are the backbone
- Enable Remote Login and connect with an ed25519 key. The guide recommends a .local hostname over an IP.
- Use pmset to disable sleep and stop the screen saver from locking.
- Computer use doesn't work over plain SSH
- macOS ties Screen Recording and Accessibility permissions to the GUI login session, so SSH processes can't reach the display.
- A LaunchAgent keeps a tmux server alive inside the GUI session, and claude sessions started there inherit access.
Community Reactions
- A VM with libvirt is enough, one commenter argued
- They see no reason for real hardware isolation outside graphics development.
- They give Claude root and a desktop for Chrome UAT, and reinstall in seconds if it breaks things.
- Connection drops reported by someone running the same setup
- They used it as a free replacement for an OpenClaw bot.
- It sometimes loses its connection and the phone handoff must be redone.
- The isolated box still has network access, commenters warned
- It's cut off from your files but can still reach other devices on the network.
- Several suggest a separate VLAN or deny-all firewall rules.
- Giving sudo to an agent is reckless, one commenter said
- They give Claude an unprivileged UNIX account only.
- They don't bother with containers or VMs.
- Alternative setups shared by commenters
How to Apply
- Audit your agent machine's isolation
- Within 30 minutes, list the personal data, Apple ID and logged-in accounts on the machine your agent runs on.
- If you have a spare Mac, create a fresh local account without an Apple ID.
- Set up SSH keys and sleep prevention first
- On the target, run sudo systemsetup -setremotelogin on, then ssh-keygen and ssh-copy-id as in the guide.
- Run sudo pmset -c sleep 0 and verify you can ssh in.
- Put the box on a separate VLAN or behind a firewall
- Move it to a guest network or VLAN on your router.
- Block access to internal devices and allow only internet.
- Grant tmux permissions and restart the server for computer use
- Run setup-computer-use.sh, then enable Screen Recording and Accessibility for tmux at the machine.
- Run tmux -S /tmp/cc-tmux.sock kill-server and confirm it works in a new session.
Try It
# Run in the target Mac's terminal (or over SSH). Summary of steps 3 and 6. {{user}} is the target account name
echo "{{user}} ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/{{user}}-nopasswd >/dev/null
sudo chmod 440 /etc/sudoers.d/{{user}}-nopasswd
sudo visudo -cf /etc/sudoers.d/{{user}}-nopasswd # must print 'parsed OK'
sudo -n true && echo ok
sudo pmset -c sleep 0
sudo pmset -c disablesleep 1
sudo pmset -c displaysleep 0
pmset -g | grep -iE 'sleep'
# Next: on your main Mac run ssh-keygen -t ed25519, then ssh-copy-id {{user}}@{{hostname}}.local, then ssh {{user}}@{{hostname}}.local whoamiTerminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.
Related Resources
- https://ykdojo.github.io/claude-controls-mac/
- https://raw.githubusercontent.com/ykdojo/claude-controls-mac/main/clip.sh
- https://raw.githubusercontent.com/ykdojo/claude-controls-mac/main/setup-claude-env.sh
- https://raw.githubusercontent.com/ykdojo/claude-controls-mac/main/setup-computer-use.sh
- https://raw.githubusercontent.com/ykdojo/claude-controls-mac/main/ic.sh