Add sessions-ctl and systemd units for the dev box

sessions-ctl creates, starts, stops and lists Claude Code sessions. Each one
is a checkout in ~/sessions/<name>, a state file and a systemd user unit that
runs claude with Remote Control in its own tmux server. Sessions are restarted
if they crash, come back at boot (linger), and resume the same conversation
by a pinned session UUID.

Over SSH it runs as a forced command: only list/repos/status/create/start/
stop/health are accepted, arguments are validated, and nothing reaches a shell
or Claude as a prompt. refresh-access keeps the key's from= restriction in
sync with the IP of reudy.net (hourly timer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
agent 2026-09-30 11:55:38 +00:00
commit 1816f6f863
7 changed files with 754 additions and 0 deletions

View file

@ -0,0 +1,10 @@
# Re-resolve ssh_access.allow_from_host (e.g. reudy.net) and update the
# from="…" restriction on prod's key in ~/.ssh/authorized_keys if the IP moved.
[Unit]
Description=Refresh the source-IP restriction on the session-manager SSH key
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=%h/.local/bin/sessions-ctl refresh-access