BootstrapAgent: Turning Repository Setup into Reusable Agent Knowledge
Abstract
Code agents increasingly help developers work with unfamiliar repositories. They must first set up a working development environment for each repository. This setup requires costly trial and error. Agents learn how to resolve dependencies and repair environment issues along the way. Yet this knowledge remains confined to a single conversation, leaving future agents unable to reuse it. To make this knowledge reusable, we introduce BootstrapAgent, a multi-agent framework for repository bootstrapping. It distills the heuristics discovered during exploration into a persistent, verifiable .bootstrap contract. Future agents can consume this contract to guide repository setup. BootstrapAgent extracts repository evidence to build a structured plan for setup, diagnostic checks, and minimal verification. It then generates the contract, verifies it in Docker, and uses execution traces to guide repairs. The contract also preserves the repair knowledge gained during this process. We further propose warm repair with clean replay to accelerate iterative debugging without sacrificing cold-start reproducibility, and a delta repair with sanity check to prevent reward hacking. Experiments on three benchmarks show that BootstrapAgent achieves a 90.7\% overall mean success rate on 212 repositories, while reducing downstream agent token usage by 20.3\% and build time by 28.0\%. Our code is available at https://github.com/Vossera/BootstrapAgent.