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 kier group microsoft copilot construction safety 20260908

Kier Group Taps Microsoft Copilot for Safer Construction Sites

Kier Group's Louisa Finlay is deploying Microsoft Copilot to improve safety standards and workforce productivity across UK construction operations.
blog ios 27 live translate iphone guide 20260908

How to Use iOS 27 Live Translate on iPhone for Real-Time Chats

Learn how to use iOS 27 Live Translate on iPhone for real-time chats, calls, and messages. Complete 2026 setup guide, tips, and troubleshooting.
blog samsung one ui 8 tips hidden features 20260906

15 Hidden Samsung One UI 8 Tips Every Galaxy User Should Try in 2026

Discover 15 powerful Samsung One UI 8 tips to unlock hidden features, boost productivity, and customize your Galaxy device like a pro in 2026.
blog openai agent message board apple fix 20260905

OpenAI Agent Message Board Discovery: Fix Apple Device Issues

Users report an unfamiliar OpenAI agent message board appearing on Apple devices. Learn what causes it and how to troubleshoot it safely on macOS and iOS.
blog windows 11 25h2 file sharing not working fixes 2026 20260905

Windows 11 25H2 File Sharing Not Working? 10 Fixes for 2026

Windows 11 file sharing not working after 25H2? Discover 10 proven fixes for SMB errors, access denied issues, and network discovery problems in 2026.
blog apple intelligence slow response fix 20260904

Apple Intelligence Slow Response Times: How to Fix Lag Issues

Apple Intelligence responses feeling sluggish on your iPhone or Mac? Here's a complete troubleshooting guide to fix slow AI performance and lag issues fast.
blog bitwarden app review 2026 best android password manager 20260904

Bitwarden App Review 2026: Best Password Manager for Android 16?

Our Bitwarden app review 2026 tests autofill, passkeys, and security on Android 16 to see if it's still the best free password manager available.
blog google ad tech apple users troubleshooting guide 20260903

Google Ad Tech Ruling Impact on Apple Users: Fix Guide

Apple users report ad tracking glitches, Safari slowdowns, and privacy prompts tied to Google ad tech changes. Here's how to troubleshoot and secure your device.
blog windows 11 passkeys setup 25h2 without microsoft account 20260903

How to Set Up Passkeys on Windows 11 25H2 Without Microsoft Account

Complete windows 11 passkeys setup guide for 25H2 without a Microsoft account. Use Windows Hello, FIDO2 keys, and third-party managers securely.
blog apple intelligence not working iphone fix 20260902

Apple Intelligence Not Working on iPhone: Complete Fix Guide

Apple Intelligence failing to activate, stuck downloading, or missing features on your iPhone? Here's how to fix the most reported issues step by step.

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.