Repository Shape Is Cognitive Architecture

A repository is not just code storage — it is the working memory and context boundary of an agentic workflow; too broad and it poisons context, too narrow and the agent starves, so repo shape is a design decision, not an accident.

What it is

A repository looks like storage — a place files live — but in an agentic workflow it functions as working memory and a context boundary. What is inside the repo is what the agent can see, search, and reason over; what is outside it is, for practical purposes, invisible. That makes repo shape a context-engineering decision with a sharp tradeoff in both directions. Make the repo too broad — a sprawling mono-repo where the agent can reach everything — and you poison the context: the agent retrieves irrelevant files, conflates unrelated concerns, and burns its attention budget on noise. Make it too narrow — a tightly scoped slice that excludes a needed dependency, a shared schema, or the doc that explains a convention — and the agent starves, hallucinating the information it cannot reach. The mono-repo-versus-narrow-repo question is therefore not an org-chart or build-system question alone; it is a question about what the agent should hold in working memory for a given class of work. Repository boundaries become part of the cognitive architecture of the system, and like any architecture they should be chosen deliberately, sized to the work, and revised when the work changes — not inherited by accident from how the code happened to be split.

When to reach for it

When NOT to

Exemplars

Related