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 wii remote mac bluetooth pairing fix 20261031

Nintendo Wii Remote Not Connecting to Mac: Bluetooth Pairing Fixes

Fix Wii Remote Bluetooth pairing failures on Mac. Step-by-step guide for macOS Sequoia, Sonoma, and older versions. Covers sync issues, Dolphin emulator, and Apple Silicon.
blog herdr native app ios fixes login sync crashes 20261030

Herdr Native App Not Working on iOS: Fixes for Login, Sync & Crashes

Herdr iOS app crashing, failing to login, or not syncing? Step-by-step fixes for the new native Mastodon client from Apple Support Community reports.
blog macos 27 battery optimization tips apple silicon 2026 20261030

macOS 27 Battery Optimization Tips for Apple Silicon Macs in 2026

Boost your Mac's battery life with macOS 27 battery optimization tips for Apple Silicon. Learn power management, M4 settings, and how to reduce drain effectively.
blog apple health app not syncing data fix 20261029

Apple Health App Not Syncing Data: Complete Fix Guide

Fix Apple Health app sync issues with step-by-step solutions. Restore activity data, workout records, and iCloud backup across iPhone and Apple Watch.
blog android 16 material you theming customize colors 20261029

Android 16 Material You Theming: Customize Colors Across Apps

Master android 16 material you theming with dynamic colors, wallpaper sync, and per‑app palettes. Step‑by‑step guide to personalize your UI.
blog iphone battery draining fast ios 18 fix 20261028

iPhone Battery Draining Fast After iOS 18 Update Fix

Fix rapid battery drain after iOS 18 update. Step-by-step solutions from Apple Support Community reports and expert troubleshooting.
blog ios 27 live activities sports track real time scores 20261028

iOS 27 Live Activities: Track Sports Scores in Real Time on iPhone

Learn how to use iOS 27 Live Activities to track sports scores in real time on iPhone with setup tips, customization, and battery advice.
blog fix older mac apps wont open after macos update 20261027

Older Mac Apps Won’t Open After macOS Update? Fix Compatibility Issues

Fix older Mac apps that won't launch after updating macOS. Step-by-step solutions for 32-bit, Rosetta 2, and Gatekeeper compatibility problems.
blog windows 11 25h2 gaming mode optimize fps 20261027

Windows 11 25H2 Gaming Optimization: How to Optimize PC for Maximum FPS

Learn windows 11 25h2 gaming optimization steps to boost FPS, enable Game Mode, and tweak settings for peak gaming performance on Windows 11.
blog fix iphone battery drain ios 18 update 20261026

Fix iPhone Battery Drain After iOS 18 Update: Complete Guide

iPhone battery draining fast after iOS 18? Learn why it happens and follow step-by-step fixes from Apple Support Community reports and expert knowledge.

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.