All articles
Tonis Tiganik--9 min read

tmux AI Agent Status: Show Working, Waiting, and Done

Show Claude Code, Codex, and OpenCode status in tmux. Learn how ClawTab detects working, waiting, idle, and finished agents—and why idle isn't done.

tmux AI Agent Status: Show Working, Waiting, and Done

Introduction

A tmux window can tell you that codex, claude, or opencode is still running. It cannot tell you whether the agent is writing code, waiting for approval, ready for another prompt, or stuck. Those are application states, not process states.

ClawTab adds that missing layer to the tmux status bar. A yellow ! means an agent needs input. A cyan * means recent work is in progress. A green means a supported agent is present but currently idle. The markers are derived from provider lifecycle events when available and conservative terminal observation when they are not.

The important caveat is simple: idle is not the same as finished. A quiet interactive agent may have completed its last turn, may be waiting for the next prompt, or may have stopped producing visible output while a subprocess continues. This guide explains what each marker proves, how ClawTab derives it, and how to test the result across Claude Code, Codex, and OpenCode.

The Status Bar Legend

ClawTab appends its markers to your existing tmux window format. It does not replace the theme or require a separate sidebar. The state is aggregated at the window level, so a window with several panes can show both attention and activity when different agents are doing different things.

MarkerMeaningWhat it provesWhat it does not prove
!Waiting or askingAt least one detected agent pane has a visible question, approval, or provider attention eventThat every pane in the window is blocked
*WorkingAt least one pane has a working lifecycle state or recent meaningful terminal activityThat a particular task will succeed
Present and idleA supported agent is still present and is neither working nor askingThat the task is complete, correct, or ready to merge
No markerNo detected agentClawTab has no current agent record for that windowThat the pane is empty; it may contain a shell, server, editor, or unsupported tool

For one pane, asking suppresses working because the blocked state is more useful. Across a multi-pane window, the status can show ! and * together: one pane needs you while another is still moving.

Why tmux Cannot Detect Agent State by Itself

tmux keeps programs running after clients detach and exposes stable pane IDs, foreground commands, output capture, and custom options. Those primitives make it a good runtime for coding agents. They do not give tmux a definition of “waiting for approval.”

A foreground PID is especially weak evidence. An interactive agent remains alive after it finishes a turn. A child process may keep running after the agent stops printing. A spinner may repaint the same text without adding scrollback. Resizing a pane can reflow every visible line even though the agent did no work.

ClawTab therefore uses a layered signal path:

  1. Provider events first. Claude Code, Codex, and OpenCode expose lifecycle or attention events that can identify submitted prompts, permission requests, completed turns, and idle sessions.
  2. Terminal parsing for visible questions. The daemon examines the live pane for approval choices and interactive prompts, including cases where a provider event is missing or delayed.
  3. Activity fallback. When no hook-backed state is available, the daemon compares normalized pane history and visible output over time.
  4. tmux projection. A listener maps the resulting pane states into tmux custom options and refreshes the window markers.

This division matters. tmux preserves the terminal. Provider hooks add semantics. Terminal observation covers gaps. The status bar only presents the result.

How Working Detection Avoids Obvious False Positives

The terminal fallback marks a pane as working for an eight-second recent-activity window. It compares normalized scrollback, history size, pane dimensions, and the currently visible terminal. Several filters make the signal less noisy:

  • ANSI formatting is stripped before text history is compared.
  • A layout change clears the activity timestamp instead of treating reflow as new work.
  • Echoed input is excluded, so typing a prompt does not by itself count as agent output.
  • A repeated color-only change can count as activity, which covers full-screen interfaces whose spinner repaints without adding lines.
  • One color change is not enough. The detector waits for a repeated pattern to avoid classifying a single redraw as work.

The screenshot below shows two Codex panes running at the same time. The useful signal is not simply that both processes exist. It is whether each pane is emitting lifecycle or terminal activity now.

Two Codex coding agents running side by side in tmux with ClawTab task titles and status markers
Two real Codex panes in one tmux window. The capture demonstrates concurrent terminal sessions; it is not a performance benchmark and the status markers describe the moment shown.

How Waiting and Approval Detection Works

Waiting deserves higher priority than working because it is the state that costs the most time when you miss it. ClawTab combines provider attention events with terminal question detection. If the pane still shows a permission prompt, the window gets a yellow ! and tmux can prefer that pane when you enter the window.

Claude Code documents separate PermissionRequest, Notification, Stop, and SessionEnd hooks. OpenCode exposes permission and session events through plugins. Codex supports lifecycle hooks and an external notification command in its configuration. ClawTab installs provider-specific listeners rather than trying to force one event vocabulary onto every agent.

Terminal parsing remains useful even with hooks. A provider can emit a permission event without emitting a symmetrical “resolved” event at the moment a tool continues. ClawTab lets the visible prompt decide whether the pane is still asking, then treats the provider state as working until the next idle or stop event.

