feat(session): add detached session mode

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-18 19:38:35 -07:00
parent 2fbcfd494f
commit 977695a1a8

View file

@ -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