LoopLoop

Dispatch

Claim the next highest-priority issue and preview the dispatch queue using the loop CLI.

Dispatch

The dispatch commands let you claim the next issue for work and preview the priority-ordered work queue. The dispatch queue ranks issues by a composite score that considers priority, goal alignment, age, and issue type.

loop next

Claim the highest-priority unblocked issue and receive dispatch instructions. This is the primary command agents use to get work. It sets the issue status to in_progress and returns the issue with its rendered prompt template.

loop next [options]

Options

FlagDefaultDescription
--project <id>noneFilter by project ID

Examples

Claim the next issue:

loop next

Filter by project:

loop next --project clx1abc2def3ghi4jkl5mnop

Get as JSON for agent automation:

loop next --json

Sample output

#42 [task] Fix login timeout
  Status:   in_progress
  Priority: high
  ID:       clx1abc2def3ghi4jkl5mnop

Template:
  Slug:    fix-bug
  Version: 3

Instructions:
────────────────────────────────────────────────────────────
You are working on issue #42: Fix login timeout.
...
────────────────────────────────────────────────────────────

When the queue is empty:

No issues ready for dispatch.

loop dispatch queue

Preview the dispatch queue without claiming any issues. Shows the highest-scored unblocked issues ready for work.

loop dispatch queue [options]

Options

FlagDefaultDescription
--project <id>noneFilter by project ID
--limit <n>10Maximum items to show

Examples

Preview the queue:

loop dispatch queue

Filter by project:

loop dispatch queue --project clx1abc2def3ghi4jkl5mnop

Show top 5 items as JSON:

loop dispatch queue --limit 5 --json

Sample output

┌──────┬──────┬───────────┬──────────────────────────────┬────────┬───────┬───────────────────────────────┐
│ RANK │ #    │ TYPE      │ TITLE                        │ PRI    │ SCORE │ BREAKDOWN                     │
├──────┼──────┼───────────┼──────────────────────────────┼────────┼───────┼───────────────────────────────┤
│ 1    │ 40   │ plan      │ Migrate user service to v2    │ urgent │ 118   │ pri:75 + goal:20 + age:3 + …  │
│ 2    │ 42   │ task      │ Fix login timeout             │ high   │ 95    │ pri:50 + goal:20 + age:5 + …  │
│ 3    │ 39   │ hypo      │ Cache warming reduces latency │ medium │ 68    │ pri:25 + goal:20 + age:3 + …  │
└──────┴──────┴───────────┴──────────────────────────────┴────────┴───────┴───────────────────────────────┘

Showing 3 of 3 queued issues

Score breakdown

Each issue in the queue has a composite score made up of:

ComponentDescription
priWeight based on priority level (urgent=75, high=50, medium=25, low=10)
goalBonus when the issue is linked to a project with an active goal
ageBonus that increases as the issue ages, preventing starvation
typeBonus based on issue type (plans and tasks score higher)

Typical dispatch workflow

# 1. Preview what is next in the queue
loop dispatch queue

# 2. Inspect the top issue for more detail
loop issues view clx1abc2def3ghi4jkl5mnop

# 3. Claim the next issue (with prompt instructions)
loop next

# 4. After completing work, mark it done
loop issues done clx1abc2def3ghi4jkl5mnop --outcome "Fixed in PR #47"

# 5. Check system status
loop dashboard

Agent usage

Agents can use next in automation scripts:

# Claim the next issue and get the prompt as JSON
RESULT=$(loop next --json)
ISSUE_ID=$(echo "$RESULT" | jq -r '.issue.id')
PROMPT=$(echo "$RESULT" | jq -r '.prompt')

# Execute work based on the prompt...

# Report completion
loop issues done "$ISSUE_ID" --outcome "Task completed successfully"