Codex permission prompt in tmux with yellow ClawTab attention markers in the window status bar
A real Codex approval prompt and the corresponding yellow attention markers. Terminal parsing confirms that the question is still visible; prompt wording can change between provider versions.

Provider Compatibility as of August 21, 2026

The matrix below describes the signals used by the current ClawTab implementation. “Fallback” means ClawTab can still infer recent activity and visible questions from the terminal when provider hooks are unavailable. It does not mean every future prompt format will parse perfectly.

Pane typeLifecycle signalAttention signalTerminal fallbackIdle or done interpretation
Claude CodeSession start, prompt submit, stop, session endPermission request, question tool, idle and permission notificationsYesStop means the response ended; it does not certify the requested task
Codex CLISession start, prompt submit, stopPermission request plus visible prompt parsingYesStop or turn completion means the turn ended, not that tests passed
OpenCodesession.created, session.status, session.idle, session.deletedpermission.asked and permission.repliedYessession.idle means ready for input; deletion means the tracked session ended
Ordinary shellNoneNoneNo agent markerShell process state is not presented as agent completion

Hook support changes faster than tmux itself. Use the provider row as a tested boundary for this dated implementation, not as a permanent promise about third-party event schemas.

From Agent Event to tmux Window Marker

The state path stays local and pane-addressed:

  1. The ClawTab daemon discovers supported agent processes and associates them with stable tmux pane IDs.
  2. Provider hooks write small lifecycle events to a private local inbox. The question detector separately checks visible prompts and terminal activity.
  3. The daemon resolves each pane to two booleans: working and asking. A detected pane with both false is present and idle.
  4. The daemon publishes complete activity snapshots over a local Unix event socket.
  5. The tmux listener aggregates pane state by window and updates @clawtab-agent-present, @clawtab-agent-working, and @clawtab-agent-question.
  6. The plugin appends !, *, or to the existing window-status-format and window-status-current-format.

Events carry session identity and state, not terminal transcripts or tool inputs. The full terminal remains in tmux. If the daemon briefly reconnects, the listener retains its last good snapshot instead of making every marker flicker away immediately.

Set Up tmux Agent Status

The status path needs tmux, the ClawTab daemon and cwtctl, the ClawTab tmux plugin, jq, and a Unix-socket-capable nc. On macOS, the last item is already available. Follow the full tmux plugin installation guide if the plugin is not loaded yet.

CheckCommandExpected result
Daemoncwtctl daemon statusThe local daemon reports that it is running
Plugin dependenciescommand -v cwtctl jq ncEach command prints a path
Provider hookscwtctl agent hooks status claudeLifecycle and attention capabilities are configured
Install or repair hookscwtctl agent hooks install codexThe selected provider reports a successful install
Reload plugintmux source-file ~/.tmux.confThe status listener is replaced and current formats are updated

Repeat the hook status or install command with claude, codex, or opencode. ClawTab preserves unrelated hook entries and only manages its own installed groups or plugin file.

Use Task Titles With Status Markers

A status icon answers “does this pane need me?” It does not answer “which task is this?” Pane titles close that gap. ClawTab can read the first and latest query for a provider session, then store a concise display name as tmux pane metadata.

That makes a long status line useful at a glance: the title identifies the task, * shows movement, ! shows a blocker, and shows a quiet agent. When the agent exits and the pane returns to an ordinary shell, the listener clears the agent-specific title instead of attaching stale context to the next process.

Codex pane in tmux titled Fix tmux pane latest-query display integration with an approval prompt
A real task-aware tmux pane title beside an approval state. The title is a generated summary of session queries, so it helps navigation but is not a source of completion truth.

Idle, Finished, Failed, and Stuck Are Different States

The green check is intentionally conservative. It means “agent present, no current work or question detected.” It should not be read as “done.”

State you care aboutBest evidenceWhy the status bar alone is insufficient
Turn finishedProvider stop, completion, or idle eventA turn can finish while the larger task remains incomplete
Job completedTracked job exit plus run historyAn interactive agent normally stays alive between turns
Task verifiedTests, checks, diff review, and explicit acceptance criteriaTerminal silence says nothing about correctness
Agent stuckElapsed time, unchanged state, process inspection, and task contextA long-running command can be healthy while producing no output
Agent failedProvider error event, process exit, or captured error outputSome failures return to an idle prompt instead of exiting

For unattended jobs, use ClawTab's run history and completion notifications. For interactive sessions, treat the status bar as a routing tool: it tells you where to look next, not whether to merge.

A Small Test That Catches Most Status Problems

