Comparisons · measured July 2026 · 8 min read
Sourcegraph vs GitHub code search. Two clouds that can't see the file you just saved.
Sourcegraph and GitHub code search are two of the best code searches ever built. Point either at your repositories and it will find a symbol across millions of lines in a heartbeat. They are also built the same way: the index lives on a server, and it sees the code you have pushed. Which means neither one has seen the file you changed thirty seconds ago, the .env you git-ignored, or the repo still sitting only on your laptop.
That gap matters more now that GitHub Copilot leans on the same index: its sense of your whole codebase is only as fresh and as complete as what you have pushed. This is an honest comparison of the two, and then the third option neither is: a local index that sees the whole machine, measured, on 4.47 million real files.
TL;DR · the 60-second version
- 01
Sourcegraph and GitHub code search are two of the best code searches ever built, and both do the same thing: they index a copy of your code on a server and answer queries across it.
- 02
Both see the same slice: the pushed default branch. Neither has seen the file you saved thirty seconds ago, your git-ignored files, or the repos you never pushed anywhere.
- 03
GitHub Copilot leans on that same index: its whole-codebase awareness is only as complete as what you have pushed to GitHub.
- 04
A local whole-machine index is the third option: it indexes every file on the disk (uncommitted, git-ignored, non-git) fresh about a millisecond after a save, offline, and for every agent at once.
- 05
Interlinked Files is that local index: 85 microseconds to find a file across 4.47M, a content query indexed in 16 ms, about 44 MB idle, one install wiring up 19 AI clients.
The two you already know
Both are excellent. Neither is the enemy.
This is not a teardown. Each is the right tool for the job it was built for. Here is the crisp version of what each one is, so the comparison that follows is fair.
Sourcegraph is a code-search and code-intelligence platform: point it at your organisation's repositories (across GitHub, GitLab, Bitbucket, wherever they live) and it builds a cross-repo index on a server, cloud or self-hosted, with go-to-definition, find-references, and search that spans every repo at once. It indexes the committed, pushed state.
GitHub code search is the search engine built into GitHub: a purpose-built engine GitHub wrote about publicly, in Rust, that indexes the code hosted on GitHub for fast substring, regex, and symbol search. It is also the repository context GitHub Copilot draws on when a question is about the whole codebase rather than the file open in front of you.
One thing both share by design: they see what has been pushed to the server, not the working copy on your disk this second, and never the files that were never in git to begin with. That single fact sets the whole comparison below.
The whole comparison in one picture
Two clouds, one machine.
Draw it honestly and the two products land in the same place: server-side indexes above the machine, each reaching only the code that has been pushed up to it. Your disk holds far more than that pushed slice: the edit you have not committed, the git-ignored config, the download, the repo that never left the laptop. A local index sits inside the machine and covers every layer of it at once.
It is the same shape whichever server-side search you use: the difference is only where the index sits relative to the edge of your machine. That server-versus-local trade-off, with the freshness and privacy math, is drawn out in Sourcegraph vs local search.
Row by row
The same question, asked three ways.
This is not “who is faster”: a server code search and a local index answer for different scopes. It is a map of what each one can actually reach: where it lives, which state it sees, and whether the files you did not push exist to it at all.
| The question | Sourcegraph | GitHub code search | Local · Interlinked |
|---|---|---|---|
| What it indexes | your configured repos, across code hosts | code hosted on GitHub | every file on the machine, names + contents |
| Where the index lives | a server: their cloud, or one you host | GitHub's servers | on your disk, beside the files |
| State it can see | the pushed default branch | the pushed default branch | the live working copy, this second |
| Uncommitted changes | not until you push | not until you push | searchable ~1 ms after you save |
| Git-ignored + non-code files | no, not in the repo index | no, not on GitHub | yes: .env, PDFs, configs, downloads |
| Repos never pushed anywhere | invisible | invisible | indexed like any other folder |
| Privacy | code is indexed on a server | code lives on GitHub | nothing leaves the machine, offline |
| Who can query it | your org, via its own surfaces | you + Copilot, via GitHub | every agent on the machine, 19 clients |
| Best for | org-wide cross-repo code intelligence | searching GitHub-hosted code + Copilot | the machine in front of you, and its agents |
Sourcegraph and GitHub behaviour is their documented, public design: server-side indexes of the pushed state. The Interlinked figures are measured on a Ryzen 9 9950X3D · 64 GB DDR5 · NVMe · Windows 11 · 4,470,000 files: a single filename lands in 85 µs (best case 2 µs), the 20-query median across the whole drive is 139 µs, and a content query that took ripgrep 93.8 s on this corpus returned in 16 ms. Full methodology in the 412,000× VS Code write-up and the ripgrep comparison.
The shared blind spot
A server search sees what you pushed. Your agent works on what you didn't.
Both index the pushed default branch, so both are only ever as fresh as your last push. The moment you are mid-change, the answer drifts stale: the file you saved thirty seconds ago is not in either cloud until you commit and push it. And an enormous part of a working machine was never on a code host at all: the git-ignored files (.env, build output, local secrets), and the non-git 90%: PDFs, configs, exports, the download with the answer. To Sourcegraph and GitHub, none of it exists. See searching git-ignored files.
That is exactly the gap an agent falls into. It does not live in one pushed repo: it needs the working copy this second, across every repo and the files around them. So it falls back to walking the disk on every query, because nothing warmer exists machine-wide. A pre-indexed engine that stays warm in the background closes the gap: a file you just saved is searchable in about a millisecond, under 30 in the worst case, and one install hands the same index to 19 AI clients through one MCP server.
The third option
Keep both clouds. Add the machine in front of you.
Interlinked Files keeps an always-fresh index of every file on the machine (names and contents) across every repo and the non-git 90%, and hands it to whatever agent you use through one connector. It never leaves the machine, and there is no model anywhere in the box: every result is an index lookup, not a guess. Here is what that costs and delivers, measured on the same drive.
For scale: finding one filename took Windows Search 67 seconds median on this machine (long enough to refill your coffee) against 139 microseconds here, about 480,000× faster. And the vault seeds a fact no server-side index can represent: on install it found two local repos sharing 435 identical files, unprompted, just counts and hashes a human can check. Methodology: Ryzen 9 9950X3D · 64 GB DDR5 · NVMe · Windows 11 · 4.47M files. The umbrella argument lives in the backbone of the LLM economy.
SOURCEGRAPH AND GITHUB FOR THE CODE YOU PUSHED. INTERLINKED FOR EVERYTHING ON THE MACHINE: LIVE, PRIVATE, FOR EVERY AGENT.
Questions people ask
The honest FAQ.
Is Sourcegraph better than GitHub code search?
Neither is simply “better”: they cover slightly different scopes. Sourcegraph is a cross-repo code-search and code-intelligence platform that indexes repositories from any code host, cloud or self-hosted, with go-to-definition and find-references across them. GitHub code search indexes the code hosted on GitHub and is the context Copilot draws on. Both are server-side, and both index the pushed default branch, so both share the same blind spot for anything you have not pushed.
Can GitHub code search or Copilot see my uncommitted or git-ignored files?
No. Both index the pushed default branch on GitHub's servers. The working copy you have not pushed, your git-ignored files (.env, secrets, local build output) and any repo you never pushed are invisible to them. A local index reaches all of it; see how to search git-ignored files.
What is GitHub's Blackbird / the engine behind code search?
GitHub code search is powered by a purpose-built search engine GitHub wrote from scratch and described publicly on its engineering blog: written in Rust, it indexes the tens of millions of repositories hosted on GitHub for fast substring, regular-expression, and symbol search. It is genuinely fast at what it does: search the code that lives on GitHub. It is not a search of the files on your own disk.
Do I have to choose between a cloud code search and a local index?
No: they answer for different places. Keep Sourcegraph or GitHub code search for the pushed, org-wide code they are built for, and add a local whole-machine index for the disk in front of you: the uncommitted, the git-ignored, the non-git 90%, offline, and for your agents. The server-versus-local trade-off is drawn out in Sourcegraph vs local search.
Does the local index send my code anywhere, and what does it cost?
Nothing leaves. There is no model, no embeddings, no cloud round-trip: a query is a lookup against an index on your own disk. The engine sits around 44 MB at rest and its index stays under 1% of the drive. Everything local is free forever, on all your devices, no card. Hosting starts at $5.99/mo.
Do this today
Index the machine a cloud can't reach.
Install once. One signed installer indexes every file on your machine (names and contents, every repo plus the non-git 90%) and wires up 19 AI clients: Claude Code, Cursor, Copilot, Codex, Windsurf, Zed, Cline and the rest. No cloud account, no keys, no JSON editing.
Let it index. Filename search works immediately; content search fills in behind it. At rest the whole engine sits around 44 MB (less than a browser tab) and stays about a millisecond behind your saves.
Ask normally. Your agent picks the right tool by itself. Ask where something is, or what mentions it; the answer comes back in microseconds, whole-machine, including the uncommitted and git-ignored files no server index can see.
Keep your cloud search. Sourcegraph and GitHub keep doing their job for the pushed, org-wide code. Interlinked runs alongside them for the live, private disk in front of you.
Everything local is free forever, on all your devices, no card. Hosting starts at $5.99/mo. Download for Windows · Server vs local search · Why finding files is the bottleneck