# Repository Index

> Read the code of a folder into symbols and relations, and let an agent ask where something is, who calls it and what a change would break.

The Repository Index turns the code of an MCP folder into a map: the symbols in it (classes, interfaces, types, enums, functions and methods), the files, and the relations between them, such as which function calls which. An agent asks the map instead of searching the files. You can look at the same map in a window.

## When to use it

- An agent should find a function, a class or a file without grepping the folder.
- You want to know who calls something, or what a change would break, before you make it.
- You want a picture of how a repository divides into subsystems.

For how something behaves and why, ask a [vault](/devhub/features/vaults/index.md) first. See [Knowledge and code](/devhub/concepts/knowledge-vs-code/index.md).

## Languages

The index reads JavaScript and TypeScript, Python, C# and Java. Files in other languages are not indexed. When no file matches, the folder shows **Nothing to index** and no index is built.

## Build the index

The index belongs to an MCP folder of a project. Open **Projects** in the sidebar. Each MCP folder shows the state of its index.

1. Click **Analyze** next to a folder that shows **Not indexed**. DevHub reads the files and builds the index. A progress bar shows how many files are done, and you can cancel.
2. When the state is **Index ready**, click **View index** to open the Repository Index window.
3. After the code changes, the folder shows **Index stale** within about a second, without scanning. Click **Refresh index** to bring it up to date. **Reindex** builds it again from scratch.

While an index is being built, agents are served the last healthy one. If a build ends with errors, the previous healthy index is kept and still served, and **View errors** lists what went wrong.

## What the window shows

The **Repository Index** window shows counts of files, symbols, edges, routes, skipped files and errors. Its panes are named in English:

- **Symbols**, **Files**, **Routes** and **Changed** on the left;
- **Overview** and **Graph** in the middle, with **Source** and **Git History Compare** next to them;
- **Relationships** and **Impact** on the right;
- **Search**, **Git history** and **Errors** at the bottom.

Select a symbol to see what it calls, what calls it and what a change to it would reach. **Add to Context AI** puts the overview or a symbol in the [AI Context](/devhub/features/ai-context/index.md) queue.

> **Note:** The panes of this window keep their English names in the Polish interface.

## Subsystems

DevHub groups the symbols by how the code is connected, not by folders, and names each group. The names come from a model assigned to this job; the grouping itself needs no model. In a repository vault you can write the result as subsystem notes. DevHub asks first and lists how many notes are new, replaced, removed and left alone. A note you wrote by hand is left alone.

## What the index does not know

- Top-level constants, fields and properties are not symbols.
- A call whose target cannot be told apart is drawn to the most likely candidate and shown as a guess.
- A C# `using` of a namespace of the same repository stays unresolved.

## What an agent can ask

An agent reaches the index through the tools `repo_overview`, `repo_symbol_search`, `repo_symbol_get`, `repo_file`, `repo_callers`, `repo_references`, `repo_neighbors`, `repo_impact`, `repo_routes` and `repo_changed`. Routes include the channels between the parts of an Electron application. See the [catalog of DevHub tools](/devhub/reference/mcp-tools/index.md). Agents need a permission for these tools in your Vartari plan.

## Related

- [Organizations and projects](/devhub/features/organizations-projects/index.md)
- [AI Context](/devhub/features/ai-context/index.md)
- [Plans](/devhub/features/plans/index.md)
