Tree-sitter is a parser generator tool and an incremental parsing library. The official documentation states that it “can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited.” It was created by Max Brunsfeld, an engineer who worked on GitHub’s Atom editor team, and its repository license records a copyright of 2018 in his name. The project began as a long-running side effort before becoming a foundation for editor tooling.
The documentation lays out four design goals: tree-sitter aims to be general enough to parse any programming language, fast enough to parse on every keystroke in a text editor, robust enough to produce useful results even in the presence of syntax errors, and dependency-free, with a runtime library written in pure C so it can be embedded in any application. The combination of speed and error tolerance is what makes it suitable for live use inside an editor, where the source is almost always incomplete or temporarily invalid as the programmer types.
The decisive feature is incremental parsing. Rather than re-parsing an entire file after each change, tree-sitter updates only the portions of the syntax tree affected by an edit, reusing the unchanged subtrees. This keeps parsing fast even on large files and makes it practical to maintain an accurate, up-to-date parse tree continuously while editing. A grammar for a language is written as a declarative description and compiled into a fast C parser, so adding support for a new language means writing a grammar rather than hand-coding a parser.
Because tree-sitter produces a real concrete syntax tree, it can drive features that line-based regular-expression tokenizers cannot do accurately. Its highlighting system uses query files that capture nodes in the tree and assign highlight names, so coloring reflects true syntactic roles and supports language injection. The same tree powers code folding, structural selection, and navigation, letting one accurate model of the source serve many editor capabilities.
Tree-sitter was first integrated into Atom and into GitHub.com’s code analysis, and was subsequently adopted by Neovim and many other editors and tools as their parsing backend. By providing a fast, robust, error-tolerant parser usable on every keystroke and a growing collection of community grammars, tree-sitter became a standard infrastructure layer for editor intelligence, comparable in influence to LSP on the language-server side.