A large language model generates or transforms language from prompts. Used programmatically, it turns questions about code into repeatable analysis workflows rather than one-off chat responses. section 2.5.1
Treat its context window as a finite analytical budget. Broad prompts produce shallow summaries, while focused prompts can trace one component, its code, and its connections in depth. section 3.3
Use an LLM to understand a repository through a staged workflow:
- Measure repository size and file count before choosing an ingestion strategy. section 3.2.1
- Prune tests, documentation, lock files, vendored code, and oversized files mechanically. section 3.2.2
- Send previews containing imports, class definitions, and docstrings so the model can select relevant files. section 3.2.2
- Prioritize entry points and concrete implementations instead of relying only on abstract base classes. section 3.2.3
- Request an architectural overview first, then separate deep analyses for individual components. section 3.3
Filtering a large repository
A two-phase filter reduces the VS Code repository from 146 MB and 10,000 files to 2.1 MB and 47 files: mechanical crawling removes obvious noise, then the LLM selects architecture-relevant files. section 3.2.2
Table 3.2 Repository sizes, from small projects that fit in an LLM's context window to large ones
|
Tier
|
Examples
|
Code size
|
Strategy
|
|
Small
|
Flask,
FastAPI, Express, Click, Typer, most microservices
|
<1MB
|
Dump
everything. Don't overthink it.
|
|
Fits
|
Django,
Ruby on Rails, Spring Boot, Nest.js, SQLAlchemy
|
2-5MB
|
Skip tests/, docs/, examples/, vendored
code. The core fits once you remove the noise.
|
|
Borderline
|
HuggingFace
Transformers, LangChain, PyTorch, React, Next.js, VS Code (150MB), Kubernetes
(200MB)
|
10-500MB
|
Hundreds of
similar files that all look "core." File-level filtering isn't
enough. You need the LLM to triage, and for the largest ones, scope to a
subsystem first.
|
|
Too large
|
Linux kernel (1.2GB), Chromium (3GB),
Unreal Engine (4GB+), Android OS (10GB+)
|
1GB+
|
No single
tool handles this in one pass. Scope to one module (e.g., drivers/gpu/ in the
kernel, chrome/browser/
in Chromium), then treat that module as its own borderline repo.
|
Compare repository size tiers with their recommended context-management strategies, from dumping small projects whole to scoping oversized systems to one subsystem. section 3.2.1
























































































