Perf regression

Track down why something got slower. One agent measures, another reads what changed, and a third tries the cheapest suspect first. Measurements decide, not guesses.

Measure first

Give one agent the benchmark and a clean checkout:

beswarm worktree add --name perf-measure --workspace api
beswarm agent start --name measure --agent claude <terminal-id> --group perf \
  --prompt "GET /search got slower between v4.1 and HEAD. Write a repeatable benchmark (same data, warm-up, at least 10 runs, report median and p95). Run it on v4.1 and on HEAD. Then profile HEAD and list the top 10 hot spots with file:line. Write to ../../reports/perf/measure.md." \
  --wait --timeout 3600

Agents in a worktree work inside .worktrees/<name>/, so ../../reports/ is the repo root's reports/.

Read the changes in parallel

beswarm agent start --name changes --agent codex --group perf \
  --prompt "Read-only. List changes between v4.1 and HEAD that could affect GET /search: queries, indexes, serialization, caching, new middleware, dependency upgrades. For each, explain the likely cost. Write to reports/perf/changes.md."

Test the top suspect

Once both reports are in, try the cheapest fix that matches both the profile and the change list:

beswarm worktree add --name perf-fix --workspace api
beswarm agent start --name fixer --agent claude <terminal-id> --group perf \
  --prompt "Read ../../reports/perf/measure.md and changes.md. Fix the most likely cause. Rerun the same benchmark before and after your change, and report both medians and p95s. Don't change the benchmark." \
  --wait --timeout 3600

note

Require before-and-after numbers from the same benchmark. A fix with no measurement is a guess.

Merge if the numbers hold up, then beswarm agent close --group perf and remove the worktrees.