Skip to content

Scripting

The sidebar writes agent state into tmux pane options on every hook event, so you can pick them up from any script with tmux show -t <pane> -pv <key>.

Terminal window
# Get a specific pane's agent status
tmux show -t "$pane_id" -pv @pane_status
# → running / waiting / idle / error / (empty)
# Get agent type
tmux show -t "$pane_id" -pv @pane_agent
# → claude / codex / opencode / (empty)
KeyValue
@pane_statusrunning / waiting / idle / error / empty
@pane_attention1 while the pane is flagged for attention, otherwise empty
@pane_agentclaude / codex / opencode / empty
@pane_nameFriendly agent/session name (from /rename on Claude)
@pane_rolesidebar for the sidebar pane itself; empty for agent panes
@pane_promptLatest user prompt text or response preview
@pane_prompt_sourceuser when the prompt field holds the user’s prompt, response when it holds the agent’s last reply
@pane_started_atEpoch seconds of the last UserPromptSubmit
@pane_wait_reasonWait-reason text (populated only when waiting)
@pane_subagentsComma-separated subagent labels (Claude only)
@pane_cwdWorking directory reported by the agent (preferred over pane_current_path)
@pane_permission_modePermission-mode string for the badge (plan / edit / auto / ! / …)
@pane_worktree_nameWorktree label when the pane was spawned from the sidebar
@pane_worktree_branchBranch that was auto-created for the worktree
@pane_session_idAgent session ID (opaque; useful for correlating logs)
  • Status bar integration — surface @pane_status in your tmux status line to light up when an agent needs attention.
  • Custom notifications — if you don’t like the built-in desktop notifications, build your own pipeline off the same pane options.
  • Shell aliases — gate side-effectful commands on agent state.
Terminal window
# only show the indicator when a status is set
set -g status-right '#(tmux show -t #{pane_id} -pv @pane_status) | %H:%M'

If you pair this with a custom notifier, mirror the filter set supported by @sidebar_notifications_events — see Notifications.