Featured image: A laptop is on a wooden table. AI-generated image; not a photograph of the reported event.
Every engineering organization has files no one wants to open. These are not broken or obsolete. They are simply too complex to understand or modify safely. The cost of this invisibility is not just time—it’s a systemic drain on innovation, morale, and delivery velocity.
What Codebases Look Like at Scale
When a codebase is young, navigating it is straightforward. Engineers can hold most of it in their heads. New hires become productive in days. Features are simple, dependencies are minimal, and the architecture is visible and traceable.
Over time, teams grow. Features accumulate. Acquisitions happen. A three-year-old startup that has grown rapidly may inherit a legacy system with a twenty-year history. That system may have originated in a different era, with different priorities, languages, and design philosophies.
Such systems often exist in multiple version control systems—Perforce, GitHub, and GitLab—each with its own history, branching model, and access controls. The code may be written in C, C++, Java, and JavaScript, with interdependencies that were never fully documented. The original engineers have retired, and their notes, design decisions, and error logs are scattered or lost.
Despite this, the system continues to run. It may serve critical functions, but no one can confidently modify it without risking instability. This is not a failure of engineering—it’s a failure of visibility and documentation. The codebase remains functional, but it is no longer maintainable by modern standards.
The Migration Problem
When a team faces a large, aging codebase, the instinct is to migrate it. Move to a new framework. Consolidate version control. Update dependencies. Modernize the build system.
But migration starts with understanding. And understanding begins with finding the right files. A developer must answer questions like: Where is this API actually used across all repositories? Which services depend on it—directly or indirectly? Which files would break if we change an interface? Are there other places doing the same thing differently?
These questions are trivial in a small codebase. In a large one, they can consume days of investigation. A developer might spend hours tracing a single function through dozens of files, only to realize it’s been duplicated in three different modules. Without tools to map dependencies, such issues go undetected until a production incident occurs.
One Sourcegraph customer, for instance, manages tools used by millions of engineers worldwide. Their codebase spans over forty years of development, with files scattered across three version control systems. Without cross-repo search and dependency mapping, any change to a core module could trigger cascading failures.
AI Tools Face the Same Wall
AI coding assistants promise to accelerate development. At small scale, they deliver. They suggest code snippets, refactor functions, and detect syntax errors with impressive accuracy.
But when codebases grow beyond the limits of a typical context window, AI tools begin to falter. They load only a subset of files into memory, and the rest are ignored. The AI may generate code that appears correct in isolation but fails in context because it doesn’t see how the function is used elsewhere.
For example, an AI might suggest a new variable name that works in one module but conflicts with a naming convention in another. A developer who knows the codebase can catch this. A developer who doesn’t—or an AI agent without sufficient context—cannot.
AI tools are running into the same wall as human developers when dealing with large, complex codebases. The tools are designed to work within known, manageable boundaries, not to navigate sprawling, undocumented systems. As a result, teams with the largest, most complex codebases get the least benefit from AI acceleration.
What Changes When Visibility Improves
At MathWorks, a JavaScript memory leak that historically took multiple weeks to diagnose was tracked across modules in under a week once engineers had proper cross-repo search capabilities. This wasn’t just a technical win—it was a cultural shift.
Tasks that once required hours or days of manual digging now happen in minutes. A migration project that would have taken months of cautious, uncertain work can now be planned and executed with a real deadline. The team gains confidence in their ability to make changes, not just to maintain stability.
The codebase does not get smaller. But the cost of understanding it, navigating it, and changing it drops significantly. This is not about rewriting code—it’s about reducing the cognitive load on engineers.
Limitations and Uncertainties
Not all codebases are equally complex. Some are still actively maintained, with clear documentation and modern architecture. Others are abandoned, with no one to maintain them. The source does not specify how many teams face this issue.
There is no official data on how widespread this problem is. The examples are drawn from one customer and one case study. The full scope remains unclear. However, the trend is clear: as software systems grow, the cost of managing them increases exponentially.
AI tools are not yet capable of fully understanding large, legacy systems. Their performance is still limited by context size and data quality. They can assist—but not replace—the need for human expertise and visibility.
Why This Matters
Engineering teams are under pressure to deliver faster. But without visibility into their code, progress stalls. Understanding code is not a secondary task. It is foundational. Without it, even the most advanced tools fail.
Organizations must prioritize code visibility—not just modernization or AI adoption. The real challenge isn’t writing better code. It’s making sure every line of code is visible, searchable, and understandable to anyone who needs to work with it.
Source: The hidden cost of code that nobody touches | Sourcegraph Blog

