Most AI coding assistants read your files. A developer working on a 400,000-line Unity project found they perform significantly better when they can query the compiler instead.
The difference matters more than it sounds. When an AI agent reads a raw file, it sees text. It can guess from variable names that userScore is probably a number, and infer from context that GetComponent<T>() is a Unity method - but it's guessing. A compiler knows. It knows the exact type of every variable, which methods are available on every object, where every function is called across the entire codebase, and what would break if you changed a method signature.
What Compiler-as-a-Service Actually Means
Microsoft built this concept into Roslyn, their .NET compiler platform, more than 12 years ago. Roslyn doesn't just compile C# code - it exposes its full understanding of your code through a queryable API. Tools like Visual Studio and VS Code's C# extension use Roslyn to power "Go to Definition", "Find All References", and real-time error highlighting. They're not parsing text files to do this. They're asking the compiler.
For AI agents, the same access means: instead of reading 400 files to understand how a class is used, ask the compiler which files reference it. Instead of guessing a method's return type from its name, ask the compiler what it actually returns. The queries are instant, exact, and don't consume the model's context window (the total amount of text an AI can hold in working memory at once) the way reading entire files does.
The Tools Already Doing This
This isn't a gap without solutions. The Language Server Protocol (LSP) - the standard that powers VS Code's code intelligence across most programming languages - provides exactly this kind of semantic access. AI coding tools like Cursor and Cody already tap into tree-sitter and LSP integrations to give their models structured code understanding rather than raw text. Aider can integrate with LSP tooling for better context on larger projects.
What's slower to change is the default workflow. Most developers still reach for "paste the files into context" when something complex breaks. For a 400-line file, that's fine. For a 400,000-line codebase, it's a fundamental mismatch between what the agent is given and what it needs to do useful work.
The Roslyn observation cuts both ways: this problem was solved in a different context long before AI coding existed, and the same solution applies. Give the agent a proper interface to the code, not just the text.