diff --git a/bin/rclaude b/bin/rclaude index 6e0cae0..18e916a 100755 --- a/bin/rclaude +++ b/bin/rclaude @@ -1522,6 +1522,15 @@ if is_local "$host"; then exit 1 fi sync_tmux_conf local + # RCLAUDE_DETACHED=1 → spawn the tmux session in the background and + # return the session name on stdout. Used by supervisor processes + # (e.g. `clare web`) that want to bring up a Claude session without + # attaching the current terminal. + if [ -n "${RCLAUDE_DETACHED:-}" ]; then + tmux new-session -d -s "$session" "$(build_inner "$dir")" + printf '%s\n' "$session" + exit 0 + fi exec tmux new-session -s "$session" "$(build_inner "$dir")" fi