How to Index a Codebase So Agents Stop Guessing

Index the repository with rdk vault:index and the code, docs, and decision records become encrypted private chunks your coding agents search before generating. The effect is that an agent answers from how your codebase actually works rather than from whatever happens to be in its context window.

The problem with context windows

A coding agent working in a large repository sees a slice. It reads the files it opened, infers the conventions from what it read, and writes code that matches that inference. When the slice is representative the result looks right. When it is not, the agent invents a convention that exists nowhere and applies it confidently.

Growing the window does not fix this, because repositories grow faster than windows and most of a repository is irrelevant to any given task. Stuffing more code into the prompt raises the cost of every call while lowering the signal in it.

Retrieval addresses the actual shape of the problem. The agent does not need the whole repository; it needs the three relevant paragraphs. Indexing makes those paragraphs findable.

Index the why, not only the what

Source code answers what the system does. It rarely answers why, and why is what agents get wrong.

So the highest-value material to index is often not the code: architecture decision records, postmortems, the pull request discussion where a pattern was chosen, the README section explaining a constraint that looks arbitrary. These are the things a new engineer asks about and an agent silently guesses at.

Indexed alongside the source, they turn a plausible guess into a retrieved answer with a reason attached.

What this looks like in practice

An agent asked to add an endpoint retrieves your error-handling convention, the decision record explaining why a middleware exists, and the naming pattern for handlers, then writes code that matches. None of that required a larger model or a longer prompt.

Keeping proprietary code private

Code chunks are encrypted with your vault key before they leave the machine, exactly as any other private chunk. The network holds ciphertext. RetroDeck cannot read your source, and neither can any other node.

Team access works through the vault key. Engineers holding it decrypt the same chunks and search the same index; anyone without it sees inert ciphertext.

Nothing from a codebase becomes public by indexing it. Publishing is a separate action, and it is one way, which is a good reason to keep it deliberate when the content is proprietary.

Frequently asked questions

Is my source code readable by RetroDeck?
No. Chunks are encrypted with your vault key before sync, so the network stores ciphertext only.
Should I index the whole repository?
Index what you want an agent to answer from. Decision records, conventions, and architecture notes usually deliver more retrieval value per chunk than exhaustive source coverage.
How is this different from a bigger context window?
A window has to hold the content on every call. An index does not, so retrieval keeps working at repository sizes no prompt can accommodate, and costs a lookup rather than a generation.
Does this replace reading the code?
No. It gives an agent the conventions and reasons that the code does not state, so what it does read is interpreted correctly.