Extracting Knowledge from a 400k-Line Ruby Monolith Before the Last Senior Engineer Left
The Situation
A SaaS company with 3,200 customers had a 400k-line Rails monorepo built over 9 years. The CTO was leaving in 60 days — the only person who understood the billing system, custom reporting engine, and the largest enterprise integration.
The Problem
60 days to absorb 9 years of institutional knowledge, 400k lines of undocumented code, and a billing system processing $800k/month with no test coverage. The risk wasn't the CTO leaving — it was the knowledge leaving with him.
What We Did
Structured knowledge extraction: 90 minutes/day for 4 weeks, each session focused on specific subsystems with targeted questions. For each session: recorded, transcribed, wrote ADRs capturing the why, identified highest-risk code paths, added characterization tests. The billing system got 94 new tests in 3 weeks — documenting existing behaviour, not adding features. "Bus factor sprint": anything with bus factor = 1 got dedicated documentation.
The Result
New CTO onboarded in 6 weeks vs estimated 6 months. Billing system: 94 new tests, complete architectural docs. Zero billing incidents in 8 months after (vs 4 in the 8 months before).
Documentation written during knowledge transfer is 10x more accurate than documentation written after — the context is still alive.