Only one `happy` instance works reliably when detached in tmux
Description
Subsequent instances work while attached but do not receive responses when detached.
Running multiple happy instances simultaneously (e.g., in separate tmux windows) causes all but the first instance to stall. Claude Code stops responding mid-reply when the tmux session is detached. Upon reattaching, it catches up and resumes — but stalls again on the next detach.
Steps to Reproduce
- Start
happyin tmux window 1 — works fine, survives detach/reattach - Start
happyin tmux window 2 (same machine, same directory) - Detach window 2 — window 2 no longer responds in Happy
- Reattach — any queued responses land in Happy
Multiple sessions work while attached. Multiple detached sessions do not.
Environment
- macOS (Apple Silicon)
- happy-coder (latest via npm)
- Claude Code latest
- tmux 3.6
- Connecting via Eternal Terminal
Expected Behavior
Multiple happy instances should either work concurrently while detached, or the CLI should warn that only one instance is supported at a time.
Actual Behavior
The second instance appears to start normally but stalls when the terminal is detached. No error message is shown.
This looks like a good place to separate three states that can otherwise get conflated:
- tmux session exists and is detached
- Happy still has a live route to the intended Claude process
- that process actually advances after input / remote messages while detached
The failure pattern here sounds like the second or third state is going stale for all but the first instance. I would log session/window/pane, process generation, attached/detached state, and a small post-send receipt: applied / stale / rejected / timeout. That would make the UI say "detached but still consuming" vs "detached and no longer advancing" instead of just "session exists".
I ran into the same product boundary while building Faryo: the phone/browser layer only counts once the action lands back in the same live tmux session, not when the relay accepts it. This v1.0.7 GIF is the proof shape I ended up using:
https://github.com/Snailflyer/faryo/releases/download/v1.0.7/faryo-public-redacted-same-session-handoff-walkthrough-20260528-0120.gif