Skip to content

Orchestrate workers

With the cortland-panes skill installed, which the agent hooks do for you, you can ask a lead agent in plain language:

Split this into an implementation worker and a test worker, each in its own worktree. Review their work before you tell me it’s done.

Behind the scenes, the lead uses cortland-ctl. Here’s the same flow by hand, so you know what it’s doing.

  1. Create the task. The lead’s pane becomes its lead.

    Terminal window
    cortland-ctl task new "Add rate limiting to the public API" --title rate-limit
  2. Spawn workers. Each one gets a brief: the request word for word, its part, and how to ask and report.

    Terminal window
    cortland-ctl task spawn rate-limit --role implementer \
    --part "Token-bucket middleware and config" \
    --done-when "Middleware merged behind a flag, unit tests pass" \
    --worktree rate-limit-impl -- claude
    cortland-ctl task spawn rate-limit --role tests \
    --part "Integration tests for 429 responses" \
    --worktree rate-limit-tests -- codex
  3. Wait without polling. The lead blocks until something happens: a worker exits, finishes a turn, needs input, or sends a message.

    Terminal window
    cortland-ctl wait children --timeout 1800000
  4. Handle questions and reports. Workers call cortland-ctl ask and cortland-ctl report. Both appear in the lead’s pane and in .cortland/tasks/rate-limit.md.

  5. Accept, close, finish.

    Terminal window
    cortland-ctl task accept rate-limit.1 "Looks good"
    cortland-ctl task close rate-limit.2
    cortland-ctl task done rate-limit --summary "Rate limiting behind RATE_LIMIT=1"

You can watch every worker in its pane the whole time, type into it, or stop it.