Feature Reference

Keyboard shortcuts, configuration, and technical details for ait monitor

Keyboard Shortcuts

Zone Navigation

KeyActionContext
TabCycle focus to the next zone (pane list ↔ preview)Global
Shift+TabCycle focus to the previous zoneGlobal
UpFocus the previous card in the pane listPane list zone
DownFocus the next card in the pane listPane list zone
qQuit monitorGlobal

Pane Interaction

KeyActionContext
EnterSend an Enter keystroke to the focused tmux panePane list zone
EnterSend an Enter keystroke to the focused tmux panePreview zone
Any other keyForwarded to the focused tmux pane (characters, Ctrl-combos, arrows, Escape)Preview zone
sSwitch tmux focus to the focused pane (tmux switch-client)Pane list zone
iShow the task detail dialog for the focused agent pane (requires a task ID in the window name)Pane list zone
kKill the focused pane after confirmation (tmux kill-pane)Pane list zone
nPick the next ready sibling task for the focused agent panePane list zone

Monitor Controls

KeyActionContext
jOpen the TUI switcher overlayGlobal
rRefresh the pane list and preview immediatelyGlobal
F5Refresh the pane list and preview immediately (alias for r, hidden in footer)Global
zCycle the preview size through S / M / L presetsGlobal
aToggle auto-switch mode (automatically focus idle agents needing attention)Global

Note: In the preview zone, every keystroke that is not handled by a global binding is forwarded to the tmux pane via tmux send-keys. Special keys (Enter, Escape, Backspace, arrows, Space, Delete, Home, End, PageUp/Down) and Ctrl-combinations are translated; regular characters are sent literally.

Zone Model

Monitor uses a two-zone model. Focus lives in one of:

ZoneWidgetBehavior
PANE_LISTVerticalScroll of PaneCard widgetsUp/Down navigate between cards; Enter sends an Enter keystroke to the focused pane
PREVIEWPreviewPanel inside a ScrollableContainerAll non-bound keys are forwarded to the focused pane; a fast-refresh timer (300 ms) updates the preview while this zone is active

Tab and Shift+Tab cycle between these zones. The active zone is reflected in the widget borders and in the content-header label above the preview.

Pane Classification

discover_panes() in tmux_monitor.py categorizes every window in the monitored tmux session:

CategoryRule
AgentWindow name starts with any prefix listed in tmux.monitor.agent_window_prefixes (default agent-)
TUIWindow name is in tmux.monitor.tui_window_names, OR starts with brainstorm-
OtherAnything that does not match the rules above (shells, logs, ad-hoc windows)

Agent panes whose window name contains a task ID (e.g., agent-t42-claudecode) are linked to the corresponding task file — that is what powers the i (Task Info) and n (Next Sibling) shortcuts.

Preview Size Presets

Pressing z cycles through three preview size presets:

LabelSection max heightPreview max height
S1210
M (default)2422
L4038

A notification shows the new size label when you cycle.

Configuration

Monitor reads its configuration from aitasks/metadata/project_config.yaml. The relevant keys live under tmux and tmux.monitor:

tmux:
  default_session: aitasks
  default_split: horizontal
  prefer_tmux: true
  git_tui: lazygit
  monitor:
    refresh_seconds: 3
    idle_threshold_seconds: 5
    capture_lines: 30
    agent_window_prefixes:
      - agent-
    tui_window_names:
      - board
      - codebrowser
      - settings
      - brainstorm
      - monitor
      - minimonitor
KeyTypeDefaultDescription
tmux.default_sessionstringaitasksExpected tmux session name. Monitor matches the current session against this and offers to rename if they differ.
tmux.default_splitstringhorizontalHow new panes are split when TUIs are launched from the switcher.
tmux.prefer_tmuxbooltrueWhether tmux-based workflows are the default for related commands.
tmux.git_tuistringlazygitWhich git TUI the switcher targets for git windows.
tmux.monitor.refresh_secondsint3Pane list refresh cadence in seconds.
tmux.monitor.idle_threshold_secondsint5Threshold for marking a pane as idle in the card view.
tmux.monitor.capture_linesint30Number of lines of pane output the preview captures per refresh.
tmux.monitor.agent_window_prefixeslist["agent-"]Window-name prefixes that classify a pane as an agent.
tmux.monitor.tui_window_nameslistboard, codebrowser, settings, brainstorm, monitor, minimonitorWindow names classified as TUIs. brainstorm-* prefix matches are handled in addition to this list.

All of these can be edited interactively via ait settings → Tmux tab, which writes the same keys in project_config.yaml.

Command-line Options

ait monitor is a thin wrapper around monitor_app.py. The underlying script accepts:

OptionDefaultPurpose
--session NAMECurrent tmux sessionExplicit tmux session name to watch (bypasses auto-detection)
--interval SECStmux.monitor.refresh_secondsOverride the pane list refresh cadence
--lines Ntmux.monitor.capture_linesOverride the number of lines captured for previews

ait ide always passes --session with the configured default, which is why it never triggers the Session Rename Dialog.

Session-Name Fallback Dialog

When monitor starts, it resolves which tmux session to watch using this decision logic:

  1. If --session NAME was passed on the command line, use that name.
  2. Otherwise, detect the current tmux session name from $TMUX.
  3. Compare the detected name against tmux.default_session from project_config.yaml.
  4. If the names match, proceed normally.
  5. If they differ and the configured session does not already exist, open the SessionRenameDialog offering to rename the current session to the configured name.
  6. If they differ and the configured session exists, proceed watching the current session without prompting.

When the dialog fires: inside a tmux session whose name does not match the configured default (typical when you ran tmux without -s NAME).

What the dialog does: offers a one-click rename of the current session to the configured name; you can also dismiss the dialog to keep the current name.

How to avoid it:

  • Launch monitor via ait ide, which always passes an explicit session name.
  • Manually rename the session before launching monitor: tmux rename-session -t "$OLD" "$NEW".

Environment Variables

VariablePurpose
TMUXSet by tmux when inside a session. Monitor reads it to detect the current session name. Without it, monitor refuses to launch outside of a tmux context.
PYTHONOptional override for the Python interpreter used by the launcher (defaults to the shared ait setup venv).
Command / TUIPurposeReference
ait ideOne-command launcher that starts/attaches to the configured tmux session and opens monitortmux IDE workflow
ait boardKanban board for task management — target of the TUI switcherBoard
ait codebrowserCode browser TUI — target of the TUI switcherCode Browser
ait settingsSettings TUI — target of the TUI switcher; also hosts the Tmux tab for editing the configuration aboveSettings