Repository navigation
Description
Summary
The add-on runs one tmux session, and every browser connection attaches to it. That gives a property worth keeping: open the panel on any device (laptop, desktop, iPhone, iPad) and you are back in the same session, exactly where you left off. This RFC describes how several Claude sessions can already be run today, where that falls short, and options for making it easier, judged against that continuity.
When a second session helps
- Two pieces of work at once, each in its own Claude.
- Not interrupting a running command. Claude may be busy running a long shell command (a build, a backup, a log tail, a script that takes minutes). The panel has only the one terminal Claude is using, so doing anything else means interrupting it or waiting. A second window gives another Claude alongside it while the first carries on.
How it works today
run.shcreates one tmux session,claude, at start-up. ttyd runs thetmux-claudewrapper for each connection, which doestmux attach-session -t claude.- Every tab and device is a client of the same session, so all of them show the same window. tmux sizes it to the most recently active client (the default
window-size latest), so the layout follows whichever device you are using. - Closing the tab, sleeping the laptop or restarting Home Assistant Core leaves the session running; reconnecting re-attaches (and since 2.5.3, does so by itself after sleep or a restart).
A second Claude today
It already works, using tmux windows:
Ctrl-b copens a new window (a shell in/config).- Run
claude, orclaude-session-pickerfor the usual menu (the picker also adds the configured launch flags, such as--remote-control). - Switch with
Ctrl-b 1/Ctrl-b 2, orCtrl-b n/Ctrl-b p. The status bar lists the windows. With tmux Mouse Mode on, clicking a window name switches too.
Both Claudes keep running when you switch away or disconnect, and conversations can be resumed from any window with claude -c / claude -r.
Where it falls short
- All devices switch together. Selecting window 2 on the laptop switches the phone too; you can't watch two Claudes side by side in two tabs.
- Hard on a phone. The key bar has no
Ctrl-b, so creating or switching windows on an iPhone needs a hardware keyboard or Mouse Mode. - Not discoverable. Nothing in the panel says windows exist.
- Some features only see window 1. The login-link notification reads the window Claude starts in.
- Shared workspace. Both Claudes edit the same
/config, and one can restart Home Assistant (or reload YAML) under the other. Plan usage limits are shared, too.
Options
A. Document what exists
Add a "Running a second Claude" section to DOCS.md: the keys below, the picker, Mouse Mode, and the caveats.
| Keys | What it does |
|---|---|
Ctrl-b c |
New window (a shell in /config) |
Ctrl-b 1 … 9 |
Go to that window |
Ctrl-b n / Ctrl-b p |
Next / previous window |
Ctrl-b w |
List all windows with what each is running; pick one with the arrows and Enter |
Ctrl-b , |
Rename the window (shown in the status bar and the list) |
Ctrl-b & |
Close the window, after asking; ends whatever it runs |
tmux new-window claude-session-picker |
A window that closes when you exit the picker, with no shell to exit after |
-
Lower case:
Ctrl-b C(capital, for example with Caps Lock on) opens tmux's options screen instead;qleaves it. -
Avoid
Ctrl-b d: it detaches the panel. The session keeps running, but the panel shows a disconnected terminal until it reconnects. -
Continuity: unchanged (fully kept).
-
Effort: docs only.
-
Limits: all of the shortcomings except discoverability remain.
B. Window controls in the panel
A small window bar in the panel header (or in the phone key bar): the current windows, a + that opens a new window, and a tap to switch. The image service would run tmux list-windows, new-window and select-window on the existing session.
- Continuity: fully kept. It's still one session, so every device shows the same window, and a new device lands where you were.
- Effort: small to moderate (an API endpoint plus some UI). No change to how ttyd or tmux sessions work.
- Limits: devices still switch together, so no side-by-side tabs.
Where the controls go: in the panel header, in the space the title uses now. The phone key bar is already full, and a new row under the header would take lines from the terminal, which a phone with the keyboard up can't spare.
- Wide screens (desktop, iPad landscape): a row of window tabs on the left of the header, with the title shortened. Each tab carries the tmux window name (
claude,bash), and + opens a new window. A dot can mark a window with new output (tmux'swindow_activity_flag), useful when Claude is running a long command in another window. - Phones (under 700px): the title is already hidden and the buttons are icon-only, leaving about 80px. One compact button shows the current window (
2/3 ▾) and opens a short list of the windows plus New window.
Wide: [1 claude] [2 bash] [+] 🗂️ Files 📋 Copy 📥 Paste 🎤 Voice 📎 Upload
Phone: [2/3 ▾] 🗂️ 📋 📥 🎤 📎
tmux's status bar already lists the windows, so with these tabs that list could be kept (it still helps over SSH) or dropped to save a line.
What a new window starts: the same as the first window, following the Start Claude automatically option: Claude straight away when it's on (the picker appears when Claude exits), the picker when it's off. run.sh already builds this as CLAUDE_LAUNCH_CMD, so the new window reuses it. One +, no separate shell option: the picker still offers a Bash shell.
Closing a window: a ✕ on its tab, with a confirm, so you close only the window you are looking at. Closing ends whatever it runs: a Claude mid-command loses that command (the conversation is saved and claude -r resumes it). Exiting Claude already closes its window, and Ctrl-b & closes a stuck one after asking.
Where the ✕ goes:
- Wide screens: at the right end of a tab, shown on the current tab and on hover, so the row stays tidy and a switch doesn't hit it by mistake. On a touch screen (no hover) only the current tab has one, so you see a window before closing it.
- Phones: at the right end of each row in the
2/3 ▾list, with a tap target of about 40px (like the key bar). Tapping the name switches; the ✕ asks first, and names a busy window ("2 claude is busy. Close it anyway?").
Wide: [1 claude ✕] [2 bash] [+]
Phone: 1 claude ✕
▸ 2 claude (busy) ✕
3 bash ✕
+ New window
Fewer steps to leave: a Ctrl-b c window starts a shell, so leaving takes three steps today: exit Claude, choose Exit in the picker, then exit the shell. A window opened with + has no shell underneath, so exiting Claude and then the picker closes it, and the ✕ does it in one. (tmux new-window claude-session-picker gives the two-step version today.)
The last window: closing it ends the tmux session. The next connection starts a fresh one, but that is an abrupt way to lose everything, so the ✕ should be hidden, or ask again, when only one window is left.
The picker: today it only knows its own window. It could list the others above the menu (Other windows: 1 claude (busy), 3 bash) and offer Switch to a window, which makes windows discoverable on a phone even without the window bar. It would not close windows: from the picker you'd be closing one you can't see.
C. Independent views per tab (tmux grouped sessions)
The wrapper attaches each connection to its own session in a group with claude (tmux new-session -t claude, destroyed when the tab closes). All windows are shared, but each tab has its own current window, so tab A can show Claude 1 while tab B shows Claude 2.
- Continuity: needs care. A new connection would normally start on window 1. To keep "carry on where I left off", tmux could record the most recently used window (a
session-window-changedhook setting a global option), and the wrapper would select that window for each new connection. Then a new device opens on the last window used anywhere, while open tabs stay independent. Untested. - Effort: moderate. The wrapper, a hook, the status bar label (per-tab sessions get generated names) and tests. It also interacts with the reconnect fix, since a reload creates a new per-tab session.
- Limits: still needs a way to create and switch windows (B, or the keys).
D. Named sessions, chosen per tab
Several independent tmux sessions (claude, claude-2, ...), each with its own windows. The panel offers a session chooser, and the choice is passed to the wrapper (ttyd's --url-arg) or kept in the URL.
- Continuity: kept per session. Any device can open any session, and it resumes where it was.
- Effort: larger. Session list and creation in the panel, cleaning up unused sessions, and features that assume one
claudesession (the login watcher, the pre-created session at start-up) would need updating. - Limits: more to manage. For most uses, windows (B or C) do the same job with less machinery.
E. Use Remote Control for the second session
With Enable Remote Control on, the add-on's session also appears in the Claude app and at claude.ai/code. A second Claude could be run there (or on the computer itself) without changing the add-on.
- Continuity: kept for the add-on's session; the second session lives elsewhere.
- Effort: none (documentation).
- Limits: the second session doesn't run in the add-on, so it has no access to
/config.
Cross-cutting points
Whichever option is chosen:
- Login notification: the watcher reads
claude's current window. With several windows it could scan all panes (tmux list-panes -a). - Status line: per Claude, so it already works in every window.
- Memory: roughly 500–600 MB per Claude, idle or not. Measured with Home Assistant's add-on stats on 2026-11-15: 1.2 GB for an add-on with two Claudes running, 0.53 GB for one with a single idle Claude (both totals include the image service, ttyd and tmux). The add-on has no memory cap of its own, so on a 2–4 GB Pi or HA Green, three or four Claudes could run the host out of memory, and Linux would then kill a process to recover, possibly Home Assistant Core. Rather than a fixed window limit (too strict on a 16 GB VM, too loose on a Pi), + and the picker would check the host's free memory (
MemAvailablein/proc/meminfo) and ask first below about 1 GB: "Only 0.8 GB of memory is free and each Claude uses about 0.5 GB. Open another anyway?" The window list could also show each window's memory (2 claude (busy) · 540 MB). - Concurrent edits: two Claudes in one
/configcan overwrite each other's changes. Worth a line in the docs; separate working directories or git worktrees per window are possible but out of scope. - Updating Claude with another one running: the picker's Update option (shown with Use a persistent Claude Code install) runs
npm install -ginto/data/npm, replacing the files the other Claude was started from. Untested, but expected: npm moves the old package aside rather than writing over it, so the running Claude keeps the old version until restarted. It could still fail later in its session if it calls a helper file from its package folder (such as the bundled ripgrep) that changed. Two updates started from two windows at once would write into the same folder and could leave a broken install. The picker could take a lock (flock) so only one update runs, and warn when anotherclaudeprocess is running. This applies today withCtrl-b cwindows too.
Suggested path
- A now: it costs nothing and covers most of the need.
- B next: it makes windows usable on a phone and keeps the continuity exactly as it is.
- C later, if side-by-side tabs turn out to be wanted, with the "last window used" hook so a new device still lands where you were.
D and E don't look worth it for now, unless someone needs fully separate sessions.
Feedback welcome, especially on whether side-by-side tabs (C) matter to anyone, or whether a shared window bar (B) would be enough.
Activity
nsleigh commentedon Nov 16, 2026
I have expanded Option B to include some design details. I am probably going to develop this and test it locally, will post a link here if anyone wants to test/comment.
Add a window bar for running more than one Claude (2.5.10)
nsleigh commentedon Nov 20, 2026
I've built option B. There's a beta on my fork if anyone wants to try it before I open the PRs.
Settings → Apps → Install app → Menu → Repositories → Add, and enter:
What's in it (2.5.10)
+opens a new Claude in/config.✕closes a window after you confirm, with a clear warning if it's busy. The last window can't be closed.wswitches to one./data/uploadstrust fix from Trust /data/uploads so Claude stops asking at every start (2.5.9) #91, so Claude stops asking to trust the uploads folder every session.Before installing
Updating the beta
I'll keep the version at 2.5.10 during the beta and post here when I push a fix. Home Assistant won't offer those fixes as an update, so to get one, type this at Claude's prompt in the beta (or run it without the
!in a bash window):The build takes a few minutes. Then the app restarts, which closes every window. Your login, options and conversations are kept, and
claude -cpicks up where you left off. Hard-reload the panel once it's back.So far I've tested it in Chrome on a MacBook, in the HA app on an iPhone, and on an iPad, including the Mac and iPad open at the same time, and updating Claude Code from the picker while Claude was running in five other windows. Feedback is welcome, especially from other browsers and devices, and from smaller machines where memory is tight. If you report a problem, please say when you last updated. I'll open the PRs once it has had more use: first #91, then the picker change, then the window bar.
ESJavadex commentedon Nov 24, 2026
Thanks for putting together the design, the beta, and the device testing, Neil. The shared-session behavior is worth preserving. Let's keep this RFC open for beta feedback. A docs PR covering the existing tmux shortcuts and how window switching follows across devices would be welcome on its own.
nsleigh commentedon Nov 25, 2026
The beta is now 2.5.11. Because the version changed, Home Assistant will offer it as a normal update, so the update command isn't needed this time. Hard-reload the panel once it's installed.
What's changed since 2.5.10:
+works the same way./data/uploadstrust fix (Trust /data/uploads so Claude stops asking at every start (2.5.9) #91) is updated after review.~/.claude.jsonis now written to a copy and renamed into place, so a failed write can't damage it, and an explicit "don't trust" choice is kept.As suggested above, the tmux keys and how windows follow across devices are now in their own docs PR, #94.
Feedback is still welcome, especially from other browsers and devices, and from smaller machines where memory is tight.
ESJavadex commentedon Nov 25, 2026
Thanks, Neil. The existing tmux shortcuts and shared-window behavior are now documented in #94, which is merged. Let’s keep this RFC open for feedback on the beta, especially on touch devices and low-memory hosts. The window bar and picker changes are still up for review.