Always-on Claude Code Remote Control server for macOS: access every repository in your work folder from claude.ai/code or the Claude mobile app, 24/7, even with the laptop lid closed.
A single claude remote-control process serves exactly one directory, and
worktree mode requires a git repository — one process cannot cover a folder
full of repositories. The supervisor (supervisor.sh) solves this:
- scans
WORK_DIR(default~/work, up to 2 levels deep:~/work/repoand~/work/group/repo); - keeps
claude remote-control --spawn worktree --no-create-session-in-dirrunning for every git repository — each remote session gets an isolated git worktree; - serves non-git folders without nested repositories in
--spawn same-dirmode (disable withSERVE_NON_GIT=0); - rescans the folder every
SCAN_INTERVALseconds: new repositories are picked up automatically, servers of removed ones are stopped, crashed ones (e.g. after a network outage longer than ~10 minutes) are restarted; - automatically marks new repositories as trusted
(
hasTrustDialogAcceptedin~/.claude.json) — otherwise Remote Control requires runningclaudeonce in the directory manually (disable withAUTO_TRUST=0); - the supervisor itself runs as a launchd LaunchAgent: starts at login,
auto-restarts on crash (
KeepAlive).
--no-create-session-in-dir keeps restarts from creating new empty sessions
and cluttering the list on claude.ai/code; sessions are created only on
demand from claude.ai/code or the mobile app.
Claude Desktop is not required — Remote Control lives entirely in the CLI.
- macOS (the scripts are compatible with the system bash 3.2);
- Claude Code CLI ≥ 2.1.200, logged in with a subscription account;
jq— for auto-trusting new repositories (without it, trust manually).
git clone git@github.com:mnasyrov/claude-rc-supervisor.git && cd claude-rc-supervisor
./install.sh # creates the config, installs the LaunchAgent, starts it
./status.sh # check: supervisor state and the list of servers
./uninstall.sh # stop everything and removePersonal settings live outside the repository — in
~/.claude-rc-supervisor.env (bash syntax; install.sh creates it from
claude-rc-supervisor.env.example).
Main parameters:
| Parameter | Default | Purpose |
|---|---|---|
WORK_DIR |
~/work |
Folder with repositories |
SCAN_INTERVAL |
60 |
Rescan period, seconds |
IGNORE_PATTERNS |
— | Glob patterns of folders to skip |
PERMISSION_MODE |
default | Permission mode of remote sessions (acceptEdits, …) |
SERVE_NON_GIT |
1 |
Serve non-git folders (same-dir) |
AUTO_TRUST |
1 |
Auto-accept the trust dialog for new repositories |
CLAUDE_BIN |
from PATH |
Path to the claude binary |
After changing the config:
launchctl kickstart -k gui/$(id -u)/com.claude-rc-supervisorLogs: ~/Library/Logs/claude-rc-supervisor/ — supervisor.log plus one
log per repository (rotated at 10 MB).
./disable-attribution.shTurns off Claude Code attribution — the Co-Authored-By: Claude trailer in
git commits and the "Generated with Claude Code" note in pull request
bodies — for all projects of the current user, including remote sessions
spawned by the supervisor. The script merges the following into
~/.claude/settings.json, keeping the rest of the file intact:
{
"attribution": {
"commit": "",
"pr": ""
},
"includeCoAuthoredBy": false
}The attribution strings must be strings — empty removes the "Generated
with Claude Code" note — while includeCoAuthoredBy: false drops the
Co-Authored-By: Claude trailer.
./setup-power.sh # configure pmset
./setup-power.sh --disable-spotlight # + disable Spotlight indexing
./setup-power.sh --restore # restore default settingsThe script sets via pmset:
| Setting | Value | Meaning |
|---|---|---|
sleep |
0 |
Never sleep |
disablesleep |
1 |
Forbid sleep entirely, including lid closed |
displaysleep |
5 |
Turn the display off after 5 min (harmless) |
disksleep |
0 |
Never spin down disks |
autorestart |
1 |
Start automatically after a power failure |
lidwake / acwake |
1 |
Wake on lid open / power adapter connect |
womp |
1 |
Wake on LAN (with Ethernet) |
ttyskeepawake |
1 |
Stay awake while ssh sessions are active |
powernap |
0 |
Power Nap is pointless without sleep |
repeat wake 8:00 |
daily | Safety-net wake-up |
With disablesleep 1, third-party utilities (Amphetamine, caffeinate) are
redundant.
Important:
- Power: with the lid closed on battery the machine will not sleep, but it will drain — keep it plugged in.
- Auto-login: the LaunchAgent starts after login. For self-recovery after a power failure enable auto-login (System Settings → Users & Groups → Automatically log in as…). Auto-login is incompatible with FileVault — either disable FileVault or log in manually after a reboot.
- Network: after an outage longer than ~10 minutes remote-control processes exit on their own — the supervisor restarts them on the next scan.
- Everything in
WORK_DIRbecomes remotely accessible from claude.ai/code and the Claude mobile app under your Claude account. Keep the folder to code you actually want reachable; exclude the rest viaIGNORE_PATTERNS. AUTO_TRUST=1(default) bypasses Claude Code's trust dialog — a safety barrier that normally makes you confirm each new workspace. Any repository that appears inWORK_DIR(including a freshly cloned third-party one with potentially maliciousCLAUDE.mdor hooks) is trusted and served automatically. If untrusted content may land in your work folder, setAUTO_TRUST=0and accept new repositories manually by runningclaudein them once.- Avoid
PERMISSION_MODE=bypassPermissionsfor an always-on server: remote sessions would execute commands without any confirmation. Prefer the default mode oracceptEdits. - Access to the servers is tied to your Claude account session; anyone who can sign in to your claude.ai account can open sessions on this machine.
One server per repository — one node process (~100–300 MB RAM idle).
Exclude spare clones/sandboxes via IGNORE_PATTERNS.
| File | Purpose |
|---|---|
| supervisor.sh | The supervisor (core logic) |
| claude-rc-supervisor.env.example | Config template (copied to ~/.claude-rc-supervisor.env) |
| install.sh | LaunchAgent installation + start |
| uninstall.sh | Stop and remove |
| status.sh | Supervisor and server status |
| setup-power.sh | macOS setup for 24/7 operation |
| disable-attribution.sh | Optional: disable Claude attribution in commits/PRs |