Featured image: A person's hands are typing on a laptop keyboard. AI-generated image; not a photograph of the reported event.
Most large-scale code migrations fail not because engineers are under-resourced or plans are flawed. The real bottleneck is in the tools themselves. As codebases grow in size and complexity—spanning decades of development, multiple teams, and diverse technologies—the tools used to manage them fall short. This isn’t a matter of human error or poor planning. It is a fundamental limitation in how current migration tools perceive and interact with the full scope of a codebase.
The Search Problem
Engineering teams often assume code search is solved. They rely on IDEs, grep, or GitHub’s search bar. These tools are effective for small to medium-sized projects, where code is relatively linear and well-organized. However, as codebases expand, their capabilities become inadequate.
Keyword search finds strings, but it does not understand context, function, or relationships. It cannot distinguish between a function that is used in a critical path and one that is a legacy placeholder. When an engineer searches for a function name, they may receive many results. Sorting through them manually is not just time-consuming—it is a cognitive burden that diverts valuable engineering time from actual migration work.
MathWorks experienced this directly. Their engineering team spans Perforce, GitHub, and GitLab. Their homegrown search tool only worked within Perforce. Engineers working in other systems, or trying to understand cross-system dependencies, were working partially blind. This is the invisible tax on every large-scale migration: the investigation time required before any actual implementation begins. Engineers spend hours reading code, tracing call chains, and mapping dependencies across files and directories. They build mental models of systems that are too vast to hold in memory. Then, when they apply a change, something breaks in a repository they did not anticipate—because the tool failed to surface the relevant context.
What It Looks Like in Practice
Consider a team migrating a legacy JavaScript framework to a modern TypeScript ecosystem. The original framework was built over many years, with hundreds of interdependent modules. The team begins by searching for all instances of a specific function. The results are overwhelming. Without a tool that understands code semantics, the engineer must manually inspect each result to determine relevance. This process is not just slow—it is error-prone and inconsistent.
Moreover, the lack of semantic understanding means tools cannot predict the impact of a change. They cannot identify which components rely on a given API, or which functions are called indirectly through third-party libraries. This leads to a cycle of trial, failure, and rework, where each iteration consumes more time and increases the risk of introducing new bugs.
Multi-Repo Complexity
Modern engineering organizations are rarely monolithic. Acquisitions bring in repositories from different companies, each with its own naming conventions, architecture, and version control history. Platform teams often split services into independent repositories to improve scalability and ownership. Some code lives in legacy systems like Perforce, while newer code resides in Git or GitLab.
These distributed codebases create a fragmented landscape. No single tool can see the full picture. A search tool that only operates within Perforce cannot help engineers understand dependencies that span across systems. Static analysis tools that do not cross repository boundaries produce incomplete dependency maps, leading to false confidence in migration decisions.
AI assistants that load only local files for context are similarly limited. They generate suggestions based on a narrow view of the codebase, often making confident recommendations that break functionality elsewhere. For instance, an AI might suggest refactoring a function in a service that is not actually dependent on it—because it only sees the local file structure.
Real-World Example
MathWorks operates across Perforce, GitHub, and GitLab. Its homegrown search tool only works within Perforce. Engineers working in GitHub or GitLab are unable to see cross-system dependencies. When trying to understand how a new feature integrates with legacy components, they must manually cross-reference repositories—often without a unified view of the entire system.
One team lead explained: ‘We had to manually check every repository to see if a change in one service affected another. That’s not just inefficient—it’s dangerous. We ended up making changes in isolation, and only discovered the ripple effects when it was too late.’ This partial visibility leads to decisions that are not only incomplete but potentially flawed. Teams end up making changes in isolation, unaware of how those changes ripple through other parts of the architecture.
AI Agents Exacerbate the Problem
AI coding agents are now widely deployed to accelerate migration tasks. They generate boilerplate, translate between frameworks, and apply repetitive transformations at speed. While this seems like a solution, it introduces new risks.
Unlike human engineers, AI agents do not accumulate contextual knowledge over time. A veteran engineer has internalized years of team experience—knowing which modules are fragile, which APIs are unstable, and which functions are used in critical paths. An AI agent, however, starts from scratch. It only sees what fits within its context window—typically a few hundred lines of code—and cannot infer broader architectural patterns.
Sourcegraph’s CodeScaleBench evaluated coding agents on tasks drawn from real enterprise codebases: 370 tasks across multiple repositories, spanning debugging, security, multi-repo coordination, and organizational-level queries. Without code intelligence tools, agents running on Kubernetes-scale systems timed out after two hours. With access to Sourcegraph’s MCP tools, the same tasks completed in 89 seconds. On retrieval tasks, agents without code intelligence retrieved the right files 12.7% of the time. With Sourcegraph MCP, that number climbed to 27.7%. On organizational queries spanning multiple repositories, precision at rank 5 went from 0.7% to 47.1%. These improvements are not due to better AI models—they are due to better visibility into the full codebase.
What Happens When Agents Fail?
When an AI agent cannot find relevant code, it either gives up or makes things up. Both outcomes are expensive. Giving up wastes time and delays progress. Making things up—such as inventing code or misrepresenting dependencies—leads to broken systems and unreliable results. In a migration context, this can result in a system that appears to be working but is actually unstable or insecure.
The Cost Compounds at Scale
A migration that takes twice as long as expected does not just cost twice as much in engineering time. It delays dependent projects. It extends the period during which your team is maintaining both old and new systems simultaneously. It increases the risk that the migration never fully completes. The result is a permanently split architecture—one that was never intended but now exists due to poor tooling.
Teams with the largest, most complex codebases are most in need of migration tools. They are also most likely to have stalled migrations—because their tools were not built for that scale. The problem is not one of human capability, but of technological infrastructure.
What a Solution Looks Like
The migration problem is not a people or process issue. It is a visibility issue. Engineers and AI agents make better decisions when they can see the full codebase—across repositories, version control systems, and languages.
Code intelligence that works across repositories, version control systems, and languages gives teams the foundation to:
- Plan migrations accurately
- Execute changes confidently
- Determine when a migration is truly complete
This difference separates a migration that ships from one that becomes a permanent backlog item.
Sourcegraph provides cross-repo code intelligence for teams managing large, complex codebases. See how engineering teams are completing migrations faster with better visibility into their code.
Unblock your organization. Ship faster. With Sourcegraph, the code understanding platform for enterprise.

