MathWorks is the leading developer of mathematical computing software for designing engineered systems. Primarily known for its flagship products MATLAB and Simulink, scientists, engineers, and researchers worldwide use its software for data analysis, algorithm development, simulation, and Model-Based Design.
MathWorks, the developer of MATLAB and Simulink used by millions of engineers worldwide, faced a persistent and growing challenge: enabling its thousands of engineers to search, navigate, and understand an extensive codebase housed across multiple version control systems. Since adopting Sourcegraph in 2023, MathWorks has transformed how its engineers work with code and accelerated productivity across teams.
We spoke with their team and learned how Sourcegraph has become an essential, well-loved part of their SDLC.
Challenge
MathWorks' engineering environment consists of a large-scale codebase in Perforce with many branched replicas, additional repositories on GitHub and GitLab, and multiple programming languages, including C, C++, Java, JavaScript, and more.
This fragmentation made efficient code exploration difficult. A homegrown internal search tool only worked within Perforce and lacked indexing across GitHub or GitLab, forcing developers to rely on separate tools, tribal knowledge, or senior engineers to answer cross-repository questions.
"With different search tools scattered across systems, finding the right information was time-consuming and inconsistent."
— MathWorks engineering team
This lack of a centralized knowledge base was what drove their team to look at Sourcegraph first.
Why Sourcegraph
MathWorks began evaluating Sourcegraph to address a fundamental pain point: unify code search across multiple version control systems and make it easier to understand and make changes to their 40+ year-old codebase. The rise of AI coding created a new opportunity, but existing AI coding tools struggled to understand the company's large codebase at scale. Sourcegraph and Deep Search provided MathWorks engineers with a unique ability to leverage an agentic coding tool that actually understands their entire codebase.
Code Search solution and rollout
MathWorks began with a proof-of-concept involving ~100 engineers in 2023, chosen to represent diverse tooling environments: Perforce, GitHub, GitLab, and various language ecosystems.
The rollout scaled rapidly, expanding to 1,000+ engineers in 2024, prioritizing broad usage across version control systems, and ultimately achieved organization-wide access for all its developers by March 2025.
Engineering adoption was supported through live internal training sessions, company-specific resources, weekly office hours with Sourcegraph product experts, and internal communication channels for Q&A and troubleshooting.
Word of mouth also played a key role. Engineers began sharing Sourcegraph search results and workflows during code reviews, paired programming sessions, and other collaborative activities.
Deep Search for transformational code exploration
While Code Search provided immediate benefits, the recent addition of Deep Search became the feature most engineers cited as transformational. It enabled natural-language queries across the entire codebase, giving developers powerful context and pinpointed results that matched how they think about debugging and discovery.
Engineers now use Deep Search for debugging production issues, scoping and understanding large refactors, navigating unfamiliar modules of the codebase, locating API usage and documentation fragments, and sharing reusable links to search results with collaborators.
"Deep Search is exactly how engineers always expected AI-enhanced search to work: natural language, precise, and spanning our entire codebase."
— MathWorks engineering team
Results
One standout use case involved tracking down difficult JavaScript memory leaks. Traditionally, diagnosing and fixing such issues across multiple components could take an engineer multiple weeks. With Deep Search, an architect traced root causes across interconnected modules, pinpointed the most relevant files, and fixed all impacted files in less than a week.
This single example reflects a broader pattern:
"Tasks that used to take hours or days now happen in minutes."
— MathWorks engineering team
Other engineers reported similar time savings when hunting API documentation, debugging crash reports, or building reusable search-driven insights into UI elements and behaviors.
Partnership
The success of Sourcegraph at MathWorks isn't just about the technology; it's also about the collaboration between teams. From 2023 to now, MathWorks and Sourcegraph have worked closely via PoCs, feedback sessions, and scheduled engagements to refine the product's fit for MathWorks' unique environment.
Sourcegraph invested time in understanding and integrating with MathWorks' on-prem Perforce workflows and welcomed feedback from their usability reviews and engineering teams.
"Sourcegraph's willingness to understand our challenges, including unique aspects of our tooling, made a huge difference."
— MathWorks engineering team
Looking ahead
MathWorks sees Deep Search and future agentic AI workflows as critical enablers for its ongoing software modernization efforts. By combining deterministic code search with intelligent natural language interaction, the company believes it will significantly speed up large-scale refactors, cross-team discovery and onboarding, and refactoring and modernization initiatives.
"As we continue to modernize our codebase, Sourcegraph will only become more essential."
— MathWorks engineering team
Helping companies like MathWorks is the core of what Sourcegraph does. With agentic coding going mainstream across large organizations worldwide, Sourcegraph has become even more essential to those dealing with big-code problems.