Synopsis
r
Description
Therun command executes a shell command in all active agent sessions for the current repository. Unlike broadcast which sends messages to agents, run executes actual shell commands and captures their output.
Each command runs in a new tmux window within the agent’s session, preserving the agent’s working directory context.
Options
Delete the tmux window after capturing the command output. This keeps sessions clean by removing temporary windows.
Path to the configuration file (defaults to
uzi.yaml in current directory).Arguments
The shell command to execute in all agent sessions. All arguments are joined with spaces to form the complete command.
How It Works
Examples
Check Git Status
Run Tests
List Modified Files
With Auto-Cleanup
Check Environment
Multi-word Commands
Output Format
For each session, the command displays:- Session name header:
=== session-name === - Captured command output
- Blank line separator
Use Cases
Code Quality Checks
Code Quality Checks
Run linters or formatters across all agents:
Build Verification
Build Verification
Check if agents’ code compiles:
Git Operations
Git Operations
Perform git commands across all worktrees:
Environment Inspection
Environment Inspection
Debug or verify agent environments:
Test Execution
Test Execution
Run tests in all agent contexts:
Window Management
Default Behavior
By default,run creates a new window for each command execution:
- Windows are numbered sequentially (0, 1, 2, …)
- Window remains open after command completes
- You can attach to the session later and see the window
With --delete Flag
When using --delete:
- Window is created and command runs
- Output is captured
- Window is immediately killed
- Keeps sessions clean with only the
:agentwindow
Working Directory
Commands execute in the agent’s worktree directory, ensuring:- Git commands operate on the agent’s isolated branch
- File paths are relative to the agent’s working copy
- Environment is identical to what the agent sees
Error Handling
- If no command is provided:
no command provided - If no active sessions:
no active agent sessions found - If window creation fails: Logs error and continues to next session
- If command fails: Output is still captured and displayed
Comparison with broadcast
| Feature | run | broadcast |
|---|---|---|
| Purpose | Execute shell commands | Send messages to agents |
| Target | New tmux window | Agent window |
| Output | Captured and displayed | Not captured |
| Cleanup | Optional with --delete | N/A |
| Use Case | System commands, scripts | Agent instructions |
Advanced Examples
Parallel Testing
Conditional Execution
Complex Commands
Chain Multiple Commands
Related Commands
broadcast- Send messages to agents (not shell commands)prompt- Create agents to run commands inls- See which agents will execute the commandcheckpoint- Merge results after running commands
Notes
The command inherits the agent’s environment and working directory, so file paths and environment variables are scoped to each agent’s worktree.