Synopsis
w (short for watch)
Description
Theauto command monitors all active agent sessions in the current repository and automatically handles interactive prompts that would normally require manual intervention. This enables true hands-free operation when running multiple agents.
auto watches tmux pane content for specific prompts and automatically presses Enter when detected, allowing agents to continue working without manual input.
What It Does
The auto-watcher:- Discovers active sessions for the current repository every 5 seconds
- Monitors each session for output changes and specific prompts
- Auto-responds to detected prompts by pressing Enter
- Tracks sessions as they start and stop
Detected Prompts
The auto command automatically handles these types of prompts:Trust Prompts
Trust Prompts
Continuation Prompts
Continuation Prompts
Command Approval
Command Approval
Monitoring Behavior
Session Detection
- Refreshes active sessions every 5 seconds
- Automatically starts watching new sessions
- Stops watching sessions that are no longer active
- Scoped to the current git repository only
Prompt Detection
- Checks pane content every 500ms
- Uses SHA-256 hashing to detect content changes
- Tracks update history per session
- Logs auto-actions for visibility
Usage
Start the Auto-Watcher
Ctrl+C.
Typical Workflow
How It Works
Watch Loop
For each active session, spawns a goroutine that:
- Captures tmux pane content every 500ms
- Compares content hash with previous capture
- Checks for known prompt patterns
- Sends Enter key if prompt detected
State Tracking
Each monitored session maintains:The tmux session identifier
SHA-256 hash of previous pane content for change detection
Timestamp of last detected change
Number of times content has changed
Consecutive checks without changes
Examples
Basic Monitoring
With Multiple Agents
Logs
The auto command produces debug logs when:- Starting to watch a new session
- Detecting content updates
- Detecting and handling prompts
- Encountering errors
Graceful Shutdown
The auto-watcher handles these signals:SIGINT(Ctrl+C)SIGTERM
- Logs shutdown message
- Closes quit channel to stop all watchers
- Exits cleanly
Related Commands
prompt- Launch agents that auto will monitorls- View which sessions are being monitoredkill- Stop agents (auto will stop watching them)
Notes
The auto command only monitors agents in the current git repository. Agents from other repositories are not affected.