RepoMaster: Autonomous Exploration and Understanding of GitHub Repositories for Complex Task Solving

Huacan Wang, Ziyi Ni, Shuo Zhang, Shuo Lu, Sen Hu, Ziyang He, Chen Hu, Jiaye Lin, Yifu Guo, Yuntao Du, Pin Lyu

Introduction

While Large Language Models (LLMs) have demonstrated remarkable proficiency in generating code snippets and scripts, they frequently falter when tasked with real-world software engineering challenges. These tasks often require navigating expansive, multi-file repositories where the sheer volume of information exceeds the context windows of even the most advanced models. RepoMaster introduces a paradigm shift in autonomous software engineering: moving away from generating code from scratch toward the intelligent exploration and reuse of existing GitHub repositories.

The Challenge: Information Overload and Tangled Dependencies

Current state-of-the-art code agents, such as OpenHands and SWE-Agent, typically encounter two primary obstacles when interacting with complex codebases. First, information overload occurs because repositories are often too large to fit within an LLM's context window. Second, tangled dependencies make it difficult for agents to understand how disparate modules, classes, and functions interact based solely on a README or a flat file list.

In contrast, human programmers do not read every line of a new codebase. Instead, they map out the high-level structure, identify core components, and "jump" to relevant files based on specific needs or error traces. RepoMaster is designed to mimic this efficient, goal-oriented exploration.

The RepoMaster Framework

RepoMaster operates through a three-stage pipeline designed to maximize understanding while minimizing resource consumption.

1. Repository Search and Validation

The system begins by analyzing user intent to identify the most relevant GitHub repositories. It validates candidates based on metrics such as star counts, README quality, and practical utility to ensure the agent starts with a high-quality foundation.

2. Hierarchical Repository Analysis

This stage serves as the "brain" of RepoMaster. It performs static analysis to construct three critical structural artifacts:

  • Hierarchical Code Tree (HCT): A comprehensive map of packages, modules, and classes.
  • Function Call Graph (FCG): A visualization of function-level interactions.
  • Module Dependency Graph (MDG): A map of explicit imports between files.

By applying algorithms like PageRank to these graphs, RepoMaster calculates an importance score for each component. This allows the system to identify "core components" that are prioritized in the LLM's initial context, providing a structural roadmap rather than a raw text dump.

3. Autonomous Exploration and Execution

The agent enters an iterative loop, alternating between code generation and repository exploration. It utilizes specialized tools—including Granular Code View and Dependency Analysis—to navigate the codebase. A "Context-aware Information Selection" mechanism prunes logs and documentation, ensuring the LLM only processes the most critical data (e.g., keeping the initialization and error traceback of a log while discarding verbose middle sections).

Evaluation and Benchmarking

RepoMaster was evaluated using two primary benchmarks:

  • MLE-R: A revised version of the MLE-bench (Machine Learning Engineering), featuring 22 tasks derived from Kaggle competitions.
  • GitTaskBench: A new benchmark introduced by the authors, consisting of 18 repositories and 54 tasks across domains like image processing and security. Unlike traditional benchmarks focused on bug fixing, GitTaskBench requires the agent to use a repository to solve high-level tasks, such as restoring an old photo using a specific library.

Key Results

When tested against baselines like OpenHands and SWE-Agent using models such as GPT-4o and Claude 3.5 Sonnet, RepoMaster demonstrated superior performance and efficiency:

  • Performance Leap: On the MLE-R benchmark, RepoMaster achieved a 95.45% valid submission rate with Claude 3.5 Sonnet, more than doubling the performance of the strongest baseline.
  • Task Success: On GitTaskBench, it improved the task pass rate from 40.7% to 62.9%.
  • Resource Efficiency: RepoMaster achieved a staggering 95% reduction in token consumption. On GitTaskBench, it used an average of 154k tokens per task, compared to 2,883k tokens for OpenHands.

Conclusion and Future Work

The success of RepoMaster underscores a vital insight: providing an LLM with a structural map of a codebase is significantly more effective than providing raw text. By investing in upfront static analysis, the system avoids the "efficiency paradox" where agents waste resources wandering blindly through code.

While currently optimized for Python, future iterations of RepoMaster aim to expand support for languages like C++, Java, and Rust. Additionally, the authors envision "Multi-Repo Orchestration," where agents can coordinate across multiple repositories to solve complex, multi-domain problems.

Summary updated

BibTeX
@inproceedings{wang2025repomaster,
  author = {Huacan Wang and Ziyi Ni and Shuo Zhang and Shuo Lu and Sen Hu and Ziyang He and Chen Hu and Jiaye Lin and Yifu Guo and Yuntao Du and Pin Lyu},
  title = {{RepoMaster: Autonomous Exploration and Understanding of GitHub Repositories for Complex Task Solving}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=aSfBbhUJAa},
}
Figure