#!/bin/bash set -euo pipefail # Staying logged in across rebuilds is handled entirely by `claudaris start`, # which bind-mounts ~/.claude/.credentials.json and ~/.claude.json individually # from the host (see claudaris) — nothing to seed or symlink here. # Create the main tmux session if it does not exist. /usr/bin/tmux new-session -d -s main 2>/dev/null || true # tmux's defaults apply here (remain-on-exit off, exit-empty on): a window # closes when its shell exits, the session closes when its last window does, # and the server exits when its last session does. Poll for that and exit # the container once it happens, instead of running forever. while /usr/bin/tmux has-session -t main 2>/dev/null; do sleep 2 done exit 0