# Tree-sitter
**Tree-sitter is a parser generator and incremental parsing library that turns source code into a concrete syntax tree, fast enough to re-parse on every keystroke.** Originally built for the Atom editor; now the parsing backbone of editors, linters, and AI code tools alike.
Two properties make it the default choice:
- **Incremental.** When you edit a file, it re-parses only the changed region instead of the whole file. That's what makes live syntax highlighting and structural editing feel instant.
- **Error-tolerant.** It produces a usable tree even when the code is half-written or broken, which is most of the time in a real editor.
Grammars exist for 28+ languages and ship as small native parsers. Tools query the tree to understand structure rather than guessing with regex.
## Why it shows up in AI tooling
When a code-intelligence tool needs to chunk a codebase along real boundaries (functions, classes, blocks) instead of arbitrary line windows, it leans on Tree-sitter. That's exactly how [[CocoIndexCode]] does AST-aware chunking before embedding.
License: MIT.
## References
- https://tree-sitter.github.io/tree-sitter/
- https://github.com/tree-sitter/tree-sitter
## Related
- [[CocoIndexCode]]
- [[CodeGraph]]
- [[CocoIndex]]