Running Claude Code Over SSH on a Mac Mini M4 with tmux

Fazm Team··3 min read

Running Claude Code Over SSH on a Mac Mini M4 with tmux

The setup is simple but powerful - a Mac Mini M4 sits in a closet running 24/7 with tmux sessions for different agent tasks. SSH in from any laptop, tablet, or even a phone to manage everything.

Why a Dedicated Mac Mini

Your daily laptop has limitations for running AI agents continuously. It sleeps, it travels, it runs out of battery, and it gets slow when five Claude Code instances are fighting for resources. A dedicated Mac Mini M4 solves all of this:

  • Always on - launchd keeps it awake, no lid to close
  • Unified memory - 24GB or 64GB shared between CPU and GPU for local model tasks
  • Low power - draws about 10 watts idle, cheaper than a light bulb
  • macOS native - full access to accessibility APIs, screencapture, and native app control

The tmux Setup

Each tmux session runs a dedicated agent task:

  • pr-review - watches for new PRs and runs automated code review
  • social - handles social media posting on a cron schedule
  • monitor - checks production logs and alerts on anomalies
  • dev-1 through dev-3 - available for on-demand development tasks

When you SSH in, tmux attach -t pr-review drops you right into that agent's session. You can check its work, adjust instructions, or kill and restart it.

The Thin Client Experience

From your laptop, the workflow is: open terminal, ssh mini, tmux ls to see what is running, attach to whichever session needs attention. Your laptop does zero compute. All the token processing, file I/O, and agent execution happens on the Mini.

This means you can use a cheap laptop, an iPad with a terminal app, or even SSH from your phone in a pinch. The Mini is the brain. Everything else is just a screen.

Practical Tips

  • Use tmux set-option -g history-limit 50000 to keep enough scrollback for agent output
  • Set up SSH keys so you never type a password
  • Use mosh instead of SSH for unreliable connections
  • Run caffeinate -s to prevent sleep even without a display connected

The Mac Mini M4 as an always-on agent server is one of the highest-leverage hardware investments you can make.

Fazm is an open source macOS AI agent. Open source on GitHub.

More on This Topic

Related Posts