The wait command polls a worktree's status until the agent reaches WAITING or COMPLETED state, or until a timeout is reached. Designed for CI/CD pipelines and scripted workflows where you need to block until an agent is done.
Usage
bash
owt wait <worktree_name> [OPTIONS]Arguments
| Argument | Description |
|---|---|
worktree_name | Name of the worktree to wait on |
Options
| Option | Default | Description |
|---|---|---|
--timeout <seconds> | 600 | Maximum wait time in seconds |
--poll <seconds> | 10 | Poll interval in seconds |
--json | — | Output result as JSON |
Examples
Basic Wait
bash
owt wait auth-jwtPolls every 10 seconds until the agent finishes (up to 10 minutes).
Extended Timeout
bash
owt wait my-feature --timeout 1200Wait up to 20 minutes for a complex task.
CI/CD Usage
bash
owt new "Run security audit" --headless
owt wait security-audit --timeout 900 --jsonCreates a worktree without tmux (headless), then blocks until the agent completes. JSON output for pipeline parsing.
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Agent finished (WAITING or COMPLETED) |
| 1 | Timeout reached or error |
See Also
owt new --headless-- Create worktree without tmuxowt usage-- Track token usage and cost across agents- Status Tracking -- How status detection works