Uncovering Code Insights: Leveraging GitHub Artifacts for Deeper Code Understanding
Ziv Nevo, Orna Raz, Karen Yorav
TL;DR
This work tackles the problem of grounding code explanations in software-engineering context by leveraging rich GitHub NL artifacts. It introduces a three-component pipeline—Context Builder to extract and structure PR/commit/issue history via GraphQL, a Summarizer to generate high-level, purpose-driven explanations, and a Validator (LaaJ) to filter out low-quality or hallucinated insights—all deployed as an MCP server for integration. A user study with open-source and proprietary projects indicates that context-enhanced explanations are helpful and largely hallucination-free, even for large histories, while maintaining responsive runtimes. By bridging low-level code semantics with architectural rationale and evolution, the approach supports maintenance, onboarding, and modernization in AI-assisted development workflows. The work offers a practical, scalable framework for artifact-grounded code understanding that can be integrated into existing development toolchains to improve explainability and trust in AI-assisted software engineering.
Abstract
Understanding the purpose of source code is a critical task in software maintenance, onboarding, and modernization. While large language models (LLMs) have shown promise in generating code explanations, they often lack grounding in the broader software engineering context. We propose a novel approach that leverages natural language artifacts from GitHub -- such as pull request descriptions, issue descriptions and discussions, and commit messages -- to enhance LLM-based code understanding. Our system consists of three components: one that extracts and structures relevant GitHub context, another that uses this context to generate high-level explanations of the code's purpose, and a third that validates the explanation. We implemented this as a standalone tool, as well as a server within the Model Context Protocol (MCP), enabling integration with other AI-assisted development tools. Our main use case is that of enhancing a standard LLM-based code explanation with code insights that our system generates. To evaluate explanations' quality, we conducted a small scale user study, with developers of several open projects, as well as developers of proprietary projects. Our user study indicates that when insights are generated they often are helpful and non trivial, and are free from hallucinations.
