Empryoempryo.beta
← Glossary
definition

Code intelligence

Code intelligence is the set of capabilities that lets a tool understand source code structurally — symbols, references, types, and dependencies — rather than as plain text, enabling features like go-to-definition, find-references, rename, and diagnostics.

Code intelligence is what separates an editor that highlights syntax from one that actually understands your program. It is built on a parse of the code into structured forms: a syntax tree (often via tree-sitter), a symbol index, type information, and a graph of how files and symbols depend on one another. With that foundation, a tool can answer questions like "where is this function defined," "who calls it," "what type does this return," and "what breaks if I change it" — precisely, instead of guessing from string matches.

In modern toolchains, much of this is standardized through the Language Server Protocol (LSP), which decouples language analysis from the editor. A language server parses and type-checks a project, then serves capabilities — definitions, references, rename, call hierarchy, hover types, and live diagnostics — over a common protocol that any client can consume. This is why the same go-to-definition logic works across VS Code, Neovim, and other editors: the intelligence lives in the server, not the UI.

For AI coding agents, code intelligence is the difference between editing by text manipulation and editing by structure. An agent without it greps for strings, pastes whole files into context, and renames with regex — operations that miss shadowed identifiers, break on whitespace, and waste tokens. An agent with code intelligence reads a single symbol by name, follows real reference edges, and applies AST-level transformations that a compiler would accept. It also enables impact analysis: knowing a symbol's dependents (its blast radius) before a change is made.

The practical payoff is accuracy and economy. Structural reads keep prompts small (one function instead of a 500-line file), structural edits avoid false matches, and a dependency graph lets a tool reason about consequences instead of discovering them after a failed build.