What is repository context?

Definition

Repository context includes more than the file being edited. A coding agent may need nearby modules, interfaces, tests, package configuration, generated-file boundaries, current changes, commit history, project instructions, and search results that reveal how a behavior is used elsewhere.

Context should be gathered according to the task rather than loaded indiscriminately. Focused search and direct inspection reduce token use and stale assumptions while preserving the authoritative relationships needed to make a safe, compatible change.

ELI5

Repository context is the collection of project information needed to understand a software change correctly. It can include nearby code, tests, configuration, documentation, project rules, current edits, and the places where a function is used.

For example, changing one button may also require checking a shared style file, an accessibility test, and another page that reuses the same component. Gathering the relevant context helps a coding agent avoid a change that works in one file but breaks the wider project.

How does a coding agent gather repository context?

It can inspect project instructions, search symbols and text, read related files, check version-control state, and run relevant diagnostics.

Why not store all repository context in permanent agent memory?

Repositories change frequently, so copied context becomes stale and is often less reliable than targeted inspection of the current source.

  1. Theo Browne beside the words Delete the Memory
  2. Portrait of Greg Isenberg beside the words Build AI Employees
  3. Bijan Bowen beside the words Review 12,000 Lines
  4. Portrait of Alex Finn beside the words Hermes Builds Agent Teams
    Hermes Bot Multi-Agent Workflow Review
    Alex Finn22m 29s1 VIEW
  5. Flat agent workflow beside the words GLM 5.3 in Zcode
  6. Portrait of Nate B. Jones beside the words Route Work by Risk
  7. Portraits of David Ondrej, Alex Lieberman and Dan Zakon beside the words Context Is the System
    Context as Code for Agentic Engineering
    David Ondrej51m 54s2 VIEWS
  8. Broken software connection beside the words OpenAI Cuts Cursor Access
  9. Portrait of Ray Fernando beside the words Agents Run the Repo
  10. Theo Browne on understanding codebases with AI
Definition card for repository context: What is repository context?

Repository context is the relevant source, configuration, history, documentation, dependencies, and worktree state needed to understand a software task.