Test the status system with behavior you can observe, not a synthetic spinner:

  1. Open two supported agents in separate tmux panes and confirm both windows receive a marker.
  2. Give one agent a task that produces terminal output for at least ten seconds. Its window should show *, then settle to after the turn becomes idle.
  3. Force an approval request in the other pane. Its window should show !, and entering that window should prefer the asking pane.
  4. Resize the terminal without running anything. A layout reflow should not create a sustained working marker.
  5. Detach and reattach tmux. The processes, pane IDs, titles, and status should remain connected.
  6. Exit one agent back to a shell. Its agent marker and generated task title should clear.

If provider hooks fail, the terminal fallback should still catch visible output and common permission prompts. If the provider changes its event schema or prompt UI, hook status and terminal parsing are the first two places to inspect.

For the broader architecture, read how the daemon and tmux control plane fit together. For dashboard and mobile comparisons, see the AI coding agent dashboard guide. For the underlying tmux primitives, see why tmux works as an agent manager.

Frequently Asked Questions

tmux cannot understand agent state by itself, but ClawTab can project provider lifecycle events and recent terminal activity into tmux custom options. Its plugin shows a cyan star for working, a yellow exclamation mark for waiting, and a green check for a detected but idle agent.

It means a supported agent is present and is neither working nor asking for input. It does not prove that the requested task is complete, tests passed, or the changes are ready to merge.

ClawTab combines provider attention events with terminal parsing for visible questions and approval choices. Asking takes priority over working for the same pane, so a blocked agent gets the yellow attention marker.

Yes. ClawTab has lifecycle and attention integrations for Claude Code, Codex, and OpenCode, plus a conservative terminal fallback. Provider event schemas can change, so the compatibility matrix in this article is dated August 21, 2026.

The terminal fallback uses recent meaningful output, not process existence. A healthy command that produces no new terminal activity can look idle. Provider lifecycle hooks improve this, but silent subprocesses still require process or job-level inspection.

It can show that a provider turn stopped or became idle, but completion requires stronger evidence. Use job exit status, run history, tests, checks, and explicit acceptance criteria before treating work as finished.

Related Articles

Two Weeks Rebuilding ClawTab Around a Daemon and tmux
-10 min read

Two Weeks Rebuilding ClawTab Around a Daemon and tmux

How ClawTab made tmux the durable workspace for Claude Code, Codex, and OpenCode: a headless daemon, coherent PTY views, live agent state, useful pane titles, and control from terminal, phone, or GUI.

tmuxdaemoncwtctlclaude-codecodexopencodeterminalrelease
Claude Code tmux Plugin: Auto-Yes, Forking, and Secrets
-7 min read

Claude Code tmux Plugin: Auto-Yes, Forking, and Secrets

Install the ClawTab Claude Code tmux plugin to toggle auto-yes, fork sessions, inject secrets, and search skills without leaving the terminal.

tmuxterminalskillssecretsauto-yesfork
Why tmux Is a Good AI Agent Manager
-8 min read

Why tmux Is a Good AI Agent Manager

tmux gives coding agents durable terminals, scriptable pane creation, stable pane IDs, and a way to send commands or restart services without replacing the tools developers already use.

tmuxagent-managerai-coding-agentsclaude-codecodexopencodeorchestration
AI Coding Agent Dashboards Compared: tmux, Worktrees, and Mobile Control
-12 min read

AI Coding Agent Dashboards Compared: tmux, Worktrees, and Mobile Control

Compare ClawTab, dmux, workmux, webmux, AgentDock, and Agent of Empires for tmux sessions, Git worktrees, agent status, notifications, mobile control, and recovery.

ai-coding-agentsdashboardtmuxgit-worktreesmobilecomparison
Run Claude Code and Codex CLI in tmux Without File Conflicts
-14 min read

Run Claude Code and Codex CLI in tmux Without File Conflicts

Run Codex CLI and Claude Code in tmux with one writer per Git worktree. Prevent file conflicts and build a safe parallel-agent review workflow.

claude-codecodex-clitmuxgit-worktreesmcpmulti-agentcode-review
OpenCode Auto Mode and Auto-Yes for Claude Code & Codex
-7 min read

OpenCode Auto Mode and Auto-Yes for Claude Code & Codex

Enable OpenCode auto mode with --auto, or auto-approve OpenCode, Claude Code, and Codex prompts per tmux pane from your phone, desktop, or CLI.

auto-yesclaude-codecodexopencoderemoteautomationtmux
Claude Code on Your Phone: Remote Control AI Agents From iOS, Android, or Browser
-6 min read

Claude Code on Your Phone: Remote Control AI Agents From iOS, Android, or Browser

Run Claude Code on your Mac and answer agent questions from your phone. Live log streaming, push notifications, permission prompt detection, and multi-viewer support - works with iOS, Android, and any browser via ClawTab Remote. A practical alternative to Claude Code's built-in Remote Control.

remotemobileagents