Skip to content

Instantly share code, notes, and snippets.

@jubishop
Created February 28, 2026 21:51
Show Gist options
  • Select an option

  • Save jubishop/2cdf9ab378868e612b6fecdc59d67b0e to your computer and use it in GitHub Desktop.

Select an option

Save jubishop/2cdf9ab378868e612b6fecdc59d67b0e to your computer and use it in GitHub Desktop.

Plan: Claude Code Remote Control via launchctl

Context

You want a persistent Claude Code remote-control session running in the background on your Mac, accessible from your phone at any time. This avoids needing to manually open a terminal and run claude remote-control every time.

What we'll create

File: ~/Library/LaunchAgents/com.jubi.claude-remote.plist

A LaunchAgent that:

  • Runs claude remote-control --permission-mode acceptEdits --verbose
  • Working directory: /Users/jubi/Desktop/podhaven
  • Passes MAX_THINKING_TOKENS=10000 environment variable
  • Logs stdout/stderr to ~/.claude/remote-control.log
  • Uses KeepAlive = true so it auto-restarts if the process exits
  • Starts automatically on login (RunAtLoad = true)

Key details:

  • Binary path: /Users/jubi/.local/bin/claude
  • --verbose flag for connection diagnostics in logs
  • acceptEdits permission mode (reads/edits freely, prompts for shell commands)

After creating the plist

  1. Load it: launchctl load ~/Library/LaunchAgents/com.jubi.claude-remote.plist
  2. Verify it's running: launchctl list | grep claude
  3. Check logs: tail -f ~/.claude/remote-control.log
  4. Connect from phone via Claude app — the session should appear in claude.ai/code

Management commands

  • Stop: launchctl unload ~/Library/LaunchAgents/com.jubi.claude-remote.plist
  • Restart: unload then load again
  • View logs: cat ~/.claude/remote-control.log

Verification

  1. After loading, confirm the process is running via launchctl list | grep claude
  2. Check ~/.claude/remote-control.log for the session URL
  3. Open the URL or find the session in the Claude app on your phone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment