send command allows you to send text messages or files to running agent sessions. It includes smart busy detection, automatic retry, and delivery confirmation.
Syntax
Arguments
string
required
Session name to send the message to
string[]
Message text (space-separated words)
You must provide either a message argument or the
--file option.Options
string
Send contents of a file instead of a message
flag
Don’t wait for session to become idle before sending
number
default:"600"
Max seconds to wait for idle (default: 600)
Basic Usage
How It Works
The send command follows this workflow:- Session Lookup - Resolves session name to tmux target
- Busy Detection - Checks if agent is currently processing
- Wait for Idle - Polls every 5 seconds until agent is idle
- Clear Input - Clears any partial input (
Ctrl+U) - Send Message - Injects text into the tmux session
- Submit - Sends
Enterto submit the message - Verify Delivery - Confirms agent received and is processing
Busy Detection
Before sending, the command checks if the agent is busy:- Active - Agent is processing (prompt visible, spinner)
- Idle - Agent is waiting for input
- Working - Agent is executing tools
Busy detection prevents your message from interrupting ongoing work or being lost.
Delivery Confirmation
After sending, the command verifies delivery:Retry Logic
If the message isn’t acknowledged:- Wait 2 seconds
- Send
Enteragain - Repeat up to 3 times
Sending Files
Use--file to send the contents of a file:
Skip Waiting
Use--no-wait to send immediately without checking if the agent is busy:
Use
--no-wait for urgent messages where you can’t afford to wait. The message may queue if the agent is busy.Custom Timeout
Set a custom wait timeout:Message Handling
Short Messages
Short single-line messages (under 200 characters) are sent directly:Long Messages
Long messages or multi-line messages are sent via tmux buffer:Multi-Line Messages
Messages with newlines:Common Issues
Session Does Not Exist
No Message Provided
--file:
Cannot Read File
Timeout Waiting
- Increase timeout:
--timeout 1200(20 minutes) - Send anyway with
--no-wait - Check if agent is stuck:
tmux attach -t ao-int-1234
Message Not Confirmed
Examples
Simple Message
Follow-Up Instruction
Send Review Feedback
Urgent Message
Batch Messages
Interactive Script
Scripted Workflow
Exit Codes
0- Message sent successfully1- Error (session not found, no message, file not found)
Next Steps
Status
Check if your message was processed
Session Management
List and manage sessions
Dashboard
Monitor sessions in real-time
