No description
Find a file
Natalie 1c575ad263 feat(@scripts): add remote host resolution helper
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-17 18:42:31 -07:00
.gitea/workflows feat(@scripts): add npm publish workflow 2026-04-26 16:13:30 -07:00
bin feat(@scripts): add remote host resolution helper 2026-05-17 18:42:31 -07:00
data docs(wg-mesh): 📝 Update DNS record syntax and configuration documentation for WireGuard mesh hosts 2026-05-11 21:07:27 -07:00
docs docs(@scripts): update rvoice docs to use LAN speech-synthesis 2026-05-17 18:12:14 -07:00
hammerspoon feat(@scripts): add remote host resolution helper 2026-05-17 18:42:31 -07:00
share feat(@scripts): add sudo-less wg-bounce restart tool 2026-05-11 19:21:04 -07:00
tests feat(@scripts): add remote host resolution helper 2026-05-17 18:42:31 -07:00
.gitignore initial: remote-run + tssh + installer 2026-04-25 22:13:25 -07:00
install.sh feat(@scripts): add tmux config installer 2026-04-29 13:27:26 -04:00
package.json deps-upgrade(dependencies): ⬆️ Update dependencies to latest stable versions for bug fixes and security improvements 2026-04-29 10:29:19 -07:00
README.md rclaude: support local tmux mode (host=local|localhost|hostname) 2026-04-25 23:39:21 -07:00
tmux.conf fix(@scripts): 🐛 adjust tmux session display formatting 2026-05-17 08:00:13 -07:00

session-tools

Resilient remote-execution wrappers for SSH/tmux patterns across the lilith host fleet (plum, apricot, black, quinn-vps, ...).

The premise: a bare ssh host cmd dies the moment the transport hiccups, killing whatever was running on the remote. These wrappers run commands inside a detached tmux session on the remote so the work survives the SSH drop.

Tools

  • bin/remote-run <host> <cmd...> — One-shot command runner. Spawns a detached tmux session on <host>, streams stdout/stderr back to your terminal, propagates the exit code. If the local ssh dies mid-run, the tmux session continues; reattach with ssh <host> tmux ls then ssh <host> tmux attach -t <session>.

  • bin/tssh <host> — Interactive shell wrapper. Auto-attaches to (or creates) a per-user tmux session on <host> named claude-$(whoami). Detach with Ctrl-b d; transport drops don't kill the shell.

  • bin/rclaude <host> [dir] — Durable Claude Code session, local or remote. Stacks two resilience layers: tmux survives terminal/transport drops, and claude --continue resumes the per-directory session from ~/.claude/projects/ after anything kills the host itself. Re-running with the same <host> + <dir> always lands back in the same conversation. <host> can be any ssh target, or local/localhost/the local hostname to skip ssh and use a local tmux session (still detachable for terminal/network resilience). Defaults to --dangerously-skip-permissions; override with RCLAUDE_PERMS=default.

Install

On every host that should have these on $PATH:

git clone http://forge.black.local/lilith/session-tools.git ~/Code/@scripts/session-tools
~/Code/@scripts/session-tools/install.sh

Symlinks bin/remote-run and bin/tssh into ~/bin. Pulls future updates via plain git pull — symlinks track the repo automatically.

When to use what

Scenario Use
Interactive shell on a remote tssh <host>
One-off command (build, test, query) remote-run <host> "<cmd>"
Claude Code session on a remote rclaude <host> [dir]
Long-running job (>1h, must survive reboot) systemd --user unit on the remote, not ssh

Per-host shims (optional)

If a particular host gets used a lot, drop a one-liner into ~/bin/:

# ~/bin/apricot-run
#!/bin/sh
exec remote-run apricot "$@"