threading depth analysis
summary metrics
| metric | value |
|---|---|
| total threads | 4,656 |
| total edges (connections) | 2,562 |
| root threads (spawn origins) | 208 |
| max chain depth | 72 |
| avg chain depth | 4.58 |
| orphan count | 2,911 |
| orphan rate | 62.5% |
edge types
| type | count | % of edges |
|---|---|---|
| continuations (“Continuing work from…“) | 1,824 | 71.2% |
| handoffs (“Created handoff thread…“) | 203 | 7.9% |
| read_thread references | 535 | 20.9% |
depth distribution
most threads are shallow, but a fat tail extends to depth 72:
depth 0: 3119 threads (67%) ████████████████████████████████████████
depth 1: 308 threads (7%) ████
depth 2: 297 threads (6%) ████
depth 3: 245 threads (5%) ███
depth 4: 94 threads (2%) █
depth 5: 81 threads (2%) █
depth 6-10: ~40/level
depth 11-30: ~12/level
depth 31-72: 1-8/level (single long chains)
top spawners (most children)
threads that spawned the most child threads:
| rank | thread | children |
|---|---|---|
| 1 | T-019b37e4-86b2-7079-a4a5-4156a30fda88 | 106 |
| 2 | T-019b3650-66cf-74ab-bf0b-eab5e947ae70 | 79 |
| 3 | T-019b9a3d-f7bc-74b5-b360-4fa4d12e1a8e | 59 |
| 4 | T-019b99e7-d4c7-726e-9585-55db7fc4add8 | 27 |
| 5 | T-019b99e2-192e-7545-be0c-4b7ec9df12c5 | 23 |
| 6 | T-019b37a2-8003-7761-8062-8099eaae05b5 | 19 |
| 7 | T-019b385a-d8b2-71c3-886d-fa6f1f39c77b | 14 |
| 8 | T-019b523c-7743-7777-9e95-a42f6eac175a | 14 |
| 9 | T-019b9a9b-6430-71dd-b927-0458a46702f6 | 13 |
| 10 | T-019b6ba2-1a1c-70dd-ba4e-d4c5b08cb04d | 12 |
observation: top spawner has 106 children - this is a coordinator thread running parallel analysis waves.
longest chains
the deepest chains all share a common root: T-019b8564-338c-736b-9905-0ad763d2216e
this represents a marathon migration task that handoffed 72 times - likely a large icon migration or similar repetitive batch work.
sample chain (depth 72)
T-019b8564 (root)
└─ T-019b869a (depth 1)
└─ T-019b88c5 (depth 2)
└─ T-019b88d0 (depth 3)
└─ ... (continues 68 more levels)
└─ T-019b9964 (depth 72)
productive spawn patterns
pattern 1: parallel fan-out (wide)
- single coordinator spawns 50-100+ agents
- each agent completes independent task
- coordinator collects results
- example: T-019b37e4 spawning 106 analysis agents
pattern 2: sequential handoff (deep)
- task too large for single context
- each thread completes chunk, hands off to next
- maintains continuity via “Continuing work from” references
- example: the depth-72 migration chain
pattern 3: hybrid (wide + shallow)
- coordinator spawns ~20 agents
- each agent may spawn 1-3 sub-agents
- typical depth: 2-4
- most common pattern in codebase
orphan analysis
62.5% orphan rate seems high but is expected:
- standalone tasks: user starts thread, completes in one context
- exploratory threads: quick questions, no follow-up
- failed spawns: agent crashed/cancelled before connecting
the 37.5% connected threads represent meaningful multi-step work.
insights
-
depth matters for complexity: depth 72 is extreme - suggests task decomposition could be improved. ideal chains should be <10 deep.
-
wide > deep for parallelism: the 106-child spawner is more efficient than the 72-deep chain. parallel work completes faster, easier to recover from failures.
-
read_thread underutilized: only 535 read_thread calls across 4,656 threads. agents could benefit from more cross-thread context sharing.
-
handoffs are expensive: only 203 handoffs vs 1,824 continuations. handoffs involve more ceremony (creating new thread, passing context). continuations are lighter.
recommendations
- break deep chains earlier - spawn parallel workers instead of sequential handoffs after depth ~5
- use read_thread more to reference prior work without creating parent-child edges
- for batch migrations: spawn parallel batches, use coordinator to aggregate
- monitor orphan rate as health metric - sudden spike may indicate spawn failures