ai newsSo., 25. Okt.
EilmeldungGive Claude a read-only straw to your SQLite DB: a tiny MCP server in Python

Dutzend Claude-Code-Sessions parallel: tmux-Konsole zeigt, welche Aufmerksamkeit braucht

Mit claude-tmux-sessions lassen sich viele Claude Code Sessions parallel in tmux betreiben. Die Tools beantworten, welche Session wartet, was die anderen gerade tun und wie man mit ausgeschöpften Kontingenten umgeht. Der Code steht unter MIT-Lizenz.

dev.toSonntag 05:43 · 25.10.DE3 Min. Lesezeit
Bild: dev.to

TL;DR: claude-tmux-sessions ist ein kleiner Satz von tmux-Werkzeugen, um viele Claude Code Sessions parallel laufen zu lassen. Es beantwortet drei Fragen, die ich mir immer wieder gestellt habe: Welche Session wartet auf mich, was machen alle anderen gerade, und was tue ich, wenn einem Account die Quote ausgeht? MIT-Lizenz, tmux plus bash plus python3, angetrieben durch Claude Code Hooks.

Zuerst etwas Kontext, sonst wirkt das Design seltsam.

Ich nutze zwei Claude Accounts, um mehrere Projekte gleichzeitig voranzutreiben:

Das summiert sich zu einer Menge gleichzeitig offener Sessions, mehr als eine Person im Blick behalten kann. tmux verwaltet nur Fenster; es hat keine Ahnung, was das Claude in jedem Fenster gerade tut. Daher dieses Projekt.

Jede Session meldet ihren Zustand über Claude Code Hooks, und die Statusleiste zählt sie mit:

Die vier Zähler bewegen sich nie von der Stelle: eine Null wird grau, behält aber ihren Platz, sodass man aus Muscle Memory klicken kann. Ein Klick auf ⏸ springt zu der Session, die am längsten wartet; ein Klick auf ✔ zeigt eine Liste nur der fertigen, aber ungelesenen Sessions:

Diese Liste ist ein schwebendes Pane von tmux 3.7, kein display-popup, weshalb ein Klick irgendwo außerhalb sie schließt. display-popup schluckt Klicks außerhalb seines Rahmens.

prefix + g listet alle Sessions auf, gruppiert nach tmux Session (bei mir eine pro Projekt), mit einer Live-Ansicht der Session unter dem Cursor. Jede Zeile ist nummeriert; tippt man die Zahl, springt man dorthin. Es verhält sich wie ein Posteingang: Der Besuch einer Session markiert sie als gelesen, und ruhige werden standardmäßig eingeklappt, sodass die Liste nur das zeigt, was einen braucht.

Jedes Claude bekommt rechts eine Seitenleiste, die sich nur um diese Session kümmert:

Die Buttons für git und files öffnen lazygit und yazi schwebend über den rechten 60 Prozent des Fensters, sodass das Claude auf der linken Seite nicht neu umbricht; ein Klick außerhalb lässt sie verschwinden:

Faustregel: Globales gehört in die Statusleiste, Dinge zur aktuellen Session in die Seitenleiste. Die Statusleiste hat wenig Platz, und so bleiben beide aufgeräumt.

Klickt man in der Seitenleiste auf ⇄, beendet sich die Session und kommt als claude --resume mit derselben Session-ID unter dem anderen Account zurück. Dasselbe Gespräch, derselbe Kontext. Es gibt Schutzmechanismen: Eine Session, die gerade arbeitet, wird in Ruhe gelassen; eine mit ungesendetem Text im Prompt wird in Ruhe gelassen (das Beenden würde ihn verlieren); bei einem Fenster mit Agent-Team-Mitgliedern wird dem Lead zunächst eine Zeile geschrieben mit der Bitte, das Team herunterzufahren, und erst umgeschaltet, wenn diese beendet sind.

