Interlinked.

Guides · updated July 2026

How to index a codebase for AI: the right way.

Most guides answer this the same way: point your editor at a repo, wait for it to build an index, and rebuild it whenever things drift. It works: for the one folder you opened, in the one tool you opened it in, until the next save makes it stale. Do that per repo, per tool, on a schedule, forever. There is a simpler answer, and a real 4.47-million-file machine proves it out: index the whole machine once, keep it fresh automatically, and hand the same map to every agent. Here are your options, honestly ranked, and the setup.

The short version

Index once, machine-wide. Not once per repo, forever.

Indexing a codebase for AI means building a searchable map of your files (their names and their contents) that an agent can query in a single tool call instead of grepping the disk from scratch every time it needs something. The question this guide settles is where you draw the box: around one repo, or around the whole machine.

The common way is stale and siloed. A separate index per repo, per tool, rebuilt on a schedule, blind to your other repos and to the ~90% of the disk that was never in git.

The right way is one machine-wide index, always fresh. Every repo plus the non-git files, searchable about a millisecond after you hit save. No rebuild button, no schedule.

One index feeds every agent. Cursor, Claude Code, Copilot and 16 other clients read the same map through one connector. No per-tool re-indexing.

The numbers are absurd on purpose. On a 4.47M-file machine it finds a file in 85 microseconds, and a string ripgrep needed 93.8 seconds for comes back in 16 milliseconds.

Keep your editor's index. This is the literal, whole-machine layer underneath it, not a replacement for the meaning-search inside your IDE.

Four ways to make a codebase searchable

Your options, honestly ranked.

There are four real ways to give an AI agent search over your code. Each is good at the job it was built for: the differences are what they cover, how they stay fresh, and which agents can actually use them.

The approachWhat it coversFresh after a saveWhich agents can use it
grep / ripgrep, on demandNothing kept: walks the disk each queryAlways current, never pre-builtAny agent, but it re-scans every time
Per-repo embeddings (Cursor)The one repo you opened, as meaningRe-embeds edits, cloud round-tripOnly Cursor
Org code graph (Sourcegraph)Many repos, the pushed stateRe-index cycles, on a serverIts own UI and API
Whole-machine live index (Interlinked)Every file: names + contents, all repos + non-git~1 ms after you saveEvery agent, one connector

The top three are the standard playbook, and every one of them draws its box around a subset of your work. grep and ripgrep keep nothing, so they pay the full scan on every query. Cursor's embeddings are excellent, but they stop at the folder you opened and live in Cursor's vault, reachable only from Cursor. Sourcegraph sees many repos, but on a server, and only the state you pushed. The fourth row is the one nobody set as the default.

The choice, drawn to scale

Many small islands, or one whole map.

Put the two approaches side by side and the trade-off stops being abstract. On the left, an index per repo, per tool, rebuilt on its own timer, each one an island that cannot see the next. On the right, a single index over the whole machine, fresh a millisecond after you save, handed to every agent at once.

THE COMMON WAYPER-REPO RE-INDEXone index per repo · per tool · on a scheduleapp-webown index: stale between runsRE-INDEXapi-serverown index: stale between runsRE-INDEXmobile-appown index: stale between runsRE-INDEXEACH INDEX IS AN ISLAND× blind to your other repos× blind to the non-git 90% of the disk× one tool cannot read another's indexTHE RIGHT WAYONE MACHINE-WIDE INDEXone index · every repo + non-git · always freshTHE WHOLE MACHINE · 4.47M FILESapp-webapi-servermobile-app+9 moreTHE NON-GIT 90%docs · configs · downloads · other projects▸ save → searchable in ~1 ms▸ file in 85 µs · content in ~9 msONE INDEX, EVERY AGENT+ every repo + the non-git 90%, together+ fed to 19 AI clients through one connector+ no manual re-indexing, ever
Per-repo re-indexing is work that never ends

Every repo needs its own index job, and every save leaves it a little stale between runs. Multiply by the number of tools you use, and you are maintaining a fleet of indexes that never quite agree with each other.

A whole-machine index is built once and never rebuilt

It covers every repo and the non-git files in the same map, and it updates itself the instant a file changes, so an agent never acts on a stale answer without knowing it.

The map belongs to the machine, not a tool

Because one connector exposes it, Claude Code, Cursor and Copilot all read the identical index. Nothing has to be re-indexed per agent, and no vendor holds it hostage.

Freshness is architecture, not a schedule

A re-index cycle is a promise to be wrong for a while.

Any index rebuilt on a timer is correct right after it runs and drifting every second after. In the gap, the agent searches confidently and gets yesterday's answer, the worst kind of wrong, because it looks right. The fix is not a shorter timer. It is to stop using a timer at all: the moment you save a file, the system hands the change straight to the index, and the edit is searchable about a millisecond later, searchable before your finger leaves the key, under 30 ms even in the worst case.

