looplisted
Install: claude install-skill palginpav/orchestray
# /orchestray:loop
Stop-hook-driven tight loop primitive. Spawns an agent repeatedly with the same prompt
until the agent's output contains the completion promise, OR max iterations are reached,
OR the cost cap is exceeded. Cheaper than verify-fix (no reviewer spawn) for tight tasks
like "iterate on tests until they pass."
## Args
- `--agent <type>` — agent type to spawn (default: `developer`)
- `--max-iterations <n>` — maximum loop iterations before forced stop (default: `10`)
- `--completion-promise <string>` — sentinel string the agent must include in its output
to signal task completion (default: `TASK_COMPLETE`)
- `--cost-cap-usd <n>` — accumulated cost cap in USD; loop stops when exceeded (default: `0.50`)
- `<prompt>` — the task prompt passed to the agent on every iteration
- `--cancel` — cancel an active loop (clears state, emits `loop_completed(user_cancel)`)
## Behavior
1. Skill writes `.orchestray/state/loop.json` with the loop config:
```json
{
"enabled": true,
"agent": "developer",
"max_iterations": 10,
"completion_promise": "TASK_COMPLETE",
"cost_cap_usd": 0.50,
"prompt": "<the prompt>",
"iter_count": 0,
"cost_so_far": 0,
"started_at": "<ISO 8601>"
}
```
2. PM spawns the first agent with the prompt.
3. On agent Stop: `bin/loop-continue.js` (SubagentStop hook) reads the loop state
and examines the agent's output:
- If output contains the completion promise → emit `loop_completed(reason: 'promis