From d145983188f4e2d6d2e67b29d1065785b4935e9b Mon Sep 17 00:00:00 2001 From: Natalie Date: Wed, 20 May 2026 02:13:38 -0700 Subject: [PATCH] =?UTF-8?q?feat(@scripts):=20=E2=9C=A8=20add=20detached=20?= =?UTF-8?q?tmux=20session=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- bin/rclaude | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/rclaude b/bin/rclaude index 3f184a8..5bc6277 100755 --- a/bin/rclaude +++ b/bin/rclaude @@ -1599,6 +1599,16 @@ fi setup_host "$host" sync_tmux_conf "$host" inner=$(build_inner "$dir") +# RCLAUDE_DETACHED=1 → spawn the tmux session on the remote in the +# background and print the session name. Symmetric with the local-host +# detached branch above; used by supervisor processes (e.g. clare web) +# that bring up a remote Claude pane without attaching the calling tty. +# Mosh is interactive-only — always go through ssh for detached spawn. +if [ -n "${RCLAUDE_DETACHED:-}" ]; then + ssh $_SSH_LIVE_OPTS "$host" "tmux new-session -d -s '${session}' \"${inner}\"" + printf '%s\n' "$session" + exit 0 +fi # `new-session -A` attaches if a session of that name already exists, so # re-running rclaude after a broken pipe lands you back in the same tmux # session instead of erroring with "duplicate session". Combined with