Die tmux-Konsole ist eines von vier Elementen. Ich diktiere außerdem fast jeden Prompt mit einem Push-to-Talk-Sprachwerkzeug (ein LLM Korrektur liest jedes Transkript, und Claude fügt die Wörter, die es falsch verstanden sieht, selbst dem Vokabular hinzu) und sehe mir Nutzung und Konfiguration in einem lokalen Web-Dashboard an. Das ist in docs/workbench.md beschrieben.

Klone das Repository und führe das Installationsskript mit dem Parameter --lang en aus. Dann fügt man eine Zeile zur tmux-Konfiguration hinzu, source-file ~/projects/claude-tmux-sessions/tmux/claude-tmux.conf, und nimmt die Statusleisten-Segmente in die eigene Statuszeile auf; die README führt Schritt für Schritt daran entlang.

Bekannte Grenzen, vorab: Ich benutze es täglich ausschließlich auf macOS (Linux ist ungetestet); man braucht einen Nerd Font für die Icons; und einige Funktionen lesen den Bildschirm von Claude Code, sodass eine Änderung der Claude Code Oberfläche eventuell eine nachträgliche Korrektur erfordert. Issues und PRs sind willkommen.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

TL;DR — claude-tmux-sessions is a small set of tmux tools for running many Claude Code sessions in parallel. It answers three questions I kept asking myself: which session is waiting on me, what is everyone doing, and what do I do when one account runs out of quota? MIT, tmux + bash + python3, driven by Claude Code hooks.

Some context first, or the design will look odd.

I use two Claude accounts to push several projects forward at the same time:

That adds up to a lot of sessions open at once, more than one person can watch. tmux only manages windows; it has no idea what the Claude inside each window is doing. Hence this.

Each session reports its state through Claude Code hooks, and the status bar counts them:

The four counts never move: a zero turns grey but keeps its place, so you can click from muscle memory. Click ⏸ to jump to the session that has waited longest; click ✔ to get a list of just the finished-but-unread ones:

That list is a tmux 3.7 floating pane, not display-popup, which is why clicking anywhere outside closes it — display-popup swallows clicks outside its box.

prefix + g lists every session, grouped by tmux session (for me, one per project), with a live view of the one under the cursor. Every row is numbered; type the number to jump. It behaves like an inbox: visiting a session marks it read, and quiet ones fold away by default, so the list shows only what needs you.

Every Claude gets a sidebar on its right that is about this session only:

The git and files buttons open lazygit and yazi floating over the right 60 % of the window, so the Claude on the left doesn't re-wrap; click outside and they're gone:

Rule of thumb: global things go on the status bar, things about the current session go on the sidebar. The status bar is short on space, and this keeps both uncluttered.

Click ⇄ on the sidebar and the session exits, then comes back as claude --resume of the same session id under the other account. Same conversation, same context. There are guard rails: a session that is working is left alone; one with unsent text in its prompt is left alone (exiting would lose it); a window with agent-team teammates first gets a line typed to the lead asking it to wind the team down, and switches once they've exited.

The tmux console is one of four pieces. I also dictate almost every prompt with a push-to-talk voice tool (an LLM proofreads each transcript, and Claude adds the words it sees misheard to the vocabulary itself), and look back at usage and configuration in a local web dashboard. That's written up in docs/workbench.md.

git clone https://github.com/threedaycat/claude-tmux-sessions.git ~/projects/claude-tmux-sessions ~/projects/claude-tmux-sessions/install.sh --lang en Enter fullscreen mode Exit fullscreen mode Then add one line to your tmux config, source-file ~/projects/claude-tmux-sessions/tmux/claude-tmux.conf, and put the status-bar segments into your own status line; the README walks through it.

Known limits, up front: I use it daily on macOS only (Linux is untested); you need a Nerd Font for the icons; and a few features read Claude Code's screen, so a Claude Code UI change may need a follow-up fix. Issues and PRs welcome.

Originaltitel: I run a dozen Claude Code sessions at once. This tmux console tells me which one needs meQuelle: dev.to (dev.to). Original öffnen