Bernstein's orchestrator.py hit 4,198 lines. We used 11 parallel agents, orchestrated by Bernstein itself, to decompose it into 15 sub-packages in the first pass, each under 400 lines. Subsequent refactors extended this to 22 sub-packages.
Here's how that worked and what we learned. How a file gets to 4,000 lines It happens gradually. The orchestrator started as a clean 300-line module that mana