Setting Up a Spare Mac for Claude Code Remote Control: Fix Guide

GeneralSetting Up a Spare Mac for Claude Code Remote Control: Fix Guide

Repurposing a spare Mac as a dedicated host for Claude Code — Anthropic’s AI-powered command-line coding assistant — has become a popular workflow among developers who want an always-on machine handling long-running agentic tasks. But as threads in the Apple Support Community make clear, the setup is far from plug-and-play. Users report a consistent set of headaches: SSH connections that silently fail, Full Disk Access prompts that never appear, background processes killed by macOS power management, and Claude Code sessions that terminate the moment the remote user logs out.

This is a widespread, actively discussed problem. If you’re trying to turn an old MacBook or Mac mini into a remote-controlled coding workstation and hitting walls, this guide walks through the causes and the fixes that actually stick on modern macOS releases (Sonoma, Sequoia, and Tahoe).

What Causes This Issue

The root of the trouble is that macOS is designed as a personal, interactive operating system — not a headless server. Several security and power-management layers actively work against the kind of unattended remote automation Claude Code needs. The most common causes reported by users in the Apple Support Community include:

  • Remote Login (SSH) is disabled by default, and enabling it via System Settings often doesn’t grant the necessary permissions to child processes.
  • macOS Transparency, Consent, and Control (TCC) blocks Claude Code from accessing folders like Documents, Desktop, or Downloads unless the parent terminal has Full Disk Access.
  • The Mac sleeps, disconnects Wi-Fi, or suspends background processes when the lid closes or no user is logged in at the console.
  • Login shells launched over SSH don’t inherit the same environment variables (PATH, API keys) as an interactive Terminal window, so the claude CLI can’t find Node.js or its credentials.
  • Apple Silicon Macs enforce stricter code-signing rules that can block Homebrew-installed binaries from running under launchd without explicit permissions.

Step-by-Step Fixes

No single accepted solution has emerged in the community thread, but the following sequence resolves the vast majority of setup failures reported by users. Work through it in order.

  1. Enable Remote Login properly. Open System Settings, go to General, then Sharing, and toggle on Remote Login. Click the info icon and set access to “All users” or add specific accounts. Verify by running ssh user@mac-hostname.local from another device on the same network. If it fails, confirm the Mac’s hostname in Sharing and try the IP address instead.
  2. Grant Full Disk Access to the SSH daemon and your shell. This is the single most-missed step. Go to System Settings, Privacy & Security, Full Disk Access. Click the plus button and add /usr/sbin/sshd-keygen-wrapper (use Shift+Cmd+G in the file picker to type the path). Also add Terminal, iTerm, and — critically — the binary at /bin/zsh or /bin/bash. Without this, Claude Code will silently fail to read or write project files.
  3. Install Claude Code in a shell-agnostic location. Install Node.js via Homebrew (brew install node), then run npm install -g @anthropic-ai/claude-code. Confirm the binary lands in a globally accessible path such as /opt/homebrew/bin. Add that path to a login-shell config file like ~/.zprofile — not just ~/.zshrc — so SSH sessions pick it up.
  4. Persist your Anthropic API key. Export ANTHROPIC_API_KEY in ~/.zprofile, or better, store it in the macOS Keychain and retrieve it via a small wrapper script. SSH sessions do not load GUI keychain items automatically, so relying on Keychain Access alone will break unattended runs.
  5. Prevent sleep and lid-close suspension. Open Terminal and run sudo pmset -a disablesleep 1 to prevent clamshell sleep on laptops. Alternatively, in System Settings under Displays and Battery, set the machine to never sleep when plugged in and enable “Prevent automatic sleeping on power adapter when the display is off.”
  6. Enable automatic login and Wake for Network Access. Under Users & Groups, set automatic login for the Claude Code account (this requires FileVault to be off, or a stored unlock key). In Energy or Battery settings, enable Wake for Network Access so the Mac responds to SSH after idle periods.
  7. Test end-to-end. From your primary machine, SSH in and run claude –version, then start a session in a project directory. Confirm it can read files, write changes, and run git commands without permission prompts.

Additional Solutions

If the basics work but reliability is still shaky, layer on these refinements. Users in the Apple Support Community have highlighted the first two as particularly helpful for long-running sessions.

  • Run Claude Code inside tmux or screen. Launching tmux new -s claude before starting Claude Code lets you disconnect from SSH without killing the session. Reattach later with tmux attach -t claude. This solves the “session dies when I close my laptop” complaint entirely.
  • Set up Tailscale or a similar mesh VPN. Exposing SSH to the open internet is risky. A private mesh network gives you a stable hostname reachable from anywhere without port forwarding, dynamic DNS, or firewall gymnastics.
  • Use SSH key authentication only. Generate a key with ssh-keygen -t ed25519, copy the public key to ~/.ssh/authorized_keys on the spare Mac, and disable password auth by editing /etc/ssh/sshd_config. Restart Remote Login afterward.
  • Create a launchd agent if you want Claude Code or a wrapper script to start automatically at boot. Place a plist in ~/Library/LaunchAgents and load it with launchctl. Remember that launchd processes don’t inherit shell environment — set variables explicitly in the plist.
  • Point Claude Code at a dedicated workspace outside iCloud Drive. Files inside iCloud-synced folders can be evicted from local storage, causing unpredictable read failures during long agentic runs.
  • Monitor with a lightweight dashboard. Tools like btop or a simple cron job that pings a healthcheck URL will alert you when the machine goes offline instead of discovering it hours later.

