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 chatgpt gpt 5 6 sol luna apple devices fix 20260807

ChatGPT GPT-5.6 Sol and Luna Access Issues on Apple Devices: Fix Guide

ChatGPT GPT-5.6 Sol slow or Luna unavailable on iPhone, iPad or Mac? Here's how to fix access, login and model selection problems on Apple devices.
blog apple devices google services not working fix 20260806

Apple Devices Failing to Load Google Services? Fix Guide

Fix Google service disruptions on iPhone, iPad and Mac. Troubleshoot sign-in errors, sync failures and app crashes with this Hawkdive guide.
blog genai coding assistants macos troubleshooting 20260805

GenAI Coding Assistants Failing on macOS: Fixes That Work

Fix unreliable GenAI coding assistants on macOS with practical troubleshooting steps, Xcode integration tips, and proven workflow adjustments for Apple developers.
blog run large qwen llm mac iphone ram fix 20260804

Running Large Qwen LLMs on Mac and iPhone: Fix RAM Issues

Struggling to run 80B Qwen on Mac or 35B on iPhone with low RAM? Hawkdive's guide fixes memory errors, crashes, and slow inference on Apple Silicon.
blog language model 6502 processor troubleshooting 20260803

Apple Community Fix: Language Model on 6502 Processor Issues

Troubleshoot running an autoregressive language model on the 6502 processor with practical fixes, memory workarounds, and Apple community-tested solutions.
blog apple intelligence financial advice not working fix 20260802

Apple Intelligence Financial Advice Not Working? How to Fix It

Apple Intelligence giving vague or inaccurate financial answers on iPhone, iPad, or Mac? Here's how to fix prompt handling, Siri handoff, and privacy blocks.
blog chrome crashing mac june update fix 20260801

Chrome Crashing on Mac After June Update? Here’s How to Fix It

Chrome crashing or freezing on your Mac after recent security updates? Here's a complete troubleshooting guide to restore stable browsing on macOS.
blog deepseek v4 flash update apple fix 20260731

DeepSeek-V4-Flash Update Issues on Apple Devices: Fix Guide

Struggling with the DeepSeek-V4-Flash update on your Mac, iPhone or iPad? Follow this troubleshooting guide to fix crashes, install errors and slowdowns.
blog apple intelligence not publishing research fix 20260730

Apple Intelligence Not Publishing Research: Fixes & Workarounds

Apple Intelligence features failing to sync, publish, or share research summaries? Here's a complete troubleshooting guide with confirmed fixes for 2026.
blog tailscale jailbroken kindle troubleshooting fix 20260729

Tailscale on Jailbroken Kindle Won’t Connect? Fix It Fast

Tailscale failing on your jailbroken Kindle? Here's a practical troubleshooting guide to fix connection drops, key errors, and sleep-mode disconnects.

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.