# Reproduction driver for pingdotgg/t3code#26970 (run from apps/server of a checkout)
B=<checkout>/.t3
# fresh DB at the checkout's own migration level, no seed
T3CODE_DEV_SEED=0 vp run dev &        # then open the printed pairingUrl in one browser tab (foreground client lease)
git init repo && (cd repo && git commit --allow-empty -m init && git remote add origin https://github.com/pingdotgg/t3code.git)
node src/bin.ts project add --base-dir $B --title repro <abs path to repo>
node src/bin.ts thread start --base-dir $B --provider claudeAgent --model claude-haiku-5-5 --title parent --wait <repo> \
  "Use the T3 delegate_task tool three times, each with isolation 'worktree', mode 'async', task 'Reply with the single word ok.' and titles child-1, child-2, child-3. Then reply done."
node src/bin.ts thread start --base-dir $B --provider claudeAgent --model claude-haiku-5-5 --title parent-wt --worktree main --branch feat-parent --wait <repo> \
  "Use delegate_task twice, mode 'async': isolation 'shared' title shared-child, then isolation 'worktree' title wt-child. Then reply done."
# wait a few minutes, then count branchPullRequest spans under each ThreadPullRequestServiceV2.synchronize span:
python3 persweep.py $B/userdata/logs/server.trace.ndjson
