rc-shepherd
Keep your Claude Code projects one tap away on your phone. rc-shepherd keeps a Remote Control server running for every project you work on, so you can start or resume sessions from the Claude mobile app, Claude desktop or claude.ai/code at any time, without SSH-ing into the machine to type claude rc in tmux.
Unofficial. rc-shepherd is an independent community project. It is not affiliated with, endorsed by or supported by Anthropic. It runs the official, unmodified Claude Code CLI; "Claude" and "Claude Code" are trademarks of Anthropic.
It is meant for people who work on their own headless Linux machines (a home server, a VPS, a workstation you reach over SSH). One small supervisor, a single systemd user service with no dependencies, follows Claude Code itself: every project you trusted and used with claude gets its own claude remote-control server, kept alive across crashes, reboots, logouts and Claude Code updates.
- Zero setup per project: open a folder with
claudeonce, and it shows up in the app within a minute. - Self-healing: crashed servers restart with backoff; an expired login is reported instead of retried every few seconds.
- Update-aware: after a Claude Code update, each server moves to the new version once its sessions are idle.
- Stays out of your way: servers you start by hand are left alone, and option changes never interrupt a session unless you ask for it.
- Tunable: permission mode, spawn mode (
same-diror one git worktree per session), capacity and filters, globally or per project.
$ rc-shepherd status
supervisor pid 272732 · config ~/.config/rc-shepherd/config.toml
api · running · pid 275126 · up 3h 12m · 0 restart(s)
web · running · pid 272734 · up 3h 12m · 1 restart(s)
$ rc-shepherd list
skip /home/me (home folder: Claude Code never saves its trust, so Remote Control cannot run there)
serve /home/me/code/api (has Claude sessions)
serve /home/me/code/web (has Claude sessions)
skip /home/me/code/demo (untrusted: run `claude` there once)
Requirements
- Linux with systemd (user services), Python 3.11+
- Claude Code logged in with a Claude subscription that includes Remote Control
- Lingering enabled so the service survives logouts:
sudo loginctl enable-linger "$USER"
Install
curl -fsSL https://raw.githubusercontent.com/herbalizer404/rc-shepherd/main/install.sh | sh
The script installs rc-shepherd into its own virtual environment (~/.local/share/rc-shepherd/venv), links rc-shepherd into ~/.local/bin, installs bash completion, asks before installing the user service, then runs rc-shepherd doctor. Read it first if you prefer, or run it from a checkout:
git clone https://github.com/herbalizer404/rc-shepherd && sh rc-shepherd/install.sh
- Run it again to upgrade. It asks before restarting the service (that interrupts work in progress in its sessions); without a terminal it leaves the service running.
- Options:
--yes(no questions),--no-service,--ref TAG(e.g.--ref v0.4.1, see releases),--source SPEC(any pip requirement: a checkout, a wheel,git+ssh://git@github.com/herbalizer404/rc-shepherd.gitfor a private copy). - Uninstall:
sh install.sh --uninstall, or--uninstall --purgeto also remove the configuration and state. - Without the script, from PyPI:
pipx install rc-shepherd(oruv tool install rc-shepherd), thenrc-shepherd service install.
Quick start
rc-shepherd config init # optional: writes a commented config file
rc-shepherd doctor # checks claude, login, lingering, projects
rc-shepherd service install # writes, enables and starts the user service (the installer offers it)
By default rc-shepherd follows Claude Code itself: every project anywhere in your home folder that Claude Code lists as trusted (~/.claude.json) and that already has Claude sessions is served, at any depth. Nothing else is: a folder you never opened with claude is ignored, and so are projects outside your home folder and folders inside hidden ones (such as the worktrees Claude Code keeps in .claude/worktrees). To add a project, open it once:
cd ~/code/my-app && claude # accept the trust prompt, send a message, quit
rc-shepherd reload # or wait up to a minute
rc-shepherd list # every candidate and why it is served or skipped
To serve fewer projects, narrow roots (e.g. ["~/projects"]), set a depth, or use allow, deny, active_within and max_servers. To serve one outside your home folder, declare it: rc-shepherd enable /srv/app. The home folder itself is never served: Claude Code never saves its trust, so Remote Control refuses to run there. For sessions that are not tied to one project, open claude once in a folder such as ~/hub: it is then served like any project.
Then open the Claude app: the project shows up as a Remote Control environment where you can start new sessions.
Commands
| Command | Description |
|---|---|
status [--json] |
Servers run by the supervisor: pid, uptime, restarts, last error, pending option changes |
list [--json] |
Every candidate project and why it is served or skipped |
enable <path> / disable <path> |
Declare a project in the config (comments are kept, a .bak is written) |
restart <name|path> / restart --all |
Restart servers, for example after updating Claude Code |
reload [--apply] |
Reload the config; --apply also restarts servers whose options changed |
config show|check|init |
Effective config as JSON, validation, example file |
doctor |
Checks the binary, login, lingering, service, projects, settings files and memory |
service install|uninstall|status|logs [-f] [--all] |
Manage the systemd user service; uninstall --purge also removes the configuration and state |
completion bash|zsh |
Print a shell completion script (the installer sets up bash) |
run [--dry-run] |
Run the supervisor in the foreground; --dry-run prints the server commands |
--config FILE works with every command (service install --config FILE bakes it into the unit).
Configuration
~/.config/rc-shepherd/config.toml: every key is optional, unknown keys are rejected. See config.example.toml for the full reference.
[discovery]
mode = "auto" # "auto" (Claude's projects below roots + [[project]]) or "list" ([[project]] only)
roots = ["~/projects", "~/work"] # default ["~"]: the whole home folder
depth = 1 # levels below each root (default 0 = any); also lists unknown folders
active_within = "30d" # skip projects without a recent session (default: no limit)
allow = [] # globs on the folder name, or the path if they contain "/"
deny = ["*-archive", "~/projects/sandbox"]
max_servers = 10 # the most recently active projects win
[defaults]
permission_mode = "" # "" = this machine's Claude Code settings
spawn = "same-dir" # or "worktree": one git worktree per new session
capacity = 32
[[project]] # served even outside roots and filters
path = "~/projects/api"
spawn = "worktree"
permission_mode = "acceptEdits"
[[project]]
path = "~/projects/legacy"
enabled = false # declared but not served
[supervisor]
min_free_memory = "1GiB"
on_failure = "notify-send 'rc-shepherd' '{name}: {reason}'"
restart_on_update = "idle" # or "off"
idle_after = "30m" # how long sessions must be idle before that restart
Per-server options ([defaults], overridable per [[project]]): permission_mode, spawn, capacity, settings, chrome ("", "on", "off"), name_template ({name}, {parent}, {host}), extra_args, env, allow_bypass.
Option changes are applied when a server next starts, so a reload never interrupts your sessions unless you pass --apply.
Permissions and security
- Leaving
permission_modeempty keeps whatever your Claude Code settings say, exactly as if you had typedclaude rcyourself. Approval prompts appear in the Claude app. bypassPermissionsis refused unless the same table also setsallow_bypass = true, anddoctorreports it.settingsfiles are passed with--settings. Keep them outside the projects (sessions could edit them) and not writable by other users;doctorchecks both.- Sessions run on this machine with your user's rights. Anyone who can use your Claude account can use them.
- Servers run with the service's
PATH, captured when you runservice install(--pathto override). - See SECURITY.md for the security design and how to report a vulnerability.
How it works
- Every
interval(default 60s) and onreload, the projects listed in~/.claude.jsonbelow the roots are checked for trust there and for history in~/.claude/projects/*/*.jsonl. With adepthabove 0, the folders found under the roots are listed too, solistcan explain why they are skipped. - Each served project gets
claude remote-control --spawn <mode> --capacity <n> --name <name> [...]in its own process group. Output goes to the journal, once per line (the CLI redraws its screen in place). - A server that exits is restarted after 5s, then 10s, 20s… up to 5 minutes. The delay resets after 10 minutes of healthy run. After
on_failure_afterfailures in a row,on_failureruns once. - A server that stops because the Claude login is missing or expired shows
login requiredinstatusanddoctor, is retried at the longest delay, andon_failureruns at once with{reason}=login. - Each server remembers the Claude Code version it started with. After an update,
statusanddoctorflag the servers still on the old one; withrestart_on_update = "idle"(the default), each one restarts on the new version once its sessions are idle: none of them runs a command (a child process of the session) and none of their transcripts changed foridle_after(default 30 minutes). Idle sessions reattach on their own after the restart, so work in progress is never interrupted. - If you run
claude rcby hand in a served folder, the supervisor leaves it alone and takes over when it exits. - Stopping the service stops every server (SIGTERM, then SIGKILL after
stop_timeout). An invalid config at startup exits with code 78 and systemd does not loop.
Limitations
- The machine must stay on: sessions run here, the apps only display them.
- Restarting a server interrupts the work in progress in its sessions. Remote Control keeps its environment, so existing sessions reattach on their own after the restart.
- An old session may refuse to reattach after a restart ("Session failed" in the logs): start a new session from the app.
- Running
service install,service uninstallorsystemctl --user restart rc-shepherdfrom a session served by the service ends that session too (it runs inside the unit). The CLI detects it, prints its report first and queues the restart without waiting. - After a Claude Code update, a server whose sessions keep working keeps the old version until they pause for
idle_after, or until you runrestart(always withrestart_on_update = "off"). - Sessions run inside the service, so what their own programs log (
sudo,docker…) lands in its journal too:service logsshows only rc-shepherd's lines,service logs --alleverything. - In
same-dirmode, sessions of a project share one checkout; usespawn = "worktree"to isolate them. - An idle server uses about 120-200 MB of RAM.
- If the Claude login expires, servers stay down (retried every
maxdelay) until you log in again (claude auth login). - Linux only for now (systemd and
/proc). launchd support is welcome.
Alternatives
- A few projects only:
claude rcin tmux, or a hand-written systemd unit per project, may be enough. - No need for your own machine, tools or network: Claude Code cloud sessions run on Anthropic's infrastructure and need no server at all.
- Claude Code may offer a native background service in the future; this tool would then become unnecessary.
Usage and terms
You remain bound by Anthropic's terms (Claude Code legal and compliance, Consumer or Commercial Terms, Usage Policy). This tool is designed to stay within ordinary, individual use:
- It runs the official
claudebinary unmodified, signed in with your own account. It never reads, stores or forwards credentials or session tokens. - It only keeps Remote Control available. It never sends prompts or drives sessions by itself: a person types every message from a Claude app.
- Do not use it to share your account, to serve other people through your subscription, or to run unattended agents on a Pro/Max plan (use an API key for automation).
- Subscription usage limits assume ordinary individual use of Claude Code.
Development
python3 -m venv .venv && .venv/bin/pip install -e '.[dev]'
.venv/bin/ruff check src tests
PYTHONSAFEPATH=1 .venv/bin/coverage run -m pytest && .venv/bin/coverage report # 100% lines and branches
RC_SHEPHERD_INTEGRATION=1 .venv/bin/pytest tests/test_install_script.py # full install.sh run (uses PyPI)
Tests use a fake claude executable and never start a real Remote Control server. See CONTRIBUTING.md.
License
Metadata
Release files for rc-shepherd 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rc_shepherd-0.6.1.tar.gz | 60.1 kB | With provenance | Details for rc_shepherd-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rc_shepherd-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for rc_shepherd-0.6.1-py3-none-any.whl |
Total release size: 97.5 kB
Release files / rc_shepherd-0.6.1.tar.gz
| Download URL | rc_shepherd-0.6.1.tar.gz |
|---|---|
| Size | 60.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
188210b64073a3359bb5b19cfb77e829abf7668800eb1661f348a9e40d82bd88
|
|
BLAKE2b-256 checksum How to use checksums |
c86d5ba45772fc6972b8cf0c05930379767216fb8f71ebe515e37985518b130e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / rc_shepherd-0.6.1-py3-none-any.whl
| Download URL | rc_shepherd-0.6.1-py3-none-any.whl |
|---|---|
| Size | 37.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9163c34e30dd0f16ccc88acaaf29221bb503c05ca4ce50515cb6853491f5a79b
|
|
BLAKE2b-256 checksum How to use checksums |
7ddff4add595139d4b27589a52492ad5804685f848feb247209e8e5bbe239078
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for rc-shepherd 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for rc_shepherd-0.6.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.