Whole-machine matters for the same practical reason. An agent's questions do not respect folder boundaries: the answer is often in a sibling repo, a config file, or the PDF three folders over that was never in git. Scope the box to one repo and everything outside it is dark. Scope it to the machine and the box holds all 4.47 million files at once, with the option to narrow to a single folder when you already know where to look.

And it is fast enough that scope is cheap. A single filename lands in 85 microseconds (over a thousand times quicker than a blink) and a content query that took ripgrep 93.8 seconds on this machine returns in 16 milliseconds: long enough to read this paragraph, versus gone before you glance up.

Do it in one install

The setup, over MCP.

The whole-machine index connects to your agents through MCP, the open protocol agents use to call outside tools. One connector, read by every client. New to it? What an MCP server is, in plain English. The steps:

1

Install once. One signed installer for Windows. No JSON to edit, no keys to paste, no cloud account to create.

2

Let it index the machine. Filename search works immediately; contents fill in behind it. At rest the whole engine sits around 44 MB (less than one browser tab) and the index on disk stays under 1% of the drive.

3

Your agents are wired up automatically. The same install configures 19 AI clients over MCP: Claude Code, Cursor, Copilot, Codex, Windsurf, Zed, Cline and the rest. They all read the one index.

4

Search whole-machine, or scope to a folder. Whole-machine when you don't know where something lives; scoped to a repo or folder when you do. Scoped queries return in the microsecond range.

5

Never re-index again. Saves are picked up the instant they happen, so the map stays current on its own. There is no rebuild button and no schedule to babysit.

That is the entire difference from the per-repo playbook: you configure nothing per repo and nothing per tool. Point at the machine once, and every agent you already use inherits a fast, literal, always-current map of everything on it.

What one machine-wide index buys the agent

One index. Every agent. Always fresh.

The point of indexing the whole machine is not neatness: it is what the agent stops doing. Instead of grinding through directory listings and grep, it asks one question and gets an answer at memory speed. Measured on the same machine, watching a coding agent look for a single file: from 6 minutes 57 seconds and 71 tool calls down to 16 milliseconds and one call (seven minutes of grinding, or a single blink) and the share of session tokens spent hunting for files fell from ~58% to ~0%.

85 µs
to find one file among 4.47M: 139 µs median across a run of 20 queries
16 ms
for a content query that took ripgrep 93.8 s on the same machine
~1 ms
from saving a file to that edit being searchable: no rebuild, no schedule
19
AI clients wired up in one install, all reading the same index over MCP

And because it already read every repo to build the index, it seeds a knowledge vault for free: on a fresh machine it replayed 8,455 git events in 1.7 seconds (the whole history, before the coffee finished) and drew 26,958 relationship pairs across the 12 repos it found, including two that quietly shared 435 identical files. That is the umbrella idea behind all of this: context acquisition is the bottleneck under every agent, and a machine-wide index is how you fix it.

MEASURED ON RYZEN 9 9950X3D · 64 GB DDR5 · NVMe · WINDOWS 11 · 4.47M FILES. NOT A REPLACEMENT FOR YOUR IDE'S INDEX, THE LAYER UNDER IT.

Questions people actually ask

FAQ.

What does it mean to index a codebase for AI?

It means building a searchable map of your files (their names and their contents) that an AI agent can query in one tool call, instead of walking the filesystem and grepping bytes every time it needs something. A good index answers in microseconds to milliseconds and stays current as you edit.

Do I still need Cursor's or Copilot's index?

Keep it. This guide isn't asking you to give up the meaning-search inside your IDE. Cursor's embeddings are the right tool for the repo you have open. A whole-machine index is the literal, exhaustive layer underneath: every repo, the non-git files, handed to every agent. Different job, complementary.

How often do I have to re-index?

Never, manually. The whole-machine index isn't rebuilt on a schedule: it updates itself the moment a file changes, so a saved edit is searchable in about a millisecond and under 30 ms in the worst case. There is no rebuild button to press.

Can one index serve Claude Code, Cursor, and Copilot at once?

Yes. It connects through MCP, the open protocol agents use to call tools, and one install wires up 19 clients: Claude Code, Cursor, Copilot, Codex, Windsurf, Zed, Cline and more. They all read the same index; nothing is re-indexed per agent.

Is my code sent to the cloud to be indexed?

No. The index is built and stored on your machine, fully offline: no cloud, no model, no content leaving the disk. It's a local file you can delete. That's the opposite of embedding-based indexes that round-trip your code to a server.

Index the machine, not the repo

Give every agent one fresh map of your machine.

One signed installer indexes every file on your machine (names and contents, every repo plus the non-git 90%) and wires up the AI clients you already use over MCP. No JSON editing, no cloud account, no keys, and no per-repo re-indexing ever again. Keep your editor's index for what it does well; give every agent a fast, literal, always-current search alongside it.

Everything local is free, forever: the app, whole-machine search, MCP. Hosting starts at $5.99/mo. Download for Windows · What Cursor's index can't see

Measured July 2026 · Ryzen 9 9950X3D · 4.47M files · Windows 11← All research