<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Kapil's Blog]]></title><description><![CDATA[Kapil's Blog]]></description><link>https://kapilsomani.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a4ae1253537783301989ea0/d7ced150-b59c-4df0-a75e-733f2c93a841.png</url><title>Kapil&apos;s Blog</title><link>https://kapilsomani.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 19:47:34 GMT</lastBuildDate><atom:link href="https://kapilsomani.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Replicating herdr's Agent Monitor in tmux]]></title><description><![CDATA[Monitor Claude AI agent status (busy, waiting, idle) directly in your tmux window names a lightweight bash script inspired by herdr, no sidebar needed]]></description><link>https://kapilsomani.hashnode.dev/replicating-herdr-s-agent-monitor-in-tmux</link><guid isPermaLink="true">https://kapilsomani.hashnode.dev/replicating-herdr-s-agent-monitor-in-tmux</guid><category><![CDATA[herdr]]></category><category><![CDATA[tmux]]></category><category><![CDATA[#agent]]></category><category><![CDATA[custom]]></category><dc:creator><![CDATA[Kapil Somani]]></dc:creator><pubDate>Wed, 08 Jul 2026 00:29:17 GMT</pubDate><content:encoded><![CDATA[<p>Last week my Youtube feed had a couple of <a href="https://herdr.dev/">herdr</a> and how it's pitched as the multiplexer for agentic era. The "finding the agent pane" problem it solves is indeed real and I planned an afternoon to include it my setup.</p>
<p>It was unfortunately annoying for me since I noticed that my "idle" agents kept on disappearing from herdr's agent pane. I'm pretty sure this is related to my setup since I was unable to find any similar complaints on herdr's issues page.</p>
<p>Getting back, I realized that while I had the problem for months now; herdr exposed a brilliant approach to solve it. To be clear, my desires are not for a sidebar but for a marker to show if my agents are either running, idle or waiting for my input. Once I've the signal, I can go back to the right tmux window and jump to right pane to perform the deed.</p>
<p>Voila, 15 mins of herdr... and another 20ish mins with Claude, I was able to devise a bash script which renames the window pane to append the markers signifying the agent states.</p>
<pre><code class="language-shell">#!/bin/bash
# ○ busy   ● waiting   ⊗ idle
#
# Output is intentionally empty — job is renaming windows, not
# displaying status. Status-right just needs to invoke it on a timer.

SESSION_NAME=$(tmux display-message -p '#S')

AGENTS=$(claude agents --json 2&gt;/dev/null)
[ -z "$AGENTS" ] || [ "$AGENTS" == "null" ] &amp;&amp; AGENTS="[]"

PANE_TTYS=$(tmux list-panes -a -t "$SESSION_NAME" -F '#{pane_tty} #{window_id}')

# "window_id status" per agent, resolved via tty
WINDOW_AGENT_LINES=$(while read -r pid status; do
    [ -z "$pid" ] &amp;&amp; continue
    tty=$(ps -o tty= -p "$pid" 2&gt;/dev/null | tr -d ' ')
    [ -z "$tty" ] || [ "$tty" == "??" ] &amp;&amp; continue
    window_id=$(echo "$PANE_TTYS" | awk -v t="/dev/$tty" '$1==t{print $2}')
    [ -n "$window_id" ] &amp;&amp; echo "$window_id $status"
done &lt; &lt;(echo "$AGENTS" | jq -r '.[] | select(.pid != null) | "\(.pid) \(.status // "idle")"'))

while read -r window_id window_name; do
    BASE_NAME=$(echo "$window_name" | sed 's/[●○⊗]*$//')

    STATUS_STR=""
    for s in $(echo "$WINDOW_AGENT_LINES" | awk -v w="$window_id" '$1==w{print $2}'); do
        case "$s" in
            busy) STATUS_STR+="○" ;;
            waiting) STATUS_STR+="●" ;;
            idle) STATUS_STR+="⊗" ;;
        esac
    done

    if [ -n "$STATUS_STR" ] &amp;&amp; [ "${BASE_NAME}${STATUS_STR}" != "$window_name" ]; then
        tmux rename-window -t "$window_id" "${BASE_NAME}${STATUS_STR}"
    elif [ -z "$STATUS_STR" ] &amp;&amp; [ "$window_name" != "$BASE_NAME" ]; then
        tmux rename-window -t "$window_id" "$BASE_NAME"
    fi
done &lt; &lt;(tmux list-windows -t "$SESSION_NAME" -F '#{window_id} #{window_name}')
</code></pre>
<p>tmux.conf setup (both required):</p>
<pre><code class="language-plaintext">set -g status-interval 5
set -g status-right '#(~/.config/tmux/agent_monitor.sh)'
</code></pre>
<p>Please note, that the if already have a status-right; append agent-monitor.sh to it. The script does not produces any output but fires every 5 seconds (configurable) by tmux.</p>
<p>And a tmux reload later, I've the markers I've been waiting for ❤️</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a4ae1253537783301989ea0/99a14151-b0d8-4578-af0b-f731967eeab3.png" alt="" style="display:block;margin:0 auto" />

<p>Credit to <a href="https://herdr.dev/">herdr</a> for this inspiring idea; wouldn't have thought of markers-over-sidebars without seeing their approach first.</p>
]]></content:encoded></item></channel></rss>