A code index is useful when it returns the right source at the right revision. A fast answer pointing to a deleted function is worse than a slower search that exposes its limits. This comparison separates structural navigation, semantic retrieval and MCP integration, then gives you a way to test them on your repository.

This is a documentation review, not a hands-on speed benchmark. The previous version described specific TypeScript and Django trials without retained execution records. Those trials cannot support a product recommendation and have been removed.

What the four projects actually document

ProjectDocumented approachWhat to check before choosing
SourcegraphInstance-backed code search and navigation exposed through MCPRepository permissions, indexed revision, and which tools the instance enables
CodeGraphA local code graph with symbol and relationship queriesLanguage support and whether dynamic dispatch is represented accurately
Claude ContextSemantic code search backed by embeddings and Milvus/Zilliz configurationBoth the embedding destination and vector storage destination
CocoIndex CodeIncremental code retrieval with local or cloud embedding optionsInstalled package variant and the configured embedding provider

Sourcegraph’s MCP documentation distinguishes the core endpoint from the full tool suite. Connecting MCP does not mean every navigation tool is available. CodeGraph’s README describes its local graph; that is not proof that every downstream call or affected test will be discovered.

Claude Context’s setup explicitly configures Milvus/Zilliz and an embedding provider. The earlier “Milvus, Qdrant, or similar” wording implied interchangeable backends without evidence. CocoIndex’s README distinguishes its full package with local embedding dependencies from a slim package requiring a cloud provider. “Runs locally” therefore needs a configuration qualifier.

Choose by the question you need answered

For “where is this symbol defined?”, start with exact symbol navigation. For “where do we retry expired credentials?”, semantic retrieval may help when you do not know the identifier. For “what breaks if this interface changes?”, combine references with tests and review; neither an embedding match nor a graph edge proves runtime behavior.

Do not collapse these tasks into one leaderboard. A semantic search can return useful examples while missing a required caller. A structural query can find references but fail to connect a runtime plugin registration. Record the unanswered part explicitly rather than asking the model to fill the gap.

A practical selection sequence is: identify the question, establish the repository boundary, inspect data destinations, then measure retrieval. Teams with several repositories should test cross-repository permissions and revision alignment. A single-repository developer should first establish whether an index improves on ordinary identifier and text search.

Run a retrieval and freshness evaluation

Use the code-index evaluation sheet. For each task, manually identify the expected files or symbols before using the tool. Keep that answer key out of the agent’s prompt.

Record the repository commit, index version, query, expected symbols, returned symbols, missing symbols and irrelevant matches. Then rename a function, delete a file and change a caller. Repeat the same queries and record how stale results disappear. Measure initial indexing separately from incremental updates and query latency.

Count total retrieved text as well as tool calls. One large result can cost more context than several small results. Keep failed queries and empty answers in the results. If a query needs a manual hint, record the hint as a different condition.

For a deterministic illustration, the downloadable metric helper compares expected and returned symbol sets and prevents duplicate matches from inflating the score. Its offline results validate the arithmetic only; they say nothing about these products’ retrieval quality.

Privacy and adoption checks

Map source files, embeddings, query text and returned snippets to their destinations. A local index can still feed source code to a cloud model through the agent. Check ignore rules using an innocuous sentinel file, and verify it is excluded from both indexing and query results. Do not test with real secrets.

Keep an ordinary search fallback. When results disagree, open the current source file and run the relevant test. Adopt an index for a documented retrieval benefit, not an assumed token-saving percentage. Review the configuration again when changing embedding providers or agent models.

Revision note

Updated October 20, 2026. Removed unsupported indexing times, token-saving confirmations and firsthand project anecdotes. Corrected backend and local-embedding qualifications and added a reproducible retrieval protocol.

Primary sources

Checked October 20, 2026: sourcegraph; codegraph; claude context; cocoindex.