When to Contact Apple Support

Most Claude Code setup problems are configuration issues, not hardware faults. Contact Apple Support only if you observe symptoms unrelated to the software layer: kernel panics on wake, Ethernet or Wi-Fi hardware that drops repeatedly under low load, a Mac that refuses to boot to a login window, or persistent T2/Secure Enclave errors that block Remote Login from being enabled at all. If System Integrity Protection or MDM policies are blocking changes (common on ex-corporate machines), Apple Support can help verify the device is properly deregistered from Apple Business Manager.

FAQ

Does Claude Code work on Intel Macs? Yes. Node.js runs fine on Intel, and the CLI is architecture-agnostic. Older Intel MacBooks make excellent dedicated hosts, though battery health and thermals should be checked.

Can I run Claude Code without keeping a user logged in? Yes, via SSH once Remote Login is enabled — but the account still needs to exist and have Full Disk Access granted. Automatic login at boot is the most reliable path.

Why does Claude Code work in Terminal but fail over SSH? Almost always a PATH or permissions problem. Move environment setup to ~/.zprofile and add /bin/zsh to Full Disk Access.

Will closing my MacBook’s lid kill the session? Only if sleep isn’t disabled. Run pmset to prevent it, or use an external display and power adapter with clamshell mode configured to stay awake.

Is this setup safe to expose to the internet? Not directly. Use key-only SSH plus a mesh VPN. Never open port 22 to the public without additional hardening.

Neil S
Neil S
Neil is a highly qualified Technical Writer with an M.Sc(IT) degree and an impressive range of IT and Support certifications including MCSE, CCNA, ACA(Adobe Certified Associates), and PG Dip (IT). With over 10 years of hands-on experience as an IT support engineer across Windows, Mac, iOS, and Linux Server platforms, Neil possesses the expertise to create comprehensive and user-friendly documentation that simplifies complex technical concepts for a wide audience.
Watch & Subscribe Our YouTube Channel
YouTube Subscribe Button

Latest From Hawkdive

You May like these Related Articles

blog open source ai mac troubleshooting guide 20260718

Open Source AI Not Working on Mac? Fixes for Local LLM Issues

Struggling to run open source AI models like Llama or Mistral on your Mac? Here are the fixes for crashes, slow performance, and Metal errors on Apple Silicon.
blog microsoft comic chat open source macos fix 20260717

Microsoft Comic Chat Open Source: Running It on macOS Fix Guide

Microsoft Comic Chat is now open source, but Mac users hit roadblocks running it. Here's how to fix compatibility, IRC, and emulation issues on macOS.
blog apple intelligence not working fix 20260716

Apple Intelligence Not Working on macOS 26? Fix It Now

Apple Intelligence failing on your Mac or iPhone? Follow this Hawkdive troubleshooting guide to fix stuck downloads, missing features, and Siri errors fast.
blog jurassic park computer systems mac guide 20260715

Jurassic Park Computer Systems Explained: Fix Guide for Fans

A deep-dive troubleshooting and reference guide to the computers shown in Jurassic Park, plus fixes for related macOS retro-computing setups.
blog iphone personal hotspot data usage per device 20260715

How to Check iPhone Personal Hotspot Data Usage Per Device in 2026

Learn how to check iPhone personal hotspot data usage per device, monitor connected devices, and limit tethering data in iOS 26 with this complete guide.
blog apple ai generated content flag fix 20260713

Apple Devices Flagging AI-Generated Content: Fixes & Workarounds

Struggling with AI-generated article detection on Apple devices? Here's a practical troubleshooting guide with fixes, settings tweaks, and expert tips.
blog macos sequoia 15 7 iphone mirroring setup older macs 20260713

How to Set Up macOS Sequoia 15.7 iPhone Mirroring on Older Macs

Complete macOS iPhone mirroring setup guide for Sequoia 15.7 on older Macs. Fix connection issues, enable Continuity, and control your iPhone from Mac in 2026.
blog mesh llm iroh distributed ai apple fix 20260712

Mesh LLM on iroh: Fixing Distributed AI Issues on Apple Devices

Troubleshoot Mesh LLM distributed AI computing on iroh across Apple devices. Fix peer discovery, model sharding, and connection errors on macOS and iOS.
blog best project management software mac 2026 20260712

12 Best Project Management Apps for Mac in 2026 Compared

Discover the best project management software for Mac 2026 with our detailed comparison of 12 top apps, features, pricing, and Apple Silicon support.
blog apple openai trade secret lawsuit user guide 20260711

Apple vs OpenAI Trade Secret Lawsuit: What Users Need to Know

Apple's lawsuit against OpenAI over alleged trade secret theft raises real user concerns. Here's how to protect your Apple Intelligence data and account security.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.