Urgent.News

What's breaking now, across thousands of outlets.

Tech

Agent State in the Tmux Status Line

Running multiple agent sessions (Claude Code, Codex, PingMe) simultaneously in tmux windows presents challenges in tracking their status. Checking each window manually becomes impractical beyond three or four windows. Herdr, an agent-first terminal multiplexer, categorizes sessions as working, blocked, done, or idle, and displays them in a sidebar.

However, Herdr is a separate interface that deviates from the common practice of monitoring session status via a status line. agenmux addresses this by keeping tmux untouched and incorporating agent status into a sidebar pane and a status-line segment. Both are separate from the window list. To display agent state on the window list, agenmux writes markers onto the window entries themselves.

Herdr also tracks a fourth state, "done," denoting a session that completed while not visible, which reverts to "idle" on the next visit. This requires tracking the process history of each pane, but the current setup does not support it. Consequently, "done" collapses into "idle," leaving three possible states. To display agent state on the window list, agenmux uses pane_current_command, which identifies the foreground process for each pane.

For Claude Code, the pane title is used, while for other agents, pane_current_command is employed. The process tree is analyzed to determine the presence of an agent. The screen buffer, combined with the pane title, provides insights into the current activity of each agent session. The detection method is scraping-based, identifying agents by walking through the process tree of each pane and inferring the state from the visible screen and title.

Claude Code, Codex, and PingMe utilize different signals to convey their respective states. The configuration for agenmux allows for per-agent pattern matching and ordering.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at thecloudlet.github.io →

More in Tech

Architecture: Write It Down Before Rewriting

Part of the "How to bring order to a project" series — the architecture track. Same context: a growing gamedev project, about twenty services on different stacks, an architecture that "grew…

More from Wednesday